Cannot start Sway with nonfree Nvidia drivers

Yes, I know it’s not officially supported, but I’ve heard the latest drivers fix a lot of issues, so I thought I’d see I’d give Sway another go. I was ready for some artifacts and crashes, but I didn’t expect that it would actually refuse to launch…

Anyway, here’s my setup:

  • Nvidia RTX 2060
  • No other GPU AFAICT.
  • Manjaro Sway edition, relatively unmolested (I’ve installed a few packages, and I’ve swapped the drivers around a couple of times).
  • All the packages are up to date with stable.

What I’ve done:

  • Install Manjaro Sway from LiveUSB. My first warning sign should have been that it failed to start GUI with nonfree drivers… Anyway, I’ve installed it with free drivers.
  • Switch to non-free drivers (video-nvidia) using mhwd, reboot.
  • Notice that with non-free drivers the resolution seems to be lower (as in, the font is larger, since I can’t see anything but text at this point)
  • Try and fail to start Sway (unsupported GPU) session from the login manager.
  • Try and fail to start sway --unsupported-gpu --debug --verbose from the command line:
00:00:00.000 [INFO] [sway/main.c:338] Sway version 1.8.1
00:00:00.000 [INFO] [sway/main.c:339] wlroots version 0.16.2
00:00:00.010 [INFO] [sway/main.c:120] Linux Crowley 6.1.68-1-MANJARO #1 SMP PREEMPT_DYNAMIC Thu Dec 14 00:46:56 UTC 2023 x86_64 GNU/Linux
00:00:00.011 [INFO] [sway/main.c:136] Contents of /etc/lsb-release:
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_ID="ManjaroLinux"
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_RELEASE="22.1.2"
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_CODENAME="Talos"
00:00:00.011 [INFO] [sway/main.c:120] DISTRIB_DESCRIPTION="Manjaro Linux"
00:00:00.011 [INFO] [sway/main.c:136] Contents of /etc/os-release:
00:00:00.011 [INFO] [sway/main.c:120] NAME="Manjaro Linux"
00:00:00.011 [INFO] [sway/main.c:120] PRETTY_NAME="Manjaro Linux"
00:00:00.011 [INFO] [sway/main.c:120] ID=manjaro
00:00:00.011 [INFO] [sway/main.c:120] ID_LIKE=arch
00:00:00.011 [INFO] [sway/main.c:120] BUILD_ID=rolling
00:00:00.011 [INFO] [sway/main.c:120] ANSI_COLOR="32;1;24;144;200"
00:00:00.011 [INFO] [sway/main.c:120] HOME_URL="https://manjaro.org/"
00:00:00.011 [INFO] [sway/main.c:120] DOCUMENTATION_URL="https://wiki.manjaro.org/"
00:00:00.011 [INFO] [sway/main.c:120] SUPPORT_URL="https://forum.manjaro.org/"
00:00:00.011 [INFO] [sway/main.c:120] BUG_REPORT_URL="https://docs.manjaro.org/reporting-bugs/"
00:00:00.011 [INFO] [sway/main.c:120] PRIVACY_POLICY_URL="https://manjaro.org/privacy-policy/"
00:00:00.011 [INFO] [sway/main.c:120] LOGO=manjarolinux
00:00:00.011 [INFO] [sway/main.c:108] LD_LIBRARY_PATH=
00:00:00.011 [INFO] [sway/main.c:108] LD_PRELOAD=
00:00:00.011 [INFO] [sway/main.c:108] PATH=/home/nigredo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
00:00:00.011 [INFO] [sway/main.c:108] SWAYSOCK=
00:00:00.011 [ERROR] [sway/main.c:62] !!! Proprietary Nvidia drivers are in use !!!
00:00:00.011 [INFO] [sway/main.c:376] Starting sway version 1.8.1
00:00:00.011 [DEBUG] [sway/server.c:67] Initializing Wayland server
00:00:00.030 [INFO] [wlr] [libseat] [libseat/libseat.c:62] Seat opened with backend 'logind'
00:00:00.031 [INFO] [wlr] [backend/session/session.c:109] Successfully loaded libseat session
00:00:00.032 [DEBUG] [wlr] [backend/session/session.c:384] Ignoring '/dev/dri/card0': not a KMS device
00:00:00.033 [ERROR] [wlr] [backend/backend.c:217] Found 0 GPUs, cannot create backend
00:00:00.033 [ERROR] [wlr] [backend/backend.c:390] Failed to open any DRM device
00:00:00.035 [ERROR] [sway/server.c:73] Unable to create backend
  • Try and fail to start it with WLR_DRM_DEVICES=/dev/dri/card0. The only difference is:
