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

Stephan Kulow <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WORKSFORME
             Status|REPORTED                    |RESOLVED

--- Comment #3 from Stephan Kulow <[email protected]> ---
You know what? I asked a friend!

🔍 What's Likely Happening
Based on your report, this is almost certainly a GPU driver / Mesa /
kernel-level crash, not a KPatience application bug per se. Here's the nerdy
breakdown:

Why KPatience specifically?
KPatience uses Qt5 with OpenGL/Vulkan rendering for its card animations. When
you drag a card, it triggers:

Continuous GPU draw calls (animated card following your mouse)
Compositing via KWin (or in your case, GNOME's Mutter compositor on Wayland)
Rapid, repeated DMA buffer flips on the iGPU
The crash mid-drag is a classic symptom of a GPU command buffer overflow, fence
timeout, or TLB shootdown in the amdgpu kernel driver — which causes the kernel
to either:

Hang (GPU reset fails → system freeze)
Panic (unrecoverable GPU fault → kernel panic → reboot)
Why does it happen across multiple AMD iGPU generations?
You mentioned this happened on:

Vega (Ryzen 5 2400G) — Ubuntu 18.04
Vega (Ryzen 5 5600G) — Ubuntu 22.04
RDNA3 / Phoenix (Ryzen 7 7840HS) — Ubuntu 24.04
This strongly suggests a persistent bug in how the amdgpu driver handles the
specific rendering pattern that KPatience's card drag animation produces —
likely related to shared VRAM management on APUs (where system RAM is used as
VRAM).

🛠️ Debugging Steps & Workarounds
Step 1 — Enable Persistent Kernel Crash Logs
Since you can't get logs after a crash, set up pstore / kdump to capture them:



# Install kdump tools
sudo apt install linux-crashdump

# Enable pstore (survives reboots)
sudo mkdir -p /sys/fs/pstore
Also add this to your kernel boot parameters to get crash data written to disk:



sudo nano /etc/default/grub
Find GRUB_CMDLINE_LINUX_DEFAULT and add pstore.backend=efi to it, then:



sudo update-grub
After a crash and reboot, check:



ls /sys/fs/pstore/
# or
sudo dmesg | grep -i "amdgpu\|gpu\|hang\|reset\|fence\|timeout" | tail -50
Step 2 — Enable amdgpu Debug Logging Before Playing
Run this before launching KPatience:



# Enable amdgpu debug output
sudo sh -c 'echo 0xffffffff > /sys/module/amdgpu/parameters/debug_mask'

# Watch the kernel log live in a separate terminal
sudo journalctl -f -k | grep -i "amdgpu\|drm\|gpu\|fence\|hang\|reset"
Then launch KPatience and play until it crashes. If the system survives long
enough, you might catch the error. After reboot:



sudo journalctl -b -1 -k | grep -i "amdgpu\|drm\|fence\|hang\|reset\|error"
The -b -1 flag reads the previous boot's kernel log — this is your best friend
here! 🎯

Step 3 — Check Previous Boot Logs Right Now
You can already do this without any setup:



# Check if previous boot logs exist
sudo journalctl -b -1 -k --no-pager | tail -100

# Specifically hunt for GPU issues
sudo journalctl -b -1 -k | grep -iE
"amdgpu|drm|gpu|fence|hang|reset|panic|oom|killed" | tail -50
Step 4 — Try Forcing Software Rendering for KPatience
This is a workaround to confirm the GPU is the culprit. Launch KPatience with
software rendering:



LIBGL_ALWAYS_SOFTWARE=1 kpat
If it never crashes in software rendering mode, that's your smoking gun — it's
100% a GPU driver issue.

Step 5 — Try Disabling Vsync / Compositor Sync


# Launch with different rendering hints
QT_QPA_PLATFORM=xcb kpat
# or try forcing X11 instead of Wayland
Or try running KPatience under XWayland explicitly by launching it from an X11
session temporarily.

Step 6 — Mesa & Kernel Version Check
Your Mesa 25.2.8 is very recent (bleeding edge for 24.04!). Check if there are
known regressions:



# Check exact versions
glxinfo | grep "OpenGL version"
vainfo 2>/dev/null | head -5
vulkaninfo 2>/dev/null | grep "driverVersion" | head -3

# Check amdgpu firmware version
sudo dmesg | grep -i "amdgpu.*firmware\|amdgpu.*version" | head -10
Step 7 — Undervolting / Power Cap Consideration
Your system is undervolted with a 35W TDP cap. This is a potential suspect!
When KPatience triggers rapid GPU draw calls, the GPU might:

Request a power state transition
Hit the power cap
Cause a voltage droop below stable threshold
Trigger a GPU fault
Try temporarily removing the power cap and testing:



# Check current power settings
cat /sys/class/drm/card0/device/hwmon/hwmon*/power1_cap

# Temporarily raise or remove cap (replace hwmon0 with your actual hwmon)
sudo sh -c 'echo 0 > /sys/class/drm/card0/device/hwmon/hwmon0/power1_cap_max'
Or test with your undervolting tool disabled entirely for a session.

🐛 Where to Report This
Since this is reproducible across multiple AMD APU generations, this is
definitely worth reporting upstream:

Mesa bug tracker: https://gitlab.freedesktop.org/mesa/mesa/-/issues
Linux kernel amdgpu: https://gitlab.freedesktop.org/drm/amd/-/issues

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

Reply via email to