swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.56k stars 1.11k forks source link

Unable to create backend. setuid does not resolve #4472

Open Reifam opened 5 years ago

Reifam commented 5 years ago

Hello! I'm trying to get sway running, and I keep running into issues with creating backend.

2019-08-19 18:47:29 - [sway-1.1.1/sway/main.c:151] Linux alpha 5.2.8-artix1-1-ARTIX #1 SMP PREEMPT Sat Aug 10 14:46:44 UTC 2019 x86_64 GNU/Linux
2019-08-19 18:47:29 - [sway-1.1.1/sway/main.c:139] LD_LIBRARY_PATH=(null)
2019-08-19 18:47:29 - [sway-1.1.1/sway/main.c:139] LD_PRELOAD=(null)
2019-08-19 18:47:29 - [sway-1.1.1/sway/main.c:139] PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
2019-08-19 18:47:29 - [sway-1.1.1/sway/main.c:139] SWAYSOCK=(null)
2019-08-19 18:47:29 - [sway-1.1.1/sway/server.c:40] Preparing Wayland server initialization
2019-08-19 18:47:29 - [wlroots-0.6.0/backend/session/logind.c:663] Successfully loaded logind session
2019-08-19 18:47:29 - [wlroots-0.6.0/backend/backend.c:192] Found 0 GPUs
2019-08-19 18:47:29 - [wlroots-0.6.0/backend/backend.c:339] Failed to open any DRM device
2019-08-19 18:47:29 - [wlroots-0.6.0/backend/noop/backend.c:51] Creating noop backend
2019-08-19 18:47:29 - [sway-1.1.1/sway/server.c:47] Unable to create backend

I'm on a systemdless box, with elogind. My understanding is that a possible option is using setuid, but I'd done that and am still having this issue. Some other outputs: sway --get-socketpath: sway socket not detected swaymsg -t get_outputs 2019-08-19 18:54:39 - [sway-1.1.1/swaymsg/main.c:403] Unable to retrieve socket path

Any advice?

RedSoxFan commented 5 years ago

I'm on a systemdless box, with elogind. My understanding is that a possible option is using setuid, but I'd done that and am still having this issue.

If you are using elogind, you shouldn't need to setuid sway. This may be relevant:

To use elogind, wlroots should be compiled with -Dlogind-provider=elogind, or it will try to use libsystemd instead.

Did you set that flag when compiling wlroots?

Reifam commented 5 years ago

Is that still the case? https://forum.artixlinux.org/index.php/topic,1013.0.html They're saying elogind should now be compatible. I'm using the package manager binary. I tried building wlroots and sway manually, but then sway said it couldn't find a wlroots .so file for some reason.

ascent12 commented 5 years ago

In the end, the difference between -Dlogind-provider=systemd and -Dlogind-provider=elogind doesn't matter, since the communication happens over DBus. The option is there for distros that don't want to supply libsystemd.

The real issue you're having is

2019-08-19 18:47:29 - [wlroots-0.6.0/backend/backend.c:192] Found 0 GPUs

Does your GPU driver not support kernel modesetting or have you disabled it? Providing the output of https://github.com/ascent12/drm_info may help too.

Reifam commented 5 years ago

Ok, that gets us somewhere. So I have a new Navi graphics card, and my system is not yet on the 5.3 kernel. I tried compiling a release-candidate development 5.3 kernel to get the driver early, but that ended in a udev issue that made my computer unable to boot, which is an issue outside the scope of sway. What I mean is that due to some technical difficulties, I am now waiting for 5.3 to release for real and for it to end up in my repos at this point.

drm_info gave no output, and like you said, wlroots says 0 GPUs, but yet I can still run X11 just fine. It falls back to VESA and I am able to use i3wm without issues, as well as run a full web browser to post this. Here is some relevant output from /var/log/Xorg.0.log: [ 32.739] (II) modesetting: Driver for Modesetting Kernel Drivers: kms [ 32.739] (II) VESA: driver for VESA chipsets: vesa [ 32.739] (EE) open /dev/dri/card0: No such file or directory [ 32.739] (WW) Falling back to old probe method for modesetting [ 32.739] (EE) open /dev/dri/card0: No such file or directory [ 32.739] (EE) Screen 0 deleted because of no matching config section. [ 32.739] (II) UnloadModule: "modesetting" [ 32.739] (II) Loading sub module "vbe" [ 32.739] (II) LoadModule: "vbe" [ 32.739] (II) Loading /usr/lib/xorg/modules/libvbe.so [ 32.739] (II) Module vbe: vendor="X.Org Foundation" [ 32.739] compiled for 1.20.5, module version = 1.1.0 [ 32.739] ABI class: X.Org Video Driver, version 24.0 [ 32.739] (II) Loading sub module "int10" [ 32.739] (II) LoadModule: "int10" [ 32.739] (II) Loading /usr/lib/xorg/modules/libint10.so [ 32.739] (II) Module int10: vendor="X.Org Foundation" [ 32.739] compiled for 1.20.5, module version = 1.0.0 [ 32.739] ABI class: X.Org Video Driver, version 24.0 [ 32.739] (II) VESA(0): initializing int10 [ 32.741] (II) VESA(0): Primary V_BIOS segment is: 0xc000 [ 32.741] (II) VESA(0): VESA BIOS detected [ 32.741] (II) VESA(0): VESA VBE Version 3.0 [ 32.741] (II) VESA(0): VESA VBE Total Mem: 49152 kB [ 32.741] (II) VESA(0): VESA VBE OEM: AMD ATOMBIOS [ 32.741] (II) VESA(0): VESA VBE OEM Software Rev: 17.1 [ 32.741] (II) VESA(0): VESA VBE OEM Vendor: (C) 1988-2018, Advanced Micro Devices, Inc. [ 32.741] (II) VESA(0): VESA VBE OEM Product: NAVI10 [ 32.741] (II) VESA(0): VESA VBE OEM Product Rev: 01.00 [ 32.754] (II) VESA(0): Creating default Display subsection in Screen section "Default Screen Section" for depth/fbbpp 24/32 [ 32.754] (==) VESA(0): Depth 24, (--) framebuffer bpp 32 [ 32.754] (==) VESA(0): RGB weight 888 [ 32.754] (==) VESA(0): Default visual is TrueColor So I'm on a VESA driver. Does Sway/Wayland support VESA like Xorg does, or do they only work with a full amdgpu/radeon driver? If so, how should I proceed?

ascent12 commented 5 years ago

We require kernel modesetting, which is a typical requirement for Wayland compositors, and every modern driver supports it. Xorg also supports fbdev, which is the old way of doing that sort of thing, which we don't support.

I'm seeing AMD mentioned in that Xorg dump as the GPU vendor. Even very old AMD GPUs support kernel modesetting on the radeon kernel driver. I would make sure that your kernel configuration and kernel modules are set up properly. It seems like you don't have the appropriate amdgpu or radeon driver loaded (depends on the GPU).