Radeon 680M: amdgpu crashes with GL_OUT_OF_MEMORY in glTexSubImage
Brief summary of the problem:
I have a Lenovo Z16 Gen 1 which has been experiencing GPU thread crashes when resizing windows, bringing them to the foreground, or waking from sleep under Ubuntu. The easiest method to reproduce the crash is to run an Electron-based app like VS Code on the iGPU, and then rapidly resize it from the bottom right corner for a couple of seconds. The crash appears to be caused by (EE) glamor0: GL error: GL_OUT_OF_MEMORY in glReadPixels
. My partial workaround so far has been to set DRI_PRIME=1
in /etc/environment
, since the resizing crash does not occur when using the dGPU (although the sleep problems are still there).
Sep 04 11:47:40 z16 gnome-shell[5585]: EE sources/mesa/src/gallium/drivers/radeonsi/si_texture.c:1900 si_texture_transfer_map - failed to create temporary texture to hold untiled copy
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) glamor0: GL error: GL_OUT_OF_MEMORY in glReadPixels
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE)
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) Backtrace:
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 0: /usr/bin/Xwayland (0x556de7a5b000+0x164fd9) [0x556de7bbffd9]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 1: /opt/amdgpu/lib/x86_64-linux-gnu/dri/radeonsi_dri.so (0x7fcb6f000000+0x1c6f92) [0x7fcb6f1c6f92]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 2: /opt/amdgpu/lib/x86_64-linux-gnu/dri/radeonsi_dri.so (0x7fcb6f000000+0x466886) [0x7fcb6f466886]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 3: /opt/amdgpu/lib/x86_64-linux-gnu/dri/radeonsi_dri.so (0x7fcb6f000000+0x4ba46b) [0x7fcb6f4ba46b]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 4: /opt/amdgpu/lib/x86_64-linux-gnu/dri/radeonsi_dri.so (0x7fcb6f000000+0x4673e1) [0x7fcb6f4673e1]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 5: /opt/amdgpu/lib/x86_64-linux-gnu/dri/radeonsi_dri.so (0x7fcb6f000000+0x467846) [0x7fcb6f467846]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 6: /usr/bin/Xwayland (0x556de7a5b000+0x65af7) [0x556de7ac0af7]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 7: /usr/bin/Xwayland (0x556de7a5b000+0x5a9af) [0x556de7ab59af]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 8: /usr/bin/Xwayland (0x556de7a5b000+0x5e957) [0x556de7ab9957]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 9: /usr/bin/Xwayland (0x556de7a5b000+0x5f918) [0x556de7aba918]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 10: /usr/bin/Xwayland (0x556de7a5b000+0xf2c3f) [0x556de7b4dc3f]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 11: /usr/bin/Xwayland (0x556de7a5b000+0xf7ae6) [0x556de7b52ae6]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 12: /usr/bin/Xwayland (0x556de7a5b000+0xa70be) [0x556de7b020be]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 13: /usr/bin/Xwayland (0x556de7a5b000+0x34c73) [0x556de7a8fc73]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 14: /lib/x86_64-linux-gnu/libc.so.6 (0x7fcb71000000+0x29d90) [0x7fcb71029d90]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 15: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0x80) [0x7fcb71029e40]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE) 16: /usr/bin/Xwayland (0x556de7a5b000+0x364a5) [0x556de7a914a5]
Sep 04 11:47:40 z16 gnome-shell[5585]: (EE)
Things I have tried:
- Tried switching to Manjaro Linux -> experienced same bug
- Tried updating from stock 5.15 kernel to 5.19.x on both distros -> experienced same bug (but saw different GPU IDs)
- Tried under X11 instead of Wayland -> crash does not kill the whole process, the window goes black but eventually recovers
- Tried messing around with UMA Frame buffer size settings in UEFI -> no apparent effect, memory size in OS does not change
When not actively trying to reproduce the bug, I can experience it pretty quickly through normal use by just having 2-3 VS code windows open and switching between them. Maximizing or fullscreening an app is another sure way to cause problems. Other Electron apps like Spotify and Slack also experience this problem. Most times, waking from sleep will be unreliable, but I am unsure if this is caused by the same problem.
Hardware description:
- CPU: AMD Ryzen 7 PRO 6850H
- GPU: Radeon 680M / Radeon RX 6500M 4GB GDDR6
- System Memory: 32GB LPDDR5
- Display(s): Built-in 3840x2400
- Type of Display Connection: eDP
System information:
- Distro name and Version: Ubuntu 22.04.1 LTS, Manjaro 21.3.7
- Kernel version:
- Ubuntu: Linux z16 5.19.5-051905-generic #202208291036 SMP PREEMPT_DYNAMIC Mon Aug 29 10:47:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
- Manjaro: Linux Z16 5.19.1-3-MANJARO #1 (closed) SMP PREEMPT_DYNAMIC Sat Aug 13 06:34:52 UTC 2022 x86_64 GNU/Linux
- Custom kernel: Also experimented with stock 5.15 branch kernels shipped with these distros as stock, and installing builds from from oibaf's PPA
- AMD official driver version: 22.1.0 (?)
How to reproduce the issue:
Clean install Manjaro or Ubuntu and install all updates, optionally update to latest kernel as well. Install and run an Electron-based app like VS Code on the iGPU (default on my laptop), and then rapidly resize it from the bottom right corner for a couple of seconds.
Attached files:
Screenshots/video files
Attached:
- Photo of video corruption on two screens following a crash and trying to switch sessions with Ctrl + Alt + F, failing, and switching back to Wayland session
- Screenshots of the GPU-Z for each GPU under Windows 11 with AMD driver 22.8.1
Log files (for system lockups / game freezes / crashes)
Once each for Manjaro and Ubuntu:
-
sudo journalctl _UID=1000 -f
output showing GPU thread crash -
sudo dmesg
output -
inxi -Gxx
output -
sudo lshw -C display -numeric
output -
glxinfo -B
output
Links:
Threads discussing this issue in descending order of interest: