Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

435.21 driver doesn't work with external monitor on Optimus laptop #85

Open
pjuhasz opened this issue Sep 16, 2019 · 5 comments

Comments

@pjuhasz
Copy link

@pjuhasz pjuhasz commented Sep 16, 2019

I use Fedora 30 (kernel 5.2.14-200.fc30.x86_64) on a Thinkpad P50, which has an integrated Intel GPU and a separate Nvidia Quadro GPU. I use an external monitor connected to the HDMI output in addition to the laptop's own display. Until yesterday (with the 430.something driver version) the setup worked well: the laptop display was managed by the integrated GPU while the external monitor was driven by the Nvidia. nvidia-settings detected the laptop display as "PRIME display".

The update to driver version 435.21 broke this. The external monitor did not come out from power save, xrandr didn't even detect it, and nvidia-settings wasn't able to start properly.

I was able to find a workaround here: https://rpmfusion.org/Howto/Optimus - where it says to add Option "PrimaryGPU" "yes" to the nvidia.conf file located in /etc/X11/xorg.conf.d.
With this, the external monitor works again.

I think the reason of the breakage is hinted at in this driver version's official documentation: http://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html

"As of this writing, these commits are only in the master branch of the X.Org X server, and not yet in any official X.Org X server release."

@scaronni

This comment has been minimized.

Copy link
Member

@scaronni scaronni commented Sep 18, 2019

Can you try to to comment the following line:

# cat /usr/lib/modprobe.d/nvidia.conf | grep NV
options nvidia NVreg_DynamicPowerManagement=0x02

Then running depmod -a and rebooting? This makes sure the Nvidia card does not power off completely, it can just reach the lowest power state.

If this solves it, I will make a note about the mux vs muxless laptops

@pjuhasz

This comment has been minimized.

Copy link
Author

@pjuhasz pjuhasz commented Sep 18, 2019

Commenting out that line had no effect.

I undid my previous PrimaryGPU modification and rebooted to restore the known bad state, then followed your steps. The external monitor remained off, xrandr didn't detect any of the external outputs, so, no effect.

@scaronni

This comment has been minimized.

Copy link
Member

@scaronni scaronni commented Sep 19, 2019

"As of this writing, these commits are only in the master branch of the X.Org X server, and not yet in any official X.Org X server release."

These have been pushed to the current X.org server package in Fedora 30+. Did you update recently?

$ rpm -q --changelog xorg-x11-server-Xorg | head -2
* Thu Aug 29 2019 Olivier Fourdan <ofourdan@redhat.com> 1.20.5-7
- Pick latest fixes from xserver stable branch upstream (rhbz#1729925)

If you set "PrimaryGPU", then the card is, well the primary one. Kind of defeats the point of the whole PRIME Offload thing. Can you try the snippet at the end of this page http://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/primerenderoffload.html to force the GPU screens to be created?

If automatic configuration does not work, it may be necessary to explicitly configure the iGPU and dGPU devices in xorg.conf:

    Section "ServerLayout"
      Identifier "layout"
      Screen 0 "iGPU"
      Option "AllowNVIDIAGPUScreens"
    EndSection

    Section "Device"
      Identifier "iGPU"
      Driver "modesetting"
    EndSection

    Section "Screen"
      Identifier "iGPU"
      Device "iGPU"
    EndSection

    Section "Device"
      Identifier "dGPU"
      Driver "nvidia"
    EndSection
@TauAkiou

This comment has been minimized.

Copy link

@TauAkiou TauAkiou commented Oct 11, 2019

(Hopefully final edit, as I organize and state my findings here.)

I have this same issue, and I theorize that it's because our video outputs are wired to the NVIDIA card, which is theoretically not being used in this configuration unless activated.

Like Optimus under Windows, all of the standard rendering is being handled by the igfx and the NVIDIA card serves as an offload sink, only used on demand.

The feature that would make this work as expected is Reverse PRIME (ARCH Wiki on Reverse PRIME) and it does not appear to be supported under NVIDIA's offloading implementation. This can be verified by xrandr:

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1de cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 3 associated providers: 0 name:modesetting
Provider 1: id: 0x1b8 cap: 0x0 crtcs: **0 outputs**: 0 associated providers: 0 name:NVIDIA-G0

The outputs you are seeing are actually the outputs being exposed through your Thunderbolt 3 port, which is linked to the Intel card.

Naturally, these outputs will work when the GPU is set to Primary as the NVIDIA GPU is directly handling rendering and exposing those ports normally.

This means that the options you currently have to get your external displays working are:

  1. Set Option "PrimaryGPU" "Yes"in your xorg configuration like you've been doing, which reverts to the original functionality and makes the ports work properly.

  2. Buy a thunderbolt (likely USB-C) to HDMI/DP cable and use that.

@scaronni

This comment has been minimized.

Copy link
Member

@scaronni scaronni commented Oct 30, 2019

Set Option "PrimaryGPU" "Yes"in your xorg configuration like you've been doing, which reverts to the original functionality and makes the ports work properly.

Yeah, in this case the whole power off thing will not work. I guess there is no other chance than select one or the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.