[X11][NVIDIA Optimus] Multiple monitors don't correctly activate when NVIDIA modesetting is enabled
I have a hybrid laptop with an Intel iGPU (Intel® Core™ i9-10980HK) and an NVIDIA dGPU (RTX 2070 Super). My integrated laptop screen is connected to the Intel iGPU and my external monitor (port) is hooked up to the NVIDIA dGPU directly.
As soon as I enable modesetting on the NVIDIA 495 driver through boot option nvidia-drm.modeset=1
for mutter 41.1 on Arch, the following happens:
- GDM starts on my integrated laptop screen (Intel iGPU), probably using Wayland. The second screen doesn't activate at all at this point.
- I start gnome-shell on X11.
- The external monitor (NVIDIA dGPU) suddenly comes up and GNOME shell starts on it as main monitor.
- The laptop screen remains on, but black, i.e. mutter seems to ignore it (it's also not listed in the GNOME monitor configuration), even though it was working a moment before.
- Inspecting the NVIDIA X11 Server Settings utility, it is clearly in a mode where it thinks it is the only GPU in the system.
This may be an NVIDIA driver bug, but supposedly this "worked" at some point since the Arch wiki mentions this is necessary to get PRIME synchronization to work. My configurations for GDM udev Wayland rules and WaylandEnable
are all set to their defaults, but modesetting is not enabled by default for the NVIDIA driver - without modesetting, multiple monitors in this setup are handled correctly, but PRIME synchronization won't work.
I decided to report this separately from #1891 and #1572 since I vaguely recall NVIDIA mentioning they don't support Optimus on Wayland yet, but they do on X11.