sddm / sddm

QML based X11 and Wayland display manager
GNU General Public License v2.0
1.88k stars 328 forks source link

SDDM dies immediately after launch on Wayland #1537

Open benpye opened 2 years ago

benpye commented 2 years ago

I decided to try and get SDDM running with Wayland on my machine, however I haven't had much luck. I based my config changes on https://invent.kde.org/plasma/plasma-workspace/-/blob/master/sddm-wayland-session/plasma-wayland.conf - though without the --inputmethod arg.

On boot I do see SDDM launch briefly, and from checking a video it seems to be fully loaded, but it immediately dies.

In journalctl I see the following:

Apr 02 14:12:30 nixtop sddm-greeter[2787]: Message received from daemon: Capabilities
Apr 02 14:12:30 nixtop sddm-greeter[2787]: Message received from daemon: HostName
Apr 02 14:12:34 nixtop sddm-helper[2733]: [PAM] Closing session
Apr 02 14:12:34 nixtop sddm-helper[2733]: [PAM] Ended.
Apr 02 14:12:34 nixtop sddm[2637]: Auth: sddm-helper exited with 1
Apr 02 14:12:34 nixtop sddm[2637]: Greeter stopped. SDDM::Auth::HELPER_AUTH_ERROR

It looks like SDDM::Auth::HELPER_AUTH_ERROR is only returned at two places in sddm-helper but I don't understand the code well enough to work out why.

Are there any additional logs I can gather to try and diagnose this? I built sddm from e67307e4103a8606d57a0c2fd48a378e40fcef06.

benpye commented 2 years ago

This is the matching log from /var/lib/sddm/.local/share/sddm.log

[14:12:29.264] (WW) WaylandHelper: QSocketNotifier: Can only be used with threads started with QThread
[14:12:29.264] (WW) WaylandHelper: QSocketNotifier: Can only be used with threads started with QThread
[14:12:29.264] (WW) WaylandHelper: QSocketNotifier: Can only be used with threads started with QThread
[14:12:29.264] (II) WaylandHelper: Starting Wayland process "kwin_wayland --no-lockscreen" "sddm"
[14:12:29.265] (II) WaylandHelper: started succesfully "kwin_wayland --no-lockscreen"
[14:12:29.568] (WW) WaylandHelper: "No backend specified through command line argument, trying auto resolution\n"
[14:12:29.569] (II) WaylandHelper: Directory "/run/user/175" has changed, checking for "/run/user/175/wayland-0"
[14:12:29.615] (WW) WaylandHelper: "kwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5089:46: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5091:48: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5093:48: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5097:47: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5099:46: this compose sequence is a duplicate of another; skipping line\n"
[14:12:29.615] (WW) WaylandHelper: "kwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5107:48: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5111:46: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5113:46: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5117:45: this compose sequence is a duplicate of another; skipping line\nkwin_xkbcommon: XKB: /nix/store/9wvss92s8hd5pn8n3ksgqfhinlk55hcp-libX11-1.7.2/share/X11/locale/en_US.UTF-8/Compose:5120:46: this compose sequence is a duplicate of another; skipping line\n"
[14:12:29.782] (II) WaylandHelper: "OpenGL vendor string:                   NVIDIA Corporation\nOpenGL renderer string:                 NVIDIA GeForce GTX 1070/PCIe/SSE2\nOpenGL version string:                  3.1.0 NVIDIA 510.60.02\nOpenGL shading language version string: 1.40 NVIDIA via Cg compiler\nDriver:                                 NVIDIA\nDriver version:                         510.60.2\nGPU class:                              Unknown\nOpenGL version:                         3.1\nGLSL version:                           1.40\nLinux kernel version:                   5.15.32\nRequires strict binding:                no\nGLSL shaders:                           yes\nTexture NPOT support:                   yes\nVirtual Machine:                        no\n"
[14:12:30.343] (WW) WaylandHelper: "kwin_wayland_drm: Failed to create gamma blob! Invalid argument\n"
[14:12:30.344] (WW) WaylandHelper: "kwin_wayland_drm: Failed to create gamma blob! Invalid argument\n"

There is nothing further so I think the sddm-helper failure is the culprit here, unfortunately I don't see any other logs for it.

gene-git commented 2 years ago

I see same problem with latest git develop commit e67307e4103a8606d57a

After adding to [General] Section of config: DisplayServer=wayland

Restarting sddm or rebooting : Display shows flashing cursor in top left and otherwise blank I see log showing:

