You are not logged in.

#1 2025-03-13 21:24:26

be_far
Member
Registered: 2025-02-14
Posts: 4

udev rule not applying before graphical session starts?

Hi,

I have a udev rule to apply a tag to my GPU before Mutter starts so that it uses the correct renderer. I enabled autologin today, and now the rule doesn't fire before Mutter starts. Is there any way to make GDM or the graphical session target depend on udev rules firing?
In /etc/udev/rules.d/61-mutter-gpu.rules:

 SUBSYSTEM=="drm", ENV{DEVTYPE}=="drm_minor", ENV{DEVNAME}=="/dev/dri/card[0-1]", SUBSYSTEMS=="pci", ATTRS{vendor}=="0x10de", ATTRS{device}=="0x2489", TAG+="mutter-device-preferred-primary" 

Currently, if I boot without autologin, the rule fires while I'm on the GDM login screen (verified by switching to the tty and checking udevadm info). If I instead boot with autologin, it goes to desktop without firing, then fires there as shown in udevadm but not journalctl; then restarting the graphical session applies it correctly. I'm looking for "GPU /dev/dri/card1 selected primary given udev rule", not "GPU /dev/dri/card0 selected primary from builtin panel presence" in journalctl, and CURRENT_TAGS=:master-of-seat:uaccess:seat:mutter-device-preferred-primary: in udevadm info.

Thanks!

Offline

#2 2025-03-14 09:48:15

seth
Member
Registered: 2012-09-03
Posts: 62,236

Re: udev rule not applying before graphical session starts?

Offline

Board footer

Powered by FluxBB