SwayWM brings me back to sddm after login

Hello, I downloaded the community edition of sway. I installed it from tty and I want to run it with proprietary nvidia drivers which i downloaded with nvidia-inst. I saw that people do it by adding to the sway.desktop file the following string of commands


bash -c '__GL_GSYNC_ALLOWED=0; __GL_VRR_ALLOWED=0; WLR_DRM_NO_ATOMIC=1; export QT_AUTO_SCREEN_SCALE_FACTOR=1; export QT_QPA_PLATFORM=wayland; export QT_WAYLAND_DISABLE_WINDOWDECORATION=1; export GDK_BACKEND=wayland; export XDG_CURRENT_DESKTOP=sway; export GBM_BACKEND=nvidia-drm; export __GLX_VENDOR_LIBRARY_NAME=nvidia; export MOZ_ENABLE_WAYLAND=1; export WLR_NO_HARDWARE_CURSORS=1; sway --unsupported-gpu'

But sadly it doesn’t work for me. After logging in sddm it shows me a black screen for a sec or two and kicks me back in sddm. My specs - ryzen 5 5600x, gtx 1650 super, 16gb ram 3200.
I will gladly provide any logs that are needed. Thanks in advance!

In addition to using the --unsupported-gpu flag, it may also be necessary to add the nvidia_drm.modeset=1 and nvidia_drm.fbdev=1 kernel parameters to enable early module loading.

If you are using Grub, add the parameters to the GRUB_CMDLINE_LINUX_DEFAULT= line in /etc/default/grub and then regenerate the Grub config:

sudo grub-mkconfig -o /boot/grub/grub.cfg`.

If you are using systemd-boot, add the parameters to /etc/kernel/cmdline and run the reinstall-kernels script.

sudo reinstall-kernels

Next, add the modules to the initramfs by setting up a dracut config like this: https://wiki.archlinux.org/title/Dracut#Early_kernel_module_loading

Here is a one-liner to set up the config for you if you are interested:

echo 'force_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm "' | sudo tee /etc/dracut.conf.d/nvidia.conf

Then regenerate the initramfs.

sudo dracut-rebuild

Reboot, and test again to see if you can get a session.

Sadly, it didn’t work. It still kicks me back into sddm but thanks for the help regardless!

Try switching to a TTY from the login screen (Ctrl+Alt+F2 or F3). Log in on the TTY and see if you can get a session from there.

sway --unsupported-gpu

It launched! Thank you very much! I guess now I just have to make a on startup script.

Another thing you could try is using a different display manager. It could be the issue is related to SDDM.

Greetd is a nice simple display manager which is known to work well with Sway if you would like to check it out. https://wiki.archlinux.org/title/Greetd

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.