https://bugs.kde.org/show_bug.cgi?id=528600

            Bug ID: 528600
           Summary: KWin started before any DRM device exists cannot
                    become DRM master on a GPU that appears later
                    (EACCES), leaving a black screen
    Classification: Plasma
           Product: kwin
      Version First 6.8.2
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: platform-drm
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 198290
  --> https://bugs.kde.org/attachment.cgi?id=198290&action=edit
Excerpt from journalctl

DESCRIPTION
KWin started before any DRM device exists cannot become DRM master on a GPU
that appears later (EACCES), leaving a black screen (or more specifically, no
signal to the monitor).

Importantly, this seems to be a regression from 6.7.5.

STEPS TO REPRODUCE
1. Use a system where the only GPU's DRM device registers late. Here: NVIDIA
GTX 960 (Maxwell), proprietary driver 580.178.04, nvidia_drm.modeset=1
(default), loaded from the root fs (not initramfs). simpledrm is evicted when
nvidia-drm starts probing at ~8 s, and nvidia-drm only registers card1 at ~29
s. During those ~21 s there is no /dev/dri/card* at all. (The delay comes from
the NVIDIA driver waiting 2 x 10 s for DisplayPort MST detection on a
daisy-chain of two monitors. It is the same with 580.196.07.)
2. Boot to SDDM with the Wayland greeter (DisplayServer=wayland,
CompositorCommand=kwin_wayland ...). sddm starts at ~13 s, inside that window.

OBSERVED RESULT
- sddm logs "No graphical seats found, attempt to start one on the main console
anyway..." and starts the greeter's kwin_wayland on tty1.
- kwin_wayland finds no DRM device ("kwin_wayland_drm: Failed to open drm
device /dev/dri/card0: No such file or directory"), but keeps running. The
greeter shows "There are no outputs - creating placeholder screen".
- When nvidia-drm registers card1 (29.05 s), KWin picks it up but cannot use
it:
  kwin_core: Failed to authenticate the drm magic token. path: "/dev/dri/card1"
error: Permission denied
  kwin_wayland_drm: drmModeListLessees() failed: Permission denied   (579x)
  kwin_core: Applying output configuration failed: EACCESS            (25x)
- No video signal ever appears. At the same time sddm starts new greeter
sessions on seat0 in a tight loop ("Failed to take control of "/dev/tty1"
("sddm"): Operation not permitted", "Session crashed (exit code 5)", 287x),
because tty1 is still held by the first greeter session.

EXPECTED RESULT
Either KWin acquires the late GPU correctly (DRM master through logind) and
lights up the outputs, or it exits when it has no usable DRM device, so the
display manager can start it again once the GPU exists.

REGRESSION
The same setup worked with kwin 6.7.5 / sddm-wayland-plasma 6.7.5. It broke
after upgrading to 6.8.2 on 2026-11-07. Nothing else on the display path
changed: the NVIDIA driver (580.178.04, installed 2026-10-01, versionlocked)
and its 21 s delay are the same, and sddm (0.21.0-13, installed 2026-06-21) was
not upgraded. My guess, which I haven't verified, is that 6.7.5 exited when no
DRM device was present, so sddm retried later and found card1.

WORKAROUND
Delay sddm until nvidia-drm has registered:
/etc/systemd/system/sddm.service.d/wait-nvidia.conf
[Service]
ExecStartPre=/bin/sh -c 'for i in $(seq 60); do [ "$(cat
/sys/module/nvidia_drm/initstate 2>/dev/null)" = live ] && exit 0; sleep 1;
done'

SOFTWARE/OS VERSIONS
Fedora 44, kernel 7.2.8-200.fc44 (same on 7.2.15-200.fc44)
KDE Plasma 6.8.2, KWin 6.8.2-3.fc44, sddm 0.21.0-13.fc44
Qt 6.11.2, Mesa 26.2.6, libdrm 2.4.134, systemd 259.10
NVIDIA 580.178.04 (RPM Fusion akmod-nvidia-580xx), GTX 960, 2x ASUS PA247CV
daisy-chained over DisplayPort MST

ADDITIONAL INFORMATION
SELinux is enforcing; during the window there are also AVC getattr denials for
kwin_wayland on /dev/dri/renderD128 (tcontext device_t, the node was not
relabeled yet). 

I've attached a journal excerpt of the failed boot (journal-excerpt.txt).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to