Switching to Wayland: Failed to open drm device at "/dev/dri/card0"

Hey there,
today x11 crashed and reset my kde desktop settings. A friend of mine told me that this had happened a lot of times to him and that I just needed to restore some files. Trying to get that to work for a while, I gave up and realised, that I could just switch to wayland as it resets my desktop settings as well.
So I installed wayland and plasma-wayland-session, but when I tried to log in into wayland, ly briefly printed an error on the screen before it showed it's login prompt again (Please tell me how I can get the full log of the login process, I couldn't figure it out, so for now enjoy this very blurry photo that I barely managed to make in the time I had):

What is this error? I have no clue, and I am out of ideas what to do. Every wayland installation guide either Doesn't use an AMD gpu or doesn't mention that error at all. Even the Arch wiki and Fedora wiki didn't include this. For them it just works out of the box.

Thanks!

inxi -Faz
System:    Kernel: 5.15.3-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0
           parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=2a555427-5d35-463f-8011-b023a855b928 rw
           rootflags=subvol=@ loglevel=3 quiet splash lsm=lockdown,yama,apparmor,bpf
           Desktop: KDE Plasma 5.23.3 tk: Qt 5.15.2 info: latte-dock wm: kwin_x11 vt: 1 dm: SDDM
           Distro: Garuda Linux base: Arch Linux
Machine:   Type: Desktop System: Gigabyte product: AX370-Gaming 3 v: N/A serial: <filter>
           Mobo: Gigabyte model: AX370-Gaming 3-CF v: x.x serial: <filter> UEFI-[Legacy]: American Megatrends
           v: F50a date: 11/27/2019
CPU:       Info: 6-Core model: AMD Ryzen 5 2600X bits: 64 type: MT MCP arch: Zen+ family: 17 (23) model-id: 8
           stepping: 2 microcode: 800820D cache: L2: 3 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 86223
           Speed: 4170 MHz min/max: 2200/3600 MHz boost: enabled Core speeds (MHz): 1: 4170 2: 4166 3: 4167 4: 4170
           5: 4172 6: 4119 7: 4167 8: 4173 9: 4174 10: 4174 11: 4175 12: 4134
           Vulnerabilities: Type: itlb_multihit status: Not affected
           Type: l1tf status: Not affected
           Type: mds status: Not affected
           Type: meltdown status: Not affected
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
           Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: disabled, RSB filling
           Type: srbds status: Not affected
           Type: tsx_async_abort status: Not affected
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Baffin [Radeon RX 550 640SP / RX 560/560X] vendor: ASUSTeK
           driver: amdgpu v: kernel bus-ID: 08:00.0 chip-ID: 1002:67ff class-ID: 0300
           Device-2: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo bus-ID: 3-3:5 chip-ID: 046d:0825
           class-ID: 0102 serial: <filter>
           Display: x11 server: X.Org 1.21.1.1 compositor: kwin_x11 driver: loaded: amdgpu,ati unloaded: modesetting
           alternate: fbdev,vesa display-ID: :0 screens: 1
           Screen-1: 0 s-res: 3600x1200 s-dpi: 96 s-size: 952x317mm (37.5x12.5") s-diag: 1003mm (39.5")
           Monitor-1: HDMI-A-0 res: 1680x1050 hz: 60 dpi: 90 size: 474x296mm (18.7x11.7") diag: 559mm (22")
           Monitor-2: DVI-D-0 res: 1920x1200 hz: 60 dpi: 99 size: 495x310mm (19.5x12.2") diag: 584mm (23")
           OpenGL: renderer: AMD Radeon RX 560 Series (POLARIS11 DRM 3.42.0 5.15.3-zen1-1-zen LLVM 13.0.0)
           v: 4.6 Mesa 21.2.5 direct render: Yes
Audio:     Device-1: AMD Baffin HDMI/DP Audio [Radeon RX 550 640SP / RX 560/560X] vendor: ASUSTeK
           driver: snd_hda_intel v: kernel bus-ID: 08:00.1 chip-ID: 1002:aae0 class-ID: 0403
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel
           v: kernel bus-ID: 0a:00.3 chip-ID: 1022:1457 class-ID: 0403
           Device-3: C-Media USB Microphone type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-2:3
           chip-ID: 0d8c:9700 class-ID: 0300 serial: <filter>
           Device-4: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo bus-ID: 3-3:5 chip-ID: 046d:0825
           class-ID: 0102 serial: <filter>
           Sound Server-1: ALSA v: k5.15.3-zen1-1-zen running: yes
           Sound Server-2: JACK v: 1.9.19 running: no
           Sound Server-3: PulseAudio v: 15.0 running: no
           Sound Server-4: PipeWire v: 0.3.40 running: yes
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: r8169 v: kernel
           port: f000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
           IF-ID-1: docker0 state: down mac: <filter>
           IF-ID-2: virbr0 state: down mac: <filter>
Bluetooth: Device-1: Broadcom BCM20702A0 Bluetooth 4.0 type: USB driver: btusb v: 0.8 bus-ID: 3-1.1:4
           chip-ID: 0a5c:21e8 class-ID: fe01 serial: <filter>
           Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Drives:    Local Storage: total: 2.96 TiB used: 1.92 TiB (64.8%)
           SMART Message: Unable to run smartctl. Root privileges required.
           ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 1TB size: 931.51 GiB block-size:
           physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 4B6Q scheme: GPT
           ID-2: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 860 EVO 250GB size: 232.89 GiB block-size:
           physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 1B6Q scheme: GPT
           ID-3: /dev/sdc maj-min: 8:32 vendor: Western Digital model: WD20EFRX-68EUZN0 size: 1.82 TiB block-size:
           physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter> rev: 0A82
           scheme: GPT
Partition: ID-1: / raw-size: 195.31 GiB size: 195.31 GiB (100.00%) used: 80.92 GiB (41.4%) fs: btrfs dev: /dev/sda2
           maj-min: 8:2
           ID-2: /home raw-size: 736.18 GiB size: 736.18 GiB (100.00%) used: 118.09 GiB (16.0%) fs: btrfs
           dev: /dev/sda3 maj-min: 8:3
           ID-3: /var/log raw-size: 195.31 GiB size: 195.31 GiB (100.00%) used: 80.92 GiB (41.4%) fs: btrfs
           dev: /dev/sda2 maj-min: 8:2
           ID-4: /var/tmp raw-size: 195.31 GiB size: 195.31 GiB (100.00%) used: 80.92 GiB (41.4%) fs: btrfs
           dev: /dev/sda2 maj-min: 8:2
Swap:      Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
           ID-1: swap-1 type: zram size: 31.36 GiB used: 2.2 MiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:   Message: No sensor data found. Is lm-sensors configured?
Info:      Processes: 388 Uptime: 12m wakeups: 0 Memory: 31.36 GiB used: 6.54 GiB (20.8%) Init: systemd v: 249
           tool: systemctl Compilers: gcc: 11.1.0 clang: 13.0.0 Packages: apt: 0 pacman: 1926 lib: 466 Shell: fish
           v: 3.3.1 running-in: alacritty inxi: 3.3.08

My first thought is, use last working snapshot.

Did you update before this “crash”?

1 Like

No. I was playing minecraft (xD)
I kinda don't wanna restore...
I installed quite some stuff.

EDIT: I updated my system yesterday, but it was working quite fine then

/home is not touched by snapshot, only if you mark it in timeshift. IDK about snapper.

1 Like

I have two snappper configs, one for my home folder, and one for root

Did you reboot, yesterday, too?

2 Likes

