Bug 514808

Summary: Kwin doesn't detect external screens on Optimus
Product: [Plasma] kwin Reporter: Alberto Salvia Novella <es20490446e>
Component: multi-screenAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: 6.5.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=513593
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: optimus-manager.log
drm-info.diff
drm-info.log
drm-info@optimus-manager.log
kscreen-doctor.diff
kscreen-doctor.log
kscreen-doctor@optimus-manager.log

Description Alberto Salvia Novella 2026-01-18 21:13:27 UTC
Created attachment 188654 [details]
optimus-manager.log

SYSTEM

- Operating System: Zenned 
- KDE Plasma Version: 6.5.5
- KDE Frameworks Version: 6.22.0
- Qt Version: 6.10.1
- Kernel Version: 6.18.5-zen1-1-zen (64-bit)
- Graphics Platform: Wayland
- Processors: 12 × Intel® Core™ i7-10750H CPU @ 2.60GHz
- Memory: 16 GiB of RAM (15.5 GiB usable)
- Graphics Processor 1: Intel® UHD Graphics
- Graphics Processor 2: NVIDIA GeForce GTX 1650


DESCRIPTION

On Optimus graphics, without Optimus Manager, Kwin is unable detect any external monitor.

On both the Plasma session, or using Kwin_wayland as back-end of SDDM.

On both nouveau and nvidia-open drivers.

Same behavior as: https://bugs.kde.org/show_bug.cgi?id=475168

But with modeset enabled. Checked with: `sudo cat /sys/module/nvidia_drm/parameters/modeset`.
Comment 1 Nate Graham 2026-01-18 21:39:36 UTC
> Same behavior as: https://bugs.kde.org/show_bug.cgi?id=475168
Does this mean your issue is the same as the one described there? Does it help to follow the steps at https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting?

If following the steps there does resolve the issue, then, as Xaver said there, it's not a KWin issue but rather an NVIDIA issue that distros need to resolve for their users.

If following the steps there does not resolve the issue, then it's not actually the same thing. In this case, please attach the output of running `kscreen-doctor -o` and `drm_info`. Thanks!
Comment 2 Alberto Salvia Novella 2026-01-18 21:59:10 UTC
As I mentioned on the description DRM is enabled, what is the solution that fixed the bug for Xaver.

Potentially related: SDDM Does not Detect External Monitors Connected Over NVIDIA PRIME:
https://github.com/sddm/sddm/issues/1558

Let me collect the info of those commands...
Comment 3 Alberto Salvia Novella 2026-01-18 22:29:20 UTC
Created attachment 188660 [details]
drm-info.diff
Comment 4 Alberto Salvia Novella 2026-01-18 22:29:48 UTC
Created attachment 188661 [details]
drm-info.log
Comment 5 Alberto Salvia Novella 2026-01-18 22:30:22 UTC
Created attachment 188662 [details]
drm-info@optimus-manager.log
Comment 6 Alberto Salvia Novella 2026-01-18 22:39:36 UTC
Created attachment 188663 [details]
kscreen-doctor.diff
Comment 7 Alberto Salvia Novella 2026-01-18 22:40:28 UTC
Created attachment 188664 [details]
kscreen-doctor.log
Comment 8 Alberto Salvia Novella 2026-01-18 22:40:48 UTC
Created attachment 188665 [details]
kscreen-doctor@optimus-manager.log
Comment 9 Alberto Salvia Novella 2026-01-18 22:42:23 UTC
Running SDDM with kwin_wayland as backend leads to the same logs.

The only difference being than on X11 the login screen appears on the external monitor, and on kwin_wayland on the built-in one.
Comment 10 Nate Graham 2026-01-18 22:43:32 UTC
Thanks!
Comment 11 Alberto Salvia Novella 2026-01-18 22:43:50 UTC
Wait... let me double-check that DRM works without optimus-manager...
Comment 12 Alberto Salvia Novella 2026-01-19 01:14:53 UTC
Okay, looking at the diffs I have provided, I have figured out this was rather a bug in how the drivers are packaged. They need to be explicitly patched to enable DRM.

I have fixed them to properly enable DRM. And not only that, to automatically use the discrete GPU on games on Wayland without the need of any external tools.

Thanks! 👍

https://gitlab.com/es20490446e/express/-/commit/22885b09dc9c7dd5877075df1a17938c3eeeabc6
Comment 13 Nate Graham 2026-01-19 01:49:04 UTC
That's great news! Glad you figured it out.
Comment 14 Nate Graham 2026-01-19 01:52:05 UTC
What do you think about contributing that patch upstream to Arch? Looks like it could be useful for others, too.
Comment 15 Alberto Salvia Novella 2026-01-19 13:05:58 UTC
I have proposed it directly to NVIDIA here:
https://github.com/NVIDIA/open-gpu-kernel-modules/discussions/1005

After a week, with the feedback I receive, I will talk with the Arch guys.