Bug 475167

Summary: External monitor not detected on Advanced Optimus
Product: [Plasma] kwin Reporter: Evert Vorster <evorster>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nicolas.fella
Priority: NOR    
Version: 5.27.8   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Evert Vorster 2023-10-03 10:29:10 UTC
SUMMARY
***
When plugging in a monitor into the HDMI port on the laptop, the monitor is not detected in Display Settings panel.

The laptop that has the issue is a Sager NP8775E, (Identical to Tuxedo Gemini Gen 2, and Clevo DP70SNE-G) but I believe you will be able to reproduce this issue on any laptop that has nVidia's Advanced Optimus controlling the handoff between the integrated and dedicated GPU's where the dGPU is hard-wired to the HDMI port.

The laptop has no xorg.conf, and relies completely on auto detection for the xserver setup. 
On X11, this works well, and the issue mentioned below is not present. On Wayland, it also works really well, apart from the issue below.
***


STEPS TO REPRODUCE
1. Run a Wayland KDE session on a notebook that has nVidia's Advanced Optimus, and where the dGPU is hard-wired to the HDMI port.
2. Plug a monitor into the HDMI port on the laptop

OBSERVED RESULT
Monitor is not detected. As far as I can tell, there is no event. The dedicated GPU does not wake up, and there is no output to the monitor.

EXPECTED RESULT
The monitor to be detected, configured and presented in the Display Settings panel.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × 13th Gen Intel® Core™ i9-13900HX
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: Sager
Product Name: PD5x_7xSNC_SND_SNE
System Version: Not Applicable

ADDITIONAL INFORMATION
Ah it took me embarrasingly long to get here. 
First I thought it was an issue with the nVidia drivers, then with Wayland itself. Through all this I did manage to get a lot of information that could help. 

First, a quick description. nVidia's Advanced Optimus is a newer way of managing the two video cards in some laptops. The laptop panel is driven through a MUX that the drivers control, and it decides whether to take input from the integrated or dedicated CPU. This part works flawlessly under Windows, X11 and Wayland.

The HDMI port on these laptops is hardwired to the dedicated high power GPU. Under X11, when I plug a monitor into the HDMI port, it is detected, configured and presented to me in the display settings panel. In Windows, it also just works. 

When the external monitor is plugged into a usb-c laptop dock, it also works on Wayland.

Interestingly enough, I can switch the laptop to dedicated GPU only mode in the BIOS, and then I am able to get output to the monitor connected to the HDMI port, but it is not detected as a separate monitor, and so is just a duplicate of the laptop panel. 

I am fully aware that this hardware is rare and quite expensive, and that not many people have access to it. 
I am willing to run tests and provide logs to you if you feel like tackling this issue. I can also compile and run development packages from git if you think you have a fix we can try.

I use Wayland as my daily driver, and it was more than a month before I even thought of trying this on X11, which is a testament to how well this compositor works on Wayland.
Comment 1 Evert Vorster 2023-10-03 10:32:02 UTC

*** This bug has been marked as a duplicate of bug 457168 ***