Currently on ArchLinux fresh install, with sway version 1.2, Intel Graphics 600 (mesa installed) and starting sway from tty1 with sway.
When I first install sway, it starts flawlessly, but after each reboot, it's doesn't start anymore, giving this output for sway -d:
2019-10-14 10:30:22 - [sway/main.c:152] Linux ArchLinux 5.3.5-arch1-1-ARCH #1 SMP PREEMPT Mon Oct 7 19:03:08 UTC 2019 x86_64 GNU/Linux
2019-10-14 10:30:22 - [sway/main.c:168] Contents of /etc/os-release:
2019-10-14 10:30:22 - [sway/main.c:152] NAME="Arch Linux"
2019-10-14 10:30:22 - [sway/main.c:152] PRETTY_NAME="Arch Linux"
2019-10-14 10:30:22 - [sway/main.c:152] ID=arch
2019-10-14 10:30:22 - [sway/main.c:152] BUILD_ID=rolling
2019-10-14 10:30:22 - [sway/main.c:152] ANSI_COLOR="0;36"
2019-10-14 10:30:22 - [sway/main.c:152] HOME_URL="https://www.archlinux.org/"
2019-10-14 10:30:22 - [sway/main.c:152] DOCUMENTATION_URL="https://wiki.archlinux.org/"
2019-10-14 10:30:22 - [sway/main.c:152] SUPPORT_URL="https://bbs.archlinux.org/"
2019-10-14 10:30:22 - [sway/main.c:152] BUG_REPORT_URL="https://bugs.archlinux.org/"
2019-10-14 10:30:22 - [sway/main.c:152] LOGO=archlinux
2019-10-14 10:30:22 - [sway/main.c:140] LD_LIBRARY_PATH=(null)
2019-10-14 10:30:22 - [sway/main.c:140] LD_PRELOAD=(null)
2019-10-14 10:30:22 - [sway/main.c:140] PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
2019-10-14 10:30:22 - [sway/main.c:140] SWAYSOCK=(null)
2019-10-14 10:30:22 - [sway/server.c:39] Preparing Wayland server initialization
2019-10-14 10:30:22 - [backend/session/logind.c:675] Successfully loaded logind session
2019-10-14 10:30:22 - [backend/session/logind.c:73] Failed to take device '/dev/dri/card0': Operation not permitted
2019-10-14 10:30:22 - [backend/backend.c:192] Found 0 GPUs
2019-10-14 10:30:22 - [backend/backend.c:339] Failed to open any DRM device
2019-10-14 10:30:22 - [backend/noop/backend.c:51] Creating noop backend
2019-10-14 10:30:22 - [sway/server.c:46] Unable to create backend
And then, if I uninstall sway and install it again, it starts with no problems.
[backend/session/logind.c:73] Failed to take device '/dev/dri/card0': Operation not permitted
Perhaps your user isn't in the video group? No idea why a reinstall would fix this issue temporarily
Same here with Ryzen 3400g as graphics card.
output of sway -d looks the same as yours
2019-10-25 10:41:17 - [sway/main.c:152] Linux ladybug 5.3.7-arch1-1-ARCH #1 SMP PREEMPT Fri Oct 18 00:17:03 UTC 2019 x86_64 GNU/Linux
2019-10-25 10:41:17 - [sway/main.c:168] Contents of /etc/os-release:
2019-10-25 10:41:17 - [sway/main.c:152] NAME="Arch Linux"
2019-10-25 10:41:17 - [sway/main.c:152] PRETTY_NAME="Arch Linux"
2019-10-25 10:41:17 - [sway/main.c:152] ID=arch
2019-10-25 10:41:17 - [sway/main.c:152] BUILD_ID=rolling
2019-10-25 10:41:17 - [sway/main.c:152] ANSI_COLOR="0;36"
2019-10-25 10:41:17 - [sway/main.c:152] HOME_URL="https://www.archlinux.org/"
2019-10-25 10:41:17 - [sway/main.c:152] DOCUMENTATION_URL="https://wiki.archlinux.org/"
2019-10-25 10:41:17 - [sway/main.c:152] SUPPORT_URL="https://bbs.archlinux.org/"
2019-10-25 10:41:17 - [sway/main.c:152] BUG_REPORT_URL="https://bugs.archlinux.org/"
2019-10-25 10:41:17 - [sway/main.c:152] LOGO=archlinux
2019-10-25 10:41:17 - [sway/main.c:140] LD_LIBRARY_PATH=(null)
2019-10-25 10:41:17 - [sway/main.c:140] LD_PRELOAD=(null)
2019-10-25 10:41:17 - [sway/main.c:140] PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
2019-10-25 10:41:17 - [sway/main.c:140] SWAYSOCK=(null)
2019-10-25 10:41:17 - [sway/server.c:39] Preparing Wayland server initialization
2019-10-25 10:41:17 - [backend/session/logind.c:675] Successfully loaded logind session
2019-10-25 10:41:17 - [backend/session/logind.c:73] Failed to take device '/dev/dri/card0': Operation not permitted
2019-10-25 10:41:17 - [backend/session/session.c:271] Unable to open /dev/dri/card0 as DRM device
2019-10-25 10:41:17 - [backend/backend.c:192] Found 0 GPUs
2019-10-25 10:41:17 - [backend/backend.c:339] Failed to open any DRM device
2019-10-25 10:41:17 - [backend/noop/backend.c:51] Creating noop backend
2019-10-25 10:41:17 - [sway/server.c:46] Unable to create backend
A similar error occurred in #3975, but the solution there (export WLR_DRM_DEVICES=/dev/dri/card0) doesn't solve the issue for me.
I don't see why being in the video group should matter if systemd is in use, but it's worth checking
No luck. It worked, but after a reboot it's back to not working.
I am also seeing this exact issue on archlinux 5.3.7. fresh install, also installed xorg-server-xwayland but disabled it in the config using 'xwayland disable'. Both nvidia and Intel (optimus). No problems with it on previous installs.
Video group does not matter and was never needed anyway.
Even uninstall and install does not seems to work on my setup.
Sway 1.2 => package 1:1.2-5 archlinux.
I think it may also be related to other packages as this is a full os install and not a sway update alone. The setup is the same as I had 6 months ago, I don't recall the running sway version on that install. If I find the time, I might go digging in the source code..
It might be a wayland issue, from the very few issues I can find => https://bbs.archlinux.org/viewtopic.php?id=249415
https://bbs.archlinux.org/viewtopic.php?id=250209
Latest systemd might be the issue, will try if early KMS solves the issue tomorrow ;).
I found that reinstalling sway isn't the only workaround - installing weston also makes sway work until reboot, uninstalling weston again makes sway work.
Latest systemd might be the issue, will try if early KMS solves the issue tomorrow ;).
Would certainly explain why I don't run into the issue on my Void Linux box. Going to try enabling early KMS tomorrow and see if that fixes the issue.
Early KMS solved this for me.
I can confirm this solved the issue as well, although It seems to work without early KMS if I directly start sway after login in (using my rc file).
I cannot reproduce myself, but is everyone with a machine affected by "Failed to take device '/dev/dri/...'" running systemd 243? And you cannot reproduce with early KMS?
Then I think this is caused by systemd/systemd#12639 and related, which also dunked sddm it seems in systemd/systemd#13296.
I'll try writing a patch for swaywm/wlroots#1424, which I imagine will fix this issue along with systemd/systemd#13811.
As everyone here seems to run arch linux, I guess they are up to date with the packages. The latest version in the repo is: 243.78-1
Can also confirm that early KMS solves the issue.
However, I just cloned and installed wlroots, the issue still persists with late KMS after @RPigott commit.
@Simonas0 did you apply the systemd patch as well?
Enabling early KMS also resolved this for me.
Closing because we've done everything we could to fix this.
Unfortunately early KMS is not a solution, just a workaround - which I can't even use, since enabling early KMS conflicts with pwm_backlight in my case :/
I've got the same issue, but running systemctl stop systemd-logind and then running sway again works around the problem for me. (sway version 1.2 on an up-to-date Arch Linux with linux-hardened 5.4.10.a-1-hardened and systemd 244 (244.1-1-arch))
Same issue as nycex but with standard Arch kernel. Same systemd version. logind workaround works for me as well. Restarting the PC (i.e. starting sway on a warm boot) seems to work around the issue consistently as well, but this is of course anecdotal.
Most helpful comment
I've got the same issue, but running
systemctl stop systemd-logindand then running sway again works around the problem for me. (sway version 1.2 on an up-to-date Arch Linux with linux-hardened 5.4.10.a-1-hardened and systemd 244 (244.1-1-arch))