You are not logged in.

#1 2019-09-13 17:16:52

pcattori
Member
Registered: 2019-09-11
Posts: 10

[SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

I have a ThinkPad X1 Extreme Gen2, which is an Nvidia Optimus machine. My goal is to connect to an external monitor via HDMI reliably.

I blacklisted nouveau in /etc/modprobe.d/nouveau.conf and got Arch installed and running SDDM/KDE Plasma via the xf86-video-intel driver. At this point, running lsmod | grep nouveau had no output, so I think nouveau was being blacklisted correctly.

However, I wanted to use the HDMI port to connect to an external monitor. From the wiki on my machine (https://wiki.archlinux.org/index.php/Le … me_(Gen_2)), it seems that using optimus-manager is the recommended approach. I installed the nvidia driver and optimus-manager and rebooted. But now, lsmod | grep nouveau shows that nouveau is being loaded and lspci -k shows:

$ lspci -k | grep -A -E "(VGA|3D)"
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f91 (rev a1)
             Subsystem: Lenovo Device 229f
             Kernel driver in use: nouveau
             Kernel modules: nouveau, nvidia_drm, nvidia

I would have expected the Kernel driver in use to be nvidia.

I followed the advice from a related post (https://bbs.archlinux.org/viewtopic.php … 3#p1103093), but 1) nouveau is not listed in my MODULES 2) I already blacklisted nouveau and 3) the only file in /etc/X11/xorg.conf.g/ is 10-optimus-manager.conf which to me looks correct:

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
    Option "DRI" "3"
EndSection

Once thing I found confusing is that usr/lib/modprobe.d/optimus-manager.conf blacklists not just nouveau, but also nvidia. Though I think this might be because currently I have optimus in "intel" mode, so if I switch to nvidia mode I'm guessing this file would change.

Anyway, the problem is that:

1) nouveau is being loaded and used as the driver for my Nvidia card even though its blacklisted and I have nvidia driver installed and
2) connecting to an external monitor via HDMI either causes both displays to go black or freeze
3) running lspci -k sometimes freezes (...because nouveau is loaded I think)

