SDDM itself in wayland issues

I’m trying to get SDDM to work itself in wayland on a laptop that I have with the following configuration file:

#/etc/sddm.conf.d/10-wayland.conf

[General]
DisplayServer=wayland
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell

[Wayland]
CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1

You might ask why not leaving it alone and run with the still default x11? Because with my multi monitor setup being one a hidef, x11 simply can’t do it properly. It shows like a mess.

So this used to work well on an older laptop that I have, but not on this one. On this laptop, once linux starts, it goes blank, then crashes to the terminal. However if I run sudo systemctl restart sdd then it loads successfully as expected.

I couldn’t find any logs for this situation. Is there a log of sddm, kwin, or wayland protocol somewhere? Is there any sort of dependency order not loaded when sddm loads in first place?

neofetch in case it helps, thanks for any insight!

OS: KDE neon 6.2 x86_64 
Host: Surface Book 2 124000000000000000000000D:0B:08K:1F:5C:10P:38 
Kernel: 6.10.10-surface-1 
CPU: Intel i7-8650U (8) @ 4.200GHz 
GPU: Intel UHD Graphics 620 
GPU: NVIDIA GeForce GTX 1060 Mobile 
Memory: 2236MiB / 15917MiB 

This is the journalctl -b -u sddm logs:

Nov 07 09:51:28 marcos-surfacebook2 systemd[1]: Started sddm.service - Simple Desktop Display Manager.
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Initializing...
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Starting...
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Logind interface found
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Adding new display...
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Loaded empty theme configuration
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Using VT 1
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Display server started.
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Socket server starting...
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Socket server started.
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Loading theme configuration from "/usr/share/sddm/themes/breeze/theme.conf"
Nov 07 09:51:28 marcos-surfacebook2 sddm[1024]: Greeter starting...
Nov 07 09:51:28 marcos-surfacebook2 sddm-helper[1029]: [PAM] Starting...
Nov 07 09:51:28 marcos-surfacebook2 sddm-helper[1029]: [PAM] Authenticating...
Nov 07 09:51:28 marcos-surfacebook2 sddm-helper[1029]: [PAM] returning.
Nov 07 09:51:28 marcos-surfacebook2 sddm-helper[1029]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=113) by sddm(uid=0)
Nov 07 09:51:29 marcos-surfacebook2 sddm[1024]: Greeter session started successfully
Nov 07 09:51:29 marcos-surfacebook2 sddm-helper[1029]: [PAM] Closing session
Nov 07 09:51:29 marcos-surfacebook2 sddm-helper[1029]: pam_unix(sddm-greeter:session): session closed for user sddm
Nov 07 09:51:29 marcos-surfacebook2 sddm-helper[1029]: [PAM] Ended.
Nov 07 09:51:29 marcos-surfacebook2 sddm[1024]: Auth: sddm-helper exited successfully
Nov 07 09:51:29 marcos-surfacebook2 sddm[1024]: Greeter stopped. SDDM::Auth::HELPER_SUCCESS

It looks like the helper exited immediately after starting “with no errors”. This is weird.

To get to the bottom of it, I recommend enabling debug logging by adding an environment variable override to the sddm.service unit. Edit it by running sudo systemctl edit sddm.service and add these lines to the override file:

[Service]
Environment=QT_LOGGING_RULES="*.debug=true"

Then save, exit the editor and restart SDDM or the PC, then see if there is anything interesting in the SDDM journal.

Unfortunately that didn’t provided anything insightful to me, but I’ll post here in case your eyes spot anything mine can’t:

Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm-helper[1034]: [PAM] Starting...
Nov 08 10:45:33 marcos-surfacebook2 sddm-helper[1034]: [PAM] Authenticating...
Nov 08 10:45:33 marcos-surfacebook2 sddm-helper[1034]: [PAM] returning.
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm-helper[1034]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=113) by sddm(uid=0)
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QDBusConnectionManager(0x7af4e09f1280) scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QDBusConnectionManager(0x7af4e09f1280) scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QDBusConnectionManager(0x7af4e09f1280) scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QDBusConnectionManager(0x7af4e09f1280) scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Greeter session started successfully
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm-helper[1034]: [PAM] Closing session
Nov 08 10:45:33 marcos-surfacebook2 sddm-helper[1034]: pam_unix(sddm-greeter:session): session closed for user sddm
Nov 08 10:45:33 marcos-surfacebook2 sddm-helper[1034]: [PAM] Ended.
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Auth: sddm-helper exited successfully
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Greeter stopped. SDDM::Auth::HELPER_SUCCESS
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Posting deferred delete for SDDM::Auth(0x5ce8185415f0) with loop level 1 and scope level 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Processing deferred delete event for SDDM::Auth(0x5ce8185415f0) with loop level 1 and scope level 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Checking QThread(0x5ce8185368c0, name = "Qt mainThread") with loop level 1 and scope level 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Combined levels of event 2 is higher than thread 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Sending deferred delete to SDDM::Auth(0x5ce8185415f0)
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Deferred deleting SDDM::Auth(0x5ce8185415f0)
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 2
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QDBusConnectionManager(0x7af4e09f1280) scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QDBusConnectionManager(0x7af4e09f1280) scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Increased QDBusConnectionManager(0x7af4e09f1280) scope level to 1
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QDBusConnectionManager(0x7af4e09f1280) scope level to 0
Nov 08 10:45:33 marcos-surfacebook2 sddm[1009]: Decreased QThread(0x5ce8185368c0, name = "Qt mainThread") scope level to 0

I found out that the culprit might be related to nvidia drivers, but I have no log message to support that.

The SDDM loads on wayland mode normally if the nvidia driver is not installed.

If nvidia driver is installed (latest 550.127), it breaks on boot but works upon systemctl restart sddm.

It can also be a combination of things required for this machine and the nvidia driver.

Welcoming any ideas to investigate this.

I could find more information by running sudo journalctl -b -r and with that I could find this kwin log:

kwin_wayland_drm: No suitable DRM devices have been found

That gave a clue and then I added the following to initramfs:

i915
nvidia
nvidia_modeset
nvidia_uvm
nvidia_drm

It seems that when nvidia is installed, there is a race condition between module loading and sddm. Setting it up to load earlier did the trick it seems.

Is this a bug? Shouldn´t it add itself to initramfs automatically if it is required?