yes I did. I learned from the last incident (Which wasn't even caused by that, but whatever)

Managed to get the log by manually running dbus-run-session startplasma-wayland &> interesting.log, and this is actually very interesting: https://termbin.com/noxt

But what other compositor? Kwin is dead at that moment

/dev/dri/card0. What's that all about? Also, please unplug one monitor while troubleshooting. It makes it easier.

2 Likes

I'm not exactly sure if you wanted an explanation answer for that probably rhetorical question, but /dev/dri/card0 is my gpu.
I tried the same thing with just one screen, but it didn't help, as expected.

I guess you might be interested into my package list for packages like Firejail (Don't worry, I'm trying to keep my system as clean as possible, so the list shouldn't be too big): https://termbin.com/pmlt

Okay, I followed this guide, and discovered, that a nested wayland window works perfectly, but when trying pretty much the same thing in tty, it spits out the same error: https://termbin.com/xc1fg

It seems like pretty much nobody has had this problem before... I can't really find any problem solving guides. I hope wayland bugtracker is the right place for this

Hi,

I have exactly the same problem. This gets written to my "wayland-session.log" everytime I try to log into "Plasma (Wayland)" session:

No backend specified through command line argument, trying auto resolution
kwin_core: Failed to activate /org/freedesktop/login1/session/_32 session. Maybe another compositor is running?
kwin_wayland_drm: failed to open drm device at "/dev/dri/card0"
kwin_wayland_drm: No suitable DRM devices have been found
startplasmacompositor: Shutting down...
startplasmacompositor: Done.

And I'm back at the login screen after that.

I am trying to nail this problem down for several weeks already, but as you say ... any info available on this topic is NVIDIA-related and I wasn't able to find anything useful for AMD case... :face_with_raised_eyebrow:

Only thing I can add to this so far is that this actually seems like a KDE only problem (I'm able to run Sway or Wayfire just fine)....

1 Like

Bruh this needs to be fixed somehow, x11 is getting worse at the second and freezing me pretty much once every day. Not even sysrq magic works. It's just a full lockup

1 Like

Ok, so, no solution, so far, but at least I have some deeper insight on what's going on here.

Out of desperation, I've built kwin 5.23.4 (the version I currently have installed) from sources, and added some more logging in the relevant places, to see what goes wrong.

Until now, I thought the main problem is this part:
kwin_wayland_drm: failed to open drm device at "/dev/dri/card0"
kwin_wayland_drm: No suitable DRM devices have been found

But as it turns out, the actual problem is already this line:
kwin_core: Failed to activate /org/freedesktop/login1/session/_35 session. Maybe another compositor is running?

It's this method in session_logind.cpp:

static bool activate(const QString &sessionPath)
{
const QDBusMessage message = QDBusMessage::createMethodCall(s_serviceName, sessionPath,
s_sessionInterface,
QStringLiteral("Activate"));

const QDBusMessage reply = QDBusConnection::systemBus().call(message);

return reply.type() != QDBusMessage::ErrorMessage;
}

The marked call returns "Interactive authentication required" error.

Rest of the error output (kwin_wayland_drm) is caused simply by the fact, that because of the failure above, NOOP session is actually injected in the code instead of the "real" one, and that (understandably) is not even trying to do anything with the real hardware.

But, what to do about the "Interactive authentication required" thing, I just don't know... :frowning:

1 Like

This Answer seems interesting.
The problem might be caused by kwin not having root access (Or in this case probably access to the file, but why would kwin not have access to video group stuff?)

Btw: Thank you for your effort, I was kinda lazy and didn't consider doing that myself

EDIT: Found some more: sd-bus-errors

SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED

    Access to the requested operation is not permitted. However, it might be available after interactive authentication. This is usually returned by method calls supporting a framework for additional interactive authorization, when interactive authorization was not enabled with the sd_bus_message_set_allow_interactive_authorization(3) for the method call message.
1 Like

Thanks, that might have something to do with this, indeed.

Anyway, I found that there's already an issue in KDE bugtracker on our problem (not mine, but also a Garuda user, apparently).

I've added my recent findings there as well. Maybe somebody from KDE devs notices it, and will hopefully shed some more light on the issue we have.... :pray:

That is me xD

Also this: sd_bus_message_set_expect_reply
Does Wayland maybe not have the required things enabled for this to work?

1 Like

Ah, ok :grinning_face_with_smiling_eyes:

Well, who knows, might be it, but that's already a bit out of my reach, unfortunatelly, as I don't know anything about dbus, and how it's supposed to work.... :cry:

1 Like

I've tried to look into the QDBusMessage docs on how to apply the flag, You've found, but I don't see anything applicable there :frowning:

EDIT: Now I've notticed the error info You've posted. But, I have to say, I'm confused.
Why there would be a need for interactive authentication, when the user literally just authenticated himself in sddm?

bool QDBusMessage::isInteractiveAuthorizationAllowed() const

Returns the interactive authorization allowed flag, as set by setInteractiveAuthorizationAllowed(). By default this flag is false and the other end is expected to make any authorization decisions non-interactively and promptly.

I think interactive authentication is that someone is using sudo or su and entering the root password, this is not logging into your user's account (That has sudo access, but no root perms).
The codeblock above shows, that there is a way to apparently force interactive authentication, and wayland/kwin might have that enabled, and thus waiting for a user entering a root password, but since this is the login process, there is no prompt

EDIT: I think this enforces my theory even more:

void QDBusMessage::setInteractiveAuthorizationAllowed(bool enable)

Sets the interactive authorization flag to enable. This flag only makes sense for method call messages, where it tells the D-Bus server that the caller of the method is prepared to wait for interactive authorization to take place (for instance via Polkit) before the actual method is processed.

EDIT EDIT: Yes. The org.freedesktop.DBus.Error.InteractiveAuthorizationRequired error indicates that authorization failed, but could have succeeded if this flag had been set.