Greeter session started successfully Auth: sddm-helper exited with 2 Greeter stopped. SDDM::Auth::HELPER_SESSION_ERROR

Any guidance on a fix?

gene-git commented 2 years ago

Also tried adding to General: GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell

and changing [Wayland] to not use default compositor: CompositorCommand=kwin_wayland --no-lockscreen

Same symptom - black screen with blinky cursor in top corner. Logs now show:

Auth: sddm-helper exited with 3 Greeter stopped. SDDM::Auth::HELPER_OTHER_ERROR

benpye commented 2 years ago

I tried again today, and also enabled debug logging for kwin_wayland, but it doesn't seem to give any further hints unfortunately. It is loaded for a few seconds before it dies in my case, and the cursor can be moved etc.

I wonder if this may be related to #687

wushangwei commented 2 years ago

I just ran into the similar problem, and I checked for my configs in /etc/sddm.conf.d/. I found that the config file created by KDE, kde_settings, contains [X11] section which makes SDDM always tries to start Xorg and fails. It takes quite a few time before session actually starts, and then kicked back to SDDM after a few seconds.

The solution is easy: Remove [X11] section in any sddm conf file if you're going to stick with Wayland. Now everything works fine.

gene-git commented 2 years ago

Thank you @wushangwei - removing the [X11] section from sddm.conf does indeed make sddm seem to work - so bug is sddm needs to ignore X11 section when in wayland mode.

Nice thank you!

gene-git commented 2 years ago

Just to add - with this wayland sddm - after logging in the screen blanks and shows some console text - then graphics seems to restart again - is there a way to transition smoothly from sddm/login to plasma wayland desktop without showing text console in the middle?

The font sizes for login screen are different than the Xorg sddm - just a comment.

wushangwei commented 2 years ago

I found just adding ServerArguments=-dpi 144 under [X11] section sets dpi even for SDDM under wayland, and does not reproduce the problem.

gene-git commented 2 years ago

did not work when i tested here - went back to to black screen -

gene-git commented 2 years ago

Ok it seems systemctl restart after changing conf causes a crash. Starting a second time doesn't crash. May or may not need any change to config - haven't explored.

However I found an alternative solution to scale problem - in [General] section add the qt scale env variable. [General] GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell,QT_SCALE_FACTOR=1.75

That works nicely for high res screens and doesn't need any mention of X11 ;) I have not yet tested what I thought was QT default setting to true the variable: QT_AUTO_SCREEN_SCALE_FACTOR

That may also work - don't have time to test at moment.

mcloaked commented 2 years ago

Yes this works but if not using a keyboard with the US layout, how can the 'gb' keyboard layout be specified for kwin_wayland? Also on a laptop the touchpad has not tap-to-click by default. Can touchpad tap-to-click be turned on for kwin_wayland? If not then the pull down to change keyboard layout is not accessible unless the touchpad is of the type that can be clicked down to initiate a click - and even if that is completed, and the keyboard changed to 'gb' then the password entry appears not to change to the new layout, and the keyboard remains the 'us' layout.

gene-git commented 2 years ago

another question

the no-lockscreen option seems to prevent the monitor from turning off if noone logs in. Is there a problem not setting this or will this interfere somehow with plasma descktop lockscreen or worse will it lock and require root to unlock?

Anyway - there is a problem that if noone logs in monitor stays on.

benpye commented 2 years ago

I just ran into the similar problem, and I checked for my configs in /etc/sddm.conf.d/. I found that the config file created by KDE, kde_settings, contains [X11] section which makes SDDM always tries to start Xorg and fails. It takes quite a few time before session actually starts, and then kicked back to SDDM after a few seconds.

The solution is easy: Remove [X11] section in any sddm conf file if you're going to stick with Wayland. Now everything works fine.

Unfortunately this doesn't seem to resolve the issue for me - I can change my sddm.conf to the following with no change:

[General]
DefaultSession=plasma.desktop
DisplayServer=wayland
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell
HaltCommand=/run/current-system/systemd/bin/systemctl poweroff
InputMethod=
Numlock=none
RebootCommand=/run/current-system/systemd/bin/systemctl reboot

[Theme]
Current=breeze
FacesDir=/run/current-system/sw/share/sddm/faces
ThemeDir=/run/current-system/sw/share/sddm/themes

