dGPU set as primary is going back and forth sleep/awake when no external displays connected to it
Brief summary of the problem:
When dGPU is set as primary via ENV{DEVNAME}=="/dev/dri/card0", TAG+="mutter-device-preferred-primary"
and dGPU does not have displays directly connected to it (using iGPU eDP via PRIME) and dGPU has only Wayland clients (Gnome Wayland session, Firefix in Wayland mode) then dGPU goes to sleep and back awake every 7 seconds or so causing short UI freezes.
Hardware description:
- Machine Type: Laptop System: ASUSTeK product: ROG Strix G513QY_G513QY v: 1.0 (AMD Advantage Edition)
- CPU: 8-core model: AMD Ryzen 9 5900HX with Radeon Graphics
- iGPU: 08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c4)
- dGPU (RX6800M): 03:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT / 6800M] [1002:73df] (rev c3)
- iGPU is connected to internal laptop screen via eDP, dGPU is set as primary for GNOME Wayland session
- System Memory: 64 GB
System information:
- Distro name and Version: Manjaro rolling
- Kernel version: Linux 5.17.6-1-MANJARO SMP PREEMPT Tue May 10 22:09:48 EEST 2022 x86_64 GNU/Linux
How to reproduce the issue:
- Create file
/etc/udev/rules.d/61-mutter-primary-gpu.rules
with contentENV{DEVNAME}=="/dev/dri/card0", TAG+="mutter-device-preferred-primary"
where/dev/dri/card0
is the device node of the dGPU - Boot into Gnome Wayland mode, open Gnome Terminal and run
sudo journalctl -f
, press Win button (Enter Gnome Workspace overview mode) - Observe the log lines about dGPU waking up from sleep every 7 seconds or so
dGPU stops behaving like this when either of this happens
- External display is connected (attached journal shows this)
-
sudo radeontop -b 3
is running -
glxgears
in XWayland mode is running