https://bugs.kde.org/show_bug.cgi?id=527582

            Bug ID: 527582
           Summary: Native Wayland GPU clients cause kwin_wayland to
                    constantly runtime-resume an idle secondary AMD dGPU
                    (~600 wakeups/s)
    Classification: Plasma
           Product: kwin
      Version First 6.8.0
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: platform-drm
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

On a hybrid AMD laptop, the secondary dGPU (no outputs connected) is kept
from runtime-suspending as soon as a native Wayland client that submits
GPU-rendered buffers is active. Kernel tracing shows the wakeups come from
kwin_wayland itself, not from the client. The client renders on the iGPU only.
When the same client runs through Xwayland, the wakeups disappear entirely.

--- HARDWARE / SOFTWARE ---
- Laptop: ASUS TUF A16 FA617NS
- iGPU: AMD Radeon 680M (0000:77:00.0) - drives the internal panel
- dGPU: AMD Radeon RX 7600S (0000:03:00.0) - only HDMI/DP are wired to it,
  nothing connected during tests
- OS: EndeavourOS (Arch), kernel 7.2.11-arch1-1
- Plasma: 6.8.0, KWin: 6.8.0, Wayland session
- Mesa: 26.2.5
- supergfxctl in Hybrid mode
- dGPU runtime PM: power/control=auto, autosuspend_delay_ms=100
  (lowered because amdgpu itself wakes the GPU every ~2 s)

--- STEPS TO REPRODUCE ---
1. Leave nothing connected to the dGPU outputs. Check it is idle:
   cat /sys/bus/pci/devices/0000:03:00.0/power/runtime_status  -> suspended
2. Start a Chromium-based browser (Brave 155 / Chromium 155.0.8059.85) natively
   on Wayland, pinned to the iGPU:
   brave --ozone-platform=wayland --render-node-override=/dev/dri/renderD129
   (chrome://gpu confirms: Ozone platform = wayland, active GPU = 0x1681 /
680M)
3. Scroll a page while recording runtime-PM resumes of the dGPU:
   T=/sys/kernel/tracing
   echo 1 > $T/events/rpm/rpm_resume/enable
   timeout 15 cat $T/trace_pipe | grep "0000:03:00.0" > /tmp/rpm.log
   echo 0 > $T/events/rpm/rpm_resume/enable
   awk '{print $1}' /tmp/rpm.log | sort | uniq -c | sort -rn

--- OBSERVED (15 s capture) ---
   9492 kwin_wayland-1780
     ~14 kworker/*   (amdgpu internal, expected)
runtime_status flips between active/suspended continuously while the client
draws. It stops as soon as the window is idle. The browser feels laggy
because of the repeated resume latency.

--- EXPECTED ---
No dGPU activity from KWin while no output is enabled on the dGPU and the
client renders on the iGPU. The dGPU should stay suspended.

--- WHAT WAS RULED OUT ---
- The client does not touch the dGPU: no fd open on the dGPU nodes
  (fuser on renderD128/card1 only shows kwin_wayland, Xwayland, systemd,
  logind), and strace -e openat on the browser GPU process shows no access
  to dGPU nodes or sysfs during the capture.
- --disable-accelerated-video-decode: no change.
- --disable-features=WaylandLinuxDrmSyncobj: no change (9106 kwin_wayland
hits).

--- WHAT MAKES IT DISAPPEAR ---
- Same browser via Xwayland (--ozone-platform=x11): 0 resumes in 15 s.
- Same browser with --disable-gpu (shm buffers instead of dmabuf): no flipping.
So the trigger seems to be KWin handling dmabuf-based buffers from a native
Wayland client, with KWin issuing ioctls on its dGPU fd for each frame
(every amdgpu ioctl takes a runtime-PM reference).

--- WORKAROUND ---
Running Chromium/Electron apps through Xwayland.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to