[Users]
HideShells=/run/current-system/sw/bin/nologin
HideUsers=nixbld1,nixbld10,nixbld11,nixbld12,nixbld13,nixbld14,nixbld15,nixbld16,nixbld17,nixbld18,nixbld19,nixbld2,nixbld20,nixbld21,nixbld22,nixbld23,nixbld24,nixbld25,nixbld26,nixbld27,nixbld28,nixbld29,nixbld3,nixbld30,nixbld31,nixbld32,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9
MaximumUid=30000

[Wayland]
CompositorCommand=kwin_wayland --no-lockscreen --inputmethod qtvirtualkeyboard
EnableHiDPI=true
SessionDir=/nix/store/7ay9hi283cj78awxn72g1spl405c4yzf-desktops/share/wayland-sessions

I do not have an /etc/sddm.conf.d directory, only an /etc/sddm.conf file.

ttys3 commented 2 years ago

I have no [X11] section in my config.

I got this too:

Auth: sddm-helper exited with 3 Greeter stopped. SDDM::Auth::HELPER_OTHER_ERROR

Aug 24 17:47:54 work sddm[45447]: Initializing...
Aug 24 17:47:54 work sddm[45447]: Starting...
Aug 24 17:47:54 work sddm[45447]: Logind interface found
Aug 24 17:47:54 work sddm[45447]: Adding new display...
Aug 24 17:47:54 work sddm[45447]: Loading theme configuration from ""
Aug 24 17:47:54 work sddm[45447]: Using VT 3
Aug 24 17:47:54 work sddm[45447]: Display server started.
Aug 24 17:47:54 work sddm[45447]: Socket server starting...
Aug 24 17:47:54 work sddm[45447]: Socket server started.
Aug 24 17:47:54 work sddm[45447]: Loading theme configuration from "/usr/share/sddm/themes/maldives/theme.conf"
Aug 24 17:47:54 work sddm[45447]: Greeter starting...
Aug 24 17:47:54 work sddm-helper[45449]: [PAM] Starting...
Aug 24 17:47:54 work sddm-helper[45449]: [PAM] Authenticating...
Aug 24 17:47:54 work sddm-helper[45449]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=950) by root(uid=0)
Aug 24 17:47:54 work sddm-helper[45449]: [PAM] returning.
Aug 24 17:47:54 work sddm[45447]: Greeter session started successfully
Aug 24 17:47:54 work sddm-helper[45449]: [PAM] Closing session
Aug 24 17:47:54 work sddm-helper[45449]: pam_unix(sddm-greeter:session): session closed for user sddm
Aug 24 17:47:54 work sddm-helper[45449]: [PAM] Ended.
Aug 24 17:47:54 work sddm[45447]: Auth: sddm-helper exited with 3
Aug 24 17:47:54 work sddm[45447]: Greeter stopped. SDDM::Auth::HELPER_OTHER_ERROR
Aug 24 17:48:36 work sddm[45447]: Signal received: SIGTERM
Aug 24 17:48:36 work systemd[1]: Stopping Simple Desktop Display Manager...
gene-git commented 2 years ago

sddm is all but dead project - not a single commit for nearly 6 months. I'm now using gdm which works perfectly.

ttys3 commented 2 years ago

@gene-git I have wayland session gone problem with GDM (when re-login from lock state)

now switched to lightdm seems works OK (solution comes from https://ask.fedoraproject.org/t/external-monitor-with-wayland-and-two-gpus-notebok/20387 )

gene-git commented 2 years ago

great - glad its working for you :)

RokeJulianLockhart commented 1 year ago

https://github.com/sddm/sddm/issues/1537#issuecomment-1225502389

@gene-git, untrue, per https://github.com/sddm/sddm/commits/develop.

gene-git commented 1 year ago

okidok good to know @rokejulianlockhart

but to be fair - at the time the comment was made (now nearly 6 months back) it was indeed true :) There were 0 commits between march 17 and september 12th 2022.

Glad project is back on its feet.

zoechi commented 10 months ago

It seems I run into this as well with NixOS 23.11 and 24.05. Before I tried to upgrade it worked for a few weeks (since I started with NixOS)

TR4SPY commented 3 months ago

Are there any solutions to this problem? Came across same issue today on Arch. No X11 in config and all other solutions provided here did not work.

Erpel91 commented 2 months ago

@TR4SPY I had a similar problem today on a freshly installed Arch. I had only set the DisplayServer in the config to wayland the rest is default. The problem was that I had not installed the weston package, which seems to be the default compositor SDDM uses for wayland in the CompositorCommand. Maybe it helps 🤷‍♂️