I also tried to run the suggested commands for Optimus when using only Intel graphics (https://wiki.archlinux.org/index.php/Le … us_Manager):

# tee /sys/bus/pci/devices/0000\:01\:00.1/remove <<<1
# tee /sys/bus/pci/devices/0000\:01\:00.0/remove <<<1

This made a display manager control pop up when I plugged in the HDMI, but when viewing the Displays system settings module, my machine does not detect the external monitor.

Last edited by pcattori (2019-09-16 19:24:29)

Offline

#2 2019-09-13 17:29:35

pcattori
Member
Registered: 2019-09-11
Posts: 10

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

UPDATE: I rebooted after running the tee commands above (unsure if I have to run these manually every time I boot up or not...), and now the monitor is being detected in Displays system settings module. The monitor renders my cursor, but the rest is black.

If I alter the refresh rate of the monitor, it then renders correctly (not black anymore, I see my screens / desktop) but it does not refresh afterwards, so the image I see on my monitor is static/stale/out-of-date. I saw that this may be a VSYNC issue, but not sure how I should resolve. Mouse does get redrawn / refreshed correctly, but nothing else does.

And lsmod still shows nouveau being loaded... which confuses me

Last edited by pcattori (2019-09-13 18:08:24)

Offline

#3 2019-09-13 18:12:37

pcattori
Member
Registered: 2019-09-11
Posts: 10

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

Detecting the monitor is inconsistent. Haven't changed anything, but if I reboot sometimes plugging in the HDMI does not bring up a external monitor control nor does it show up as a display in the Displays system settings module.

UPDATE: this could be related to whether I had the monitor plugged in during boot or not... not sure

Last edited by pcattori (2019-09-13 19:40:40)

Offline

#4 2019-09-13 20:47:46

Swiggles
Member
Registered: 2014-08-02
Posts: 259

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

Blacklisting only prevents loading of modules during boot time, but they can still be loaded at a later point. For me it sounds like optimus-manager is loading the wrong module.

Maybe go back a step and disable the manager. Instead load the nvidia driver yourself and confirm whether it works or not.
If it does you probably should file a bug report for optimus-manager and I think a udev rule might work instead for the time being.

Unfortunately Nvidia is still Nvidia and it looks like they do not support PRIME offloading for this use-case.

Offline

#5 2019-09-14 09:44:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,534

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

To clear a few things up because there seems to be a load of confusion about how this works:

  • optimus-manager starts out in intel mode: Which means  start xorg on intel and use nouveau for power management/disablement of the discrete card, you can configure that in /etc/optimus-manager/optimus-manager.conf to use bbswitch or nothing instead.

  • When switching via optimus-manager --switch nvidia (which is something I've not yet seen used in this entire thread.)  it will juggle xorg configs around and load nvidia PRIME offload on the next login/the next boot.

  • Either way, the only files you will see actively change (because they are the ones that matter and cannot entirely be controlled dynamically) are xorg.configs which switch between intel only/and intel and nvidia offloading modes (all blacklists can and do remain, because they prevent automatic loading so optimus-manager can do it's thing.

The speciality regarding the external monitor seems to be a bug, or firmware quirk of this particular laptop model, and would hopefully be more properly resolved with firmware updates of said laptop model.

Offline

#6 2019-09-14 14:13:31

Swiggles
Member
Registered: 2014-08-02
Posts: 259

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

V1del wrote:
  • When switching via optimus-manager --switch nvidia (which is something I've not yet seen used in this entire thread.)  it will juggle xorg configs around and load nvidia PRIME offload on the next login/the next boot.

Wouldn't this mean it doesn't work at all? Because I would assume this to be fact right now https://devtalk.nvidia.com/default/topi … 1/#5375031
On the other hand it seems to work under some circumstances and the explanation for this behavior might solve OPs problem. Sorry, I think I stepped into something I do not fully understand myself.

Offline

#7 2019-09-16 08:25:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,534

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

Everything we are doing here goes off of the assumption that you want to render the entire session on nvidia (... but offloading to the intel card as that's connected to the display), which has worked since years and the bare minimum to make this work is outlined in https://wiki.archlinux.org/index.php/NV … phics_only optimus-manager doesn't do anything more special than what is mentioned there, it simply moves the xorg configs to switch between one setup type and the other on next xorg startup.

The thing you are pointing out is dynamic render offload in the same xorg session dynamically (exporting a environment variable before running an application you want on the GPU). Which is incidentally something nvidia has implemented in the latest driver. However it currently needs a patched xorg, and doesn't support power management for pre Turing GPUs

Edit: Wait misread your link, that would be running on the intel card and dynamically adding the nvidia driver to control another display, this doesn't work indeed, however offloading the entire rendering to nvidia and then adding the screen should still make this work.

Last edited by V1del (2019-09-16 08:47:30)

Offline

#8 2019-09-16 15:39:44

pcattori
Member
Registered: 2019-09-11
Posts: 10

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

V1del wrote:

The speciality regarding the external monitor seems to be a bug, or firmware quirk of this particular laptop model, and would hopefully be more properly resolved with firmware updates of said laptop model.

I would be perfectly content just using Intel graphics without optimus if it was possible to use HDMI. But the wiki is unclear (https://wiki.archlinux.org/index.php/Le … us_Manager) as to whether this is possible and how to achieve it. (From what I understand the HDMI input is wired directly to the Nvidia GPU, so something must be done to either treat Nvidia GPU as passthrough to Intel GPU or to use Nvidia GPU for monitor).

I'm not sure whether "This has been confirmed to work with the HDMI port." refers to (A) using optimus-manager in general or (B) "When using just the intel driver, disable the NVIDIA card manually:".

But it sounds from what you say that this is not going to work either way until bug fix / firmware update for X1 Extreme Gen 2 is available... Is that correct?

Last edited by pcattori (2019-09-16 15:41:33)

Offline

#9 2019-09-16 16:14:04

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,534

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

I'm not entirely sure, if it works like other Optimus setups it should work if you set up nvidia offloading (via optimus-manager or to not be confused by the magic it does you could also initially opt to follow the exact same manual process as outlined in https://wiki.archlinux.org/index.php/NV … phics_only instead). Just in general if you see nouveau being actively loaded that means that you did not yet invoke a relevant --switch command to optimus-manager. If you don't do this it will actively load nouveau in order to disable the dedicated card (or in this case lead to a freeze because it tries to use nouveau with the other screen which will fail due to the modernity of the card).

Offline

#10 2019-09-16 19:24:05

pcattori
Member
Registered: 2019-09-11
Posts: 10

Re: [SOLVED] HDMI in Optimus + Nouveau loaded even though its blacklisted

Well, I switched to Nvidia just using the `optimus-manager --switch nvidia` command and that worked flawlessly. HDMI output to monitor working as expected.

Weirdly, the first couple times I tried to run `optimus-manager --switch nvidia` it either didn't switch to nvidia (and just stayed on intel) or I got a blackscreen. But now it seems stable.

Offline

Board footer

Powered by FluxBB