https://bugs.kde.org/show_bug.cgi?id=524818
Bug ID: 524818
Summary: [Wayland][multi-GPU][NVIDIA] External dGPU-connected
monitor fails with atomic modeset EINVAL;
xwaylandvideobridge additionally causes DRM master
EBUSY/freeze
Classification: Plasma
Product: kwin
Version First 6.6.5
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: major
Priority: NOR
Component: wayland-generic
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 195510
--> https://bugs.kde.org/attachment.cgi?id=195510&action=edit
Logs
SUMMARY
On a hybrid Intel/NVIDIA laptop, the internal eDP panel is connected to the
Intel iGPU,
while the external USB-C/DisplayPort and HDMI outputs are physically connected
to the
NVIDIA dGPU.
Plasma/KWin Wayland cannot use an external monitor connected to the NVIDIA GPU.
There are two reproducible failure stages:
1. With xwaylandvideobridge running, it becomes DRM master of the NVIDIA DRM
device
(/dev/dri/card2). When an external monitor is hotplugged, KWin repeatedly
fails to
open card2 with EBUSY and the desktop freezes for several seconds.
2. If xwaylandvideobridge is stopped first, the freeze disappears and KWin
detects the
external monitor. However, shortly afterwards KWin fails to activate it with
repeated
GL_INVALID_OPERATION: <image> and <target> are incompatible
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
Atomic modeset test failed! Invalid argument
Applying output configuration failed!
Plasma then reports that the newly detected monitor was removed, even though
the
cable is still physically connected. Physically unplugging the cable
produces another
"monitor removed" notification.
The same hardware, kernel and NVIDIA driver work correctly with GNOME/Mutter
Wayland.
Plasma X11 also works correctly.
STEPS TO REPRODUCE
Hardware topology:
- internal eDP panel -> Intel iGPU
- external USB-C/DisplayPort + HDMI -> NVIDIA RTX 4060 Laptop GPU
Variant A - normal Plasma session:
1. Start Plasma Wayland without an external monitor connected.
2. Let the normal Plasma autostart applications start, including
xwaylandvideobridge.
3. Verify /sys/kernel/debug/dri/2/clients.
4. xwaylandvideobridge is DRM master on the NVIDIA card:
xwaylandvideobr ... dev 2 ... master y ... a y
5. Connect an external monitor to USB-C/DP.
6. Desktop freezes for several seconds.
7. KWin logs repeated:
Failed to open /dev/dri/card2 device (Device or resource busy)
Failed to open drm device /dev/dri/card2
Variant B - stop xwaylandvideobridge first:
1. Start Plasma Wayland without the external monitor.
2. Stop xwaylandvideobridge.
3. Connect the external monitor.
4. There is no longer a multi-second desktop freeze.
5. Plasma reports that a monitor was detected.
6. KWin repeatedly logs framebuffer/EGL and atomic modeset errors.
7. Shortly afterwards Plasma reports that the monitor was removed although the
cable
is still connected.
8. Physically unplugging the cable generates another "monitor removed" event.
OBSERVED RESULT
With xwaylandvideobridge running:
- xwaylandvideobridge owns DRM master on /dev/dri/card2.
- KWin cannot open card2 when the NVIDIA-connected display is hotplugged.
- KWin retries for several seconds and the desktop temporarily freezes.
- External display does not become usable.
With xwaylandvideobridge stopped:
- The freeze disappears.
- KWin recognizes the external display.
- Output activation then fails in the KWin DRM/OpenGL path.
- KWin produces repeated:
kwin_scene_opengl: GL_INVALID_OPERATION: <image> and <target> are
incompatible
kwin_scene_opengl: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
kwin_wayland_drm: Atomic modeset test failed! Invalid argument
kwin_core: Applying output configuration failed!
- The newly detected output is then removed again from the logical output
topology.
EXPECTED RESULT
KWin should retain control of all DRM devices required for the Wayland session,
or be
able to acquire the secondary NVIDIA DRM device when an external connector
becomes
active.
A normal client such as xwaylandvideobridge should not prevent KWin from
managing the
secondary GPU.
After hotplugging an external monitor connected to the NVIDIA dGPU, the display
should
be activated and remain available, as it does under GNOME/Mutter Wayland.
SOFTWARE/OS VERSIONS
Operating system:
TUXEDO OS, Ubuntu 24.04 based
KDE Plasma:
6.6.5
KDE Frameworks:
6.24.0
Qt:
6.10.2
Kernel:
7.0.0-110030-tuxedo x86_64
Session:
Wayland
GPU 1:
Intel integrated graphics
/dev/dri/card1
internal eDP display
GPU 2:
NVIDIA GeForce RTX 4060 Laptop GPU
/dev/dri/card2
external DisplayPort / HDMI outputs
NVIDIA driver:
580.178.04
nvidia_drm modeset:
enabled
CONTROL TESTS
- GNOME/Mutter Wayland:
Works correctly with the same external monitor.
- Plasma X11:
Works correctly.
- Plasma/KWin Wayland:
Fails.
- NVIDIA open kernel module 580.178.04:
affected.
- NVIDIA proprietary kernel module 580.178.04:
affected.
Therefore this is not specific to the NVIDIA open kernel module implementation.
TESTED WORKAROUNDS - NO EFFECT
KWIN_FORCE_SW_CURSOR=1
KWIN_DRM_FORCE_MGPU_GL_FINISH=1
KWIN_DRM_USE_MODIFIERS=0
nvidia_modeset.conceal_vrr_caps=1
Different KWIN_DRM_DEVICES ordering:
- Intel first, NVIDIA second
- NVIDIA first, Intel second
Resetting ~/.config/kwinoutputconfig.json
nvidia-drm.color_pipeline=0 was considered, but the installed NVIDIA 580.178.04
nvidia_drm module does not expose a color_pipeline parameter, so this test was
not
applicable.
ADDITIONAL REPRODUCTION CASE
If the external NVIDIA-connected monitor is already attached before logging
into Plasma
Wayland, the problem is more severe: the session does not successfully complete
login
and can freeze completely.
Earlier logs from this case showed the same KWin output activation error class:
Atomic modeset test failed! Invalid argument
GL_INVALID_OPERATION: <image> and <target> are incompatible
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
Applying output configuration failed!
In contrast, GNOME/Mutter Wayland starts correctly with the same external
monitor
already connected.
RELATED BUGS
Bug 511490 / 511216 appear symptomatically similar because they involve an
external
display, Wayland and atomic modeset failures.
However, this system is already running Plasma 6.6.5, and the workaround
KWIN_DRM_USE_MODIFIERS=0
does not change the behavior.
Therefore this appears to be either a different failure or a regression /
remaining
multi-GPU case.
--
You are receiving this mail because:
You are watching all bug changes.