NixOS kde wayland session is unusable



Hi. Noob here.

I just installed NixOS with kde plasma 6; however, it doesn’t start plasma wayland as deafult but use tty first instead. Worst of all, even if I type startplasma-wayland in tty, it start the session but completely unusable, it starts off laggy and then the mouse cursor leave ghost trails. I have no idea how to fix this. Please help.

I have attached photos

My pc is ryzen 9700x with radeon 7900xt

I think you also need to enable services.displayManager.sddm.enable. The wayland option is in addition to enabling the DM itself.

This might not solve the graphics issues though. I may be outdated, but I thought services.xserver.enable was still required even on wayland?

That option should probably be services.displayManager.sddm.wayland.enable, since ironically SDDM is only usable in a Wayland context.

I tried to use it on X.org a couple of days ago and in that context it’s so borked it’s not even funny. Literally can’t be used to log in - regardless of validity of credentials it just freezes and looks like styling of the text fields used during the cool down timer that’s used for invalid credentials.

1 Like

How can NixOS devs release this distro that is so weirdly broken and nobody knows why or how to fix it?
I have worked on this issue the whole day and stiĺl can’t fix it because I do not know what went wrong.

1 Like

Well, it’s KDE / SDDM itself that’s broken.
Basically I think that Wayland has given the KDE devs googley eyes, and so they’re only focusing on that, damn the fact that there’s even now a substantial amount of people that simply cannot migrate to Wayland (usually because it doesn’t offer the features they need). Bit rot on the X.org code paths does the rest.

Given that, there’s not much Nix or NixOS can do to paper over such issues other than fixing those bugs manually. But KDE is a fearsome beast, and just getting one’s toes wet is a daunting task. In addition, most Nix contributors are volunteers, so they’re not going to go out of their way to fix something that’s broken on a deep level, as is the case here.

1 Like

Thanks, is there anything I can do to at least get the gui up and running?

Is it possible to edit configuration.nix to change the desktop environment to something that is working?

services.displayManager.sddm.wayland.enable is an addition and does not replace services.displayManager.sddm.enable

# Enable OpenGL
   hardware.graphics.enable = true;
   hardware.graphics.enable32Bit = true;

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the Plasma 6 (KDE 6) desktop environment
  services.displayManager.sddm.enable = true;
  services.displayManager.sddm.wayland.enable = true;
  services.desktopManager.plasma6.enable = true;
2 Likes

It most certainly does replace it, or at least it’s able to. I don’t have the non-wayland attribute in my config for example.
In addition, the X.org version is borked anyway (refuses to log in properly), so even if it’s installable it’s not really useful at this point.

@Shiroxia

That’s the attribute you need to set to true.

It’s not, the whole module is disabled without the top level setting: nixpkgs/nixos/modules/services/display-managers/sddm.nix at 1807c2b91223227ad5599d7067a61665c52d1295 · NixOS/nixpkgs · GitHub

@Shiroxia already has the wayland setting set, anyway.

Just set services.displayManager.sddm.enable = true;, that will make the tty be replaced by sddm.

After that we can see if you still have graphics issues, which we might need to play with services.xserver.* for, it looks to still be in charge of drivers.

To be clear, we usually know how to fix things, but where software and hardware meet things get wonky. We cannot test every laptop/PC out there, there’s no money or manpower for that (nor can we test every combination of settings, that’s an effectively infinitely large number).

Other OSes don’t necessarily do any better here, but Microsoft gets this for free because everyone develops for them, while Apple restrict their OS to only their computers (try building a hackintosh if you really want to see a mess), debian/fedora have a much larger userbase (and fewer options) so there simply are more people running into issues before you do, and ubuntu in addition gets this for free from some laptop/PC vendors.

2 Likes

Thank you.
What do i need to do in order to debug the graphics issue?

My thought process in order is:

  1. Set up sddm and log in through sddm.
    • It’s possible that your current issues are because the environment isn’t set up correctly, though this is frankly not likely to fix anything IMO.
  2. Check if you even have graphics acceleration configured
    • hardware.graphics.enable = true;, basically
  3. Make sure your iGPU is turned off in BIOS and that you have your display cable coming out of the discrete GPU and not the motherboard
    • The iGPU shouldn’t have artifacting either, but it’s best to get this out of the way early
  4. Turn on services.xserver.enable, since it seems to be in charge of setting the driver list
    • If that fixes it, we just need to figure out what driver to add to services.xserver.videoDrivers
  5. Get you to switch over to whatever GPU you weren’t testing to ensure it’s not a hardware issue
  6. Get output of dmesg and journalctl -x --boot to see what’s going on; not always helpful when the issue is graphics
3 Likes

Yay, that does the trick!
Everything is running smoothly with no issue and the OS is super duper fast with my overpowered hardware.
Thank you.
An interesting adventure awaits me here.

To wrap it up for future nixos users:

  1. “services.xserver.enable = true;” the configuration page is wrong, it must be set to true in order to boot into the graphical interface straight away.

  2. Hardware graphics must be enabled to let GUI function.
    Enable hardware graphics configuration
    hardware.graphics.enable = true;

  3. services.displayManager.sddm.enable = true; must be kept even if you only use Wayland session.

    Enable the KDE Plasma Desktop Environment.
    services.displayManager.sddm.enable = true;
    services.displayManager.sddm.wayland.enable = true;
    services.desktopManager.plasma6.enable = true;
    services.displayManager.defaultSession = “plasma”;

Thank you @TLATER for fixing the issue. I am so happy to start my journey here.

BTW, I am using radeon rx 7900XT and requires AMD adrenalin in order to fully unleash it’s potential, what do I need to do in order to download it and use it on nixos?

3 Likes

Fair enough. Unless you asked chatgpt to generate that for you, we should fix that upstream.

As an aside, if you want to play video games, you should also set:

hardware.graphics.enable32Bit = true;

Most games still run on X11, so you will need an X server anyway, even if your compositor is running wayland and using Xwayland to give your games something to render on.

Not available on Linux, the drivers are fully built-into the kernel and AMD doesn’t offer any fancy userland GUI to my knowledge. A lot of stuff is still available through environment variables, but you’ll need to dig into forum posts around AMD GPUs to figure out how to use it.

Game mode and gamescope are things to look into, they expose some of the features and have some other “performance tweaks” if your fingers are itching to do that kind of thing.

You’ll need to get any bonus features (e.g. “game stats”) from third-party applications.

1 Like