[ERROR] [wlr] [backend/session/session.c:410] Unable to open /dev/dri/card0 as DRM device

Some other things I’ve tried:

  • Remove the free drivers (in case there is a conflict), reboot, try to launch Sway. No change.
  • Change drivers using Manjaro Settings instead of mhwd (although that should be the same thing), reboot, try to launch Sway. No change.
  • Try and tweak mkinitcpio.conf following suggestions from the Arch wiki. Rebuild the image, reboot. No change. I changed it back, and rebuilt the image again.

Just in case, I’m attaching a part of my journalctl output that seemed relevant:

Dec 17 16:08:10 Crowley kernel: nvidia: loading out-of-tree module taints kernel.
Dec 17 16:08:10 Crowley kernel: nvidia: module license 'NVIDIA' taints kernel.
Dec 17 16:08:10 Crowley kernel: Disabling lock debugging due to kernel taint
Dec 17 16:08:10 Crowley kernel: nvidia: module verification failed: signature and/or required key missing - tainting kernel
Dec 17 16:08:11 Crowley kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 237
Dec 17 16:08:11 Crowley kernel: 
Dec 17 16:08:11 Crowley kernel: nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
Dec 17 16:08:11 Crowley kernel: nvidia-gpu 0000:01:00.3: i2c timeout error e0000000
Dec 17 16:08:11 Crowley kernel: ucsi_ccg 0-0008: i2c_transfer failed -110
Dec 17 16:08:11 Crowley kernel: ucsi_ccg 0-0008: ucsi_ccg_init failed - -110
Dec 17 16:08:11 Crowley kernel: ucsi_ccg: probe of 0-0008 failed with error -110
Dec 17 16:08:11 Crowley kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module  545.29.06  Thu Nov 16 01:59:08 UTC 2023
Dec 17 16:08:11 Crowley systemd-modules-load[266]: Inserted module 'nvidia'
Dec 17 16:08:11 Crowley kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  545.29.06  Thu Nov 16 01:47:29 UTC 2023
Dec 17 16:08:11 Crowley systemd-modules-load[266]: Inserted module 'nvidia_drm'
Dec 17 16:08:11 Crowley kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
Dec 17 16:08:11 Crowley kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
Dec 17 16:08:12 Crowley kernel: nvidia_uvm: module uses symbols nvUvmInterfaceDisableAccessCntr from proprietary module nvidia, inheriting taint.
Dec 17 16:08:12 Crowley systemd-modules-load[266]: Inserted module 'nvidia_uvm'
Dec 17 16:08:12 Crowley kernel: nvidia-uvm: Loaded the UVM driver, major device number 235.

I’m not really familiar with this level of configuration and with Manjaro/Arch in general, so I’d appreciate any suggestions to be as concrete as possible (e.g. “run this command to rebuild the kernel” over just “rebuild the kernel”). Also, I apologize in advance in case this turns out to be something trivial and/or covered by existing sources. :slight_smile:

Hi @nigredo, and welcome!

AFAIK Sway uses Wayland. And Wayland and Nvidia doesn’t (yet) play nicely together. (This might’ve changed, but this was last time I heard.)

I don’t know anything more than that, though.

Asking here is likely not going to yield anything useful.

From sway wiki

Nvidia users

All proprietary graphics drivers are not officially supported, including the Nvidia proprietary driver. The open source Nouveau driver can be used instead. Do not ask questions regarding the Nvidia proprietary driver here. If you have a choice of hardware, keep open source support in mind!

Home · swaywm/sway Wiki · GitHub

Extensive info on sway can be found Sway - ArchWiki

In the Troubleshooting section is mentioned that you may be able to use Nvidia.

So I got a bit further by adding nvidia_drm.modeset=1 nvidia_drm.fbdev=1 parameters on startup - now Sway seems to start, but doesn’t display anything, and there are a lot of error messages related to EGL. I’ve tried sway-nvidia, and I’ve tried playing with WLR variables myself, but still couldn’t get it to work.

For now, I’m backing off, and switching to the free driver. This time would be better spent actually configuring Sway. This thread can be closed.

Just for this to be mentioned here: I upgraded my thinkpad p52s. With all updates and kernel 61 - works like a charm with proprietary drivers. This issue (or its absence) may well be something very hardware-specific.

1 Like

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