KDE Plasma and Gnome Wayland Crashing on Login with NVIDIA

I have just installed a fresh NixOS 22.11 from a graphical installer ISO that I grabbed a few hours ago, and trying to login to KDE Plasma Wayland fails and kicks back out to the display manager.

The only changes to my configuration from fresh is to setup the NVIDIA drivers which appears to be version 520.56.06. This also did not work with a completely fresh install prior to setting up the NVIDIA drivers, but this is the current state my system is in. This is what’s in the configuration.nix:

  services.xserver.videoDrivers = [ "nvidia" ];
  hardware.opengl.enable = true;

Looking into journalctl logs I’ve found the following:

When starting up, immediately get qt.qpa.xcb not able to connect to the display and unable to load QT platform plugin:

Apr 04 21:23:06 HOSTNAME systemd[1496]: Started KDE Window Manager.
Apr 04 21:23:06 HOSTNAME systemd[1496]: Starting KDE Config Module Initialization...
Apr 04 21:23:06 HOSTNAME systemd[1496]: Starting Splash screen shown during boot...
Apr 04 21:23:06 HOSTNAME systemd[1496]: app-klipper@autostart.service: Skipped due to 'exec-condition'.
Apr 04 21:23:06 HOSTNAME systemd[1496]: Condition check resulted in Klipper being skipped.
Apr 04 21:23:06 HOSTNAME kaccess[2511]: Xlib XKB extension major= 1  minor= 0
Apr 04 21:23:06 HOSTNAME kaccess[2511]: qt.qpa.xcb: could not connect to display
Apr 04 21:23:06 HOSTNAME kaccess[2511]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Apr 04 21:23:06 HOSTNAME kaccess[2511]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Apr 04 21:23:06 HOSTNAME kaccess[2511]: Available platform plugins are: wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

It’s suggestion there was to reinstall the application, but this is a fresh install… There are then a large number of crashes with core dumps from lots of different applications. The actual trace is far too large to place here:

pr 04 21:23:06 HOSTNAME systemd-coredump[2525]: [🡕] Process 2511 (.kaccess-wrappe) of user 1000 dumped core.
                                                            
                                                            Module linux-vdso.so.1 with build-id 593b930755e5961be2a7ed2b18b1355e1f38ac2f
                                                            Module libuuid.so.1 with build-id acd735288414f217a6ce62c44b6abce76b772af2
                                                            Module libxcb-util.so.1 without build-id.
                                                            Module libexpat.so.1 without build-id.
                                                            Module libxkbcommon.so.0 without build-id.
                                                            Module libxkbcommon-x11.so.0 without build-id.

There are a few more different errors I’ve picked out while scrolling:

Apr 04 21:23:08 HOSTNAME kwin_wayland_wrapper[2652]: No backend specified, automatically choosing drm
Apr 04 21:23:08 HOSTNAME kwin_wayland_wrapper[2652]: kwin_wayland_drm: No suitable DRM devices have been found
Apr 04 21:23:08 HOSTNAME systemd[1]: Started Process Core Dump (PID 2657/UID 0).
Apr 04 21:23:08 HOSTNAME systemd-coredump[2658]: [🡕] Process 2652 (.kwin_wayland-w) of user 1000 dumped core.
Apr 04 21:23:08 HOSTNAME systemd[1]: systemd-coredump@18-2657-0.service: Deactivated successfully.
Apr 04 21:23:08 HOSTNAME ksplashqml[2521]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 04 21:23:08 HOSTNAME ksplashqml[2521]: The Wayland connection broke. Did the Wayland compositor die?
Apr 04 21:23:08 HOSTNAME kcminit_startup[2527]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 04 21:23:08 HOSTNAME kcminit_startup[2527]: The Wayland connection broke. Did the Wayland compositor die?
Apr 04 21:23:08 HOSTNAME systemd[1496]: plasma-kwin_wayland.service: Consumed 1.544s CPU time.
Apr 04 21:23:11 HOSTNAME polkit-kde-authentication-agent-1[2742]: Invalid MIT-MAGIC-COOKIE-1 keyqt.qpa.xcb: could not connect to display :0
Apr 04 21:23:11 HOSTNAME polkit-kde-authentication-agent-1[2742]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Apr 04 21:23:11 HOSTNAME polkit-kde-authentication-agent-1[2742]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Apr 04 21:23:11 HOSTNAME polkit-kde-authentication-agent-1[2742]: Available platform plugins are: wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Apr 04 21:23:11 HOSTNAME polkit-kde-authentication-agent-1[2742]: KCrash: Application '<unknown>' crashing...

Mostly these just have repeating error messages provided by different KDE services. Any thoughts on what I can do to debug and/or solve this? Thanks in advance.

2 Likes

Ok - my memory was slightly wrong for before I changed the drivers. I just went back to Generation 1 of my system to see.

When I logged into wayland WITHOUT the nvidia drivers it is able to log in, but freezes after a few seconds. Suffice to say, I believe this to be a different issue so I won’t describe that here.

EDIT:

I’ve actually found similar errors in the log without the NVIDIA drivers:

Apr 04 22:29:51 nixos xdg-desktop-portal-kde[1276]: qt.qpa.xcb: could not connect to display
Apr 04 22:29:51 nixos xdg-desktop-portal-kde[1276]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Apr 04 22:29:51 nixos xdg-desktop-portal-kde[1276]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Apr 04 22:29:51 nixos xdg-desktop-portal-kde[1276]: Available platform plugins are: wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Apr 04 22:29:51 nixos systemd[1]: Created slice Slice /system/systemd-coredump.
Apr 04 22:29:51 nixos systemd[1]: Started Process Core Dump (PID 1279/UID 0).
Apr 04 22:29:51 nixos xserver-wrapper[1222]: (II) modeset(G0): Output DP-1-7 has no monitor section
Apr 04 22:29:51 nixos xserver-wrapper[1222]: (II) modeset(G0): Output DP-1-8 has no monitor section
Apr 04 22:29:51 nixos systemd-coredump[1280]: [🡕] Process 1276 (.xdg-desktop-po) of user 175 dumped core.

This is clearly not just a KDE Plasma issue - I just tried gnome on wayland and wasn’t able to login either.

Apr 04 22:54:03 HOSTNAME systemd[7620]: Started GNOME Session Manager (session: gnome).
Apr 04 22:54:03 HOSTNAME systemd[7620]: Reached target GNOME Session Manager is ready.
Apr 04 22:54:03 HOSTNAME systemd[7620]: Starting GNOME Shell on Wayland...
Apr 04 22:54:03 HOSTNAME systemd[7620]: Starting GNOME Shell on X11...
Apr 04 22:54:03 HOSTNAME systemd[7620]: Started Application launched by gnome-session-binary.
Apr 04 22:54:03 HOSTNAME systemd[7620]: org.gnome.Shell@x11.service: Skipped due to 'exec-condition'.
Apr 04 22:54:03 HOSTNAME systemd[7620]: Condition check resulted in GNOME Shell on X11 being skipped.
Apr 04 22:54:03 HOSTNAME .gnome-shell-wr[7693]: Running GNOME Shell (using mutter 43.2) as a Wayland display server
Apr 04 22:54:03 HOSTNAME .gnome-shell-wr[7693]: g_hash_table_destroy: assertion 'hash_table != NULL' failed
Apr 04 22:54:03 HOSTNAME .gnome-shell-wr[7693]: Failed to open gpu '/dev/dri/card0': No suitable mode setting backend found
Apr 04 22:54:03 HOSTNAME .gnome-shell-wr[7693]: g_hash_table_destroy: assertion 'hash_table != NULL' failed
Apr 04 22:54:03 HOSTNAME .gnome-shell-wr[7693]: Failed to open gpu '/dev/dri/card1': No suitable mode setting backend found
Apr 04 22:54:03 HOSTNAME gnome-shell[7693]: Failed to setup: No GPUs found
Apr 04 22:54:03 HOSTNAME systemd[7620]: org.gnome.Shell@wayland.service: Failed with result 'protocol'.
Apr 04 22:54:03 HOSTNAME systemd[7620]: Failed to start GNOME Shell on Wayland.
Apr 04 22:54:03 HOSTNAME systemd[7620]: org.gnome.Shell@wayland.service: Triggering OnFailure= dependencies.
Apr 04 22:54:03 HOSTNAME systemd[7620]: Stopped target GNOME Wayland Session.
Apr 04 22:54:03 HOSTNAME systemd[7620]: Stopped target GNOME Session Manager is ready.
Apr 04 22:54:03 HOSTNAME systemd[7620]: Stopped target GNOME Shell.
Apr 04 22:54:03 HOSTNAME systemd[7620]: Stopping GNOME Session Manager (session: gnome)...

It appears that gnome also is unable to find a backend.

I have the same problem.

Well to note to you, I haven’t solved this and disappeared - still using good old-fashioned X11.

Same goes for me, still not fixed. Maybe it’s not a nixos issue, but a xdg-portal one. Though it’s strange if it the portal breaks even without nvidia

Also have the same issue. I tried unstable as of today with plasma 6 which is supposedly wayland by default.

I tried the nvidia driver version 535 and 555. I read somewhere you need to enable modesetting, but enabling that breaks login from appearing at all.

I have had modesetting on for a very long time on my system and the login managers have been fine.

But I still don’t have anything working. Now running 23.11 and still can’t get it sorted.

I’m wrong actually - it is working now on 545 drivers. I just managed to log into gnome wayland.

I’m having issues with all KDE at the moment - any of the main applications just use up 100% of the CPU and don’t do anything. Uninstalled for now as I don’t particularly use it.

I’m on KDE/Nvidia using nixpkgs unstable, and I have the same issue trying to start a plasma6 Wayland session from SDDM (the initial “qt.qpa.xcb” failure to start, then many coredump of kaccess then other programs) under Nvidia driver 550.54.14. My hardware config looks thus:

  # Load nvidia driver for Xorg and Wayland                                                                                                                                    
  services.xserver.videoDrivers = ["nvidia"];

  hardware.nvidia = {
    modesetting.enable = true;
    powerManagement.enable = false;
    powerManagement.finegrained = false;
    nvidiaSettings = true;
  };

The relevant boot log entries

Mar 13 19:06:54 nixcentre kwin_wayland[5369]: No backend specified, automatically choosing drm
Mar 13 19:06:54 nixcentre kwin_wayland[5369]: kwin_wayland_drm: No suitable DRM devices have been found
Mar 13 19:06:54 nixcentre kaccess[5365]: qt.qpa.xcb: could not connect to display
Mar 13 19:06:54 nixcentre kaccess[5365]: qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Mar 13 19:06:54 nixcentre kaccess[5365]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Mar 13 19:06:54 nixcentre kaccess[5365]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                                         
                                         Available platform plugins are: wayland-egl, wayland, minimal, minimalegl, linuxfb, vkkhrdisplay, eglfs, offscreen, xcb, vnc.
Mar 13 19:06:54 nixcentre systemd[1]: Started Process Core Dump (PID 5389/UID 0).
Mar 13 19:06:54 nixcentre systemd-timesyncd[1368]: Network configuration changed, trying to establish connection.
Mar 13 19:06:54 nixcentre systemd[1]: Started Pass systemd-coredump journal entries to relevant user for potential DrKonqi handling.
Mar 13 19:06:54 nixcentre systemd-timesyncd[1368]: Network configuration changed, trying to establish connection.
Mar 13 19:06:54 nixcentre systemd-timesyncd[1368]: Network configuration changed, trying to establish connection.
Mar 13 19:06:54 nixcentre systemd-timesyncd[1368]: Network configuration changed, trying to establish connection.
Mar 13 19:06:54 nixcentre systemd-timesyncd[1368]: Network configuration changed, trying to establish connection.
Mar 13 19:06:54 nixcentre systemd-timesyncd[1368]: Network configuration changed, trying to establish connection.
Mar 13 19:06:54 nixcentre kwin_wayland[5385]: No backend specified, automatically choosing drm
Mar 13 19:06:54 nixcentre kwin_wayland[5385]: kwin_wayland_drm: No suitable DRM devices have been found
Mar 13 19:06:54 nixcentre systemd-coredump[5393]: [🡕] Process 5365 (.kaccess-wrappe) of user 1001 dumped core.
                                                  
                                                  Module libxcb-util.so.1 without build-id.

I was trying out unstable for a bit and had issues, I wondered if it was related to the 550 drivers but I didn’t have enough time to experiment before I needed a working machine.