AMD GPU suddenly unusably slow (mesa issue?)

After a system reboot, wayland/sway takes multiple seconds to render each frame. I did verify that hardware rendering is still in use. It didn’t, as far as I can see, fall back to llvmpipe. It was working perfectly before.

Anyone else seeing this? I suspect this has to do with a debian package upgrade (Mesa drivers? I’m not sure).

  • kernel: 5.13.9 (unchanged, so unlikely to be the issue, also linux framebuffer terminal still works fine)
  • libgles2-mesa 21.2.5-1
  • AMD RX550 GPU
7:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] (rev c7)

I suspect it was this upgrade:

2021-11-06 15:51:31 upgrade libegl-mesa0:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:31 upgrade libgl1-mesa-dri:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:33 upgrade libglx-mesa0:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:33 upgrade libglapi-mesa:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:33 upgrade libegl1-mesa:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:33 upgrade libegl1-mesa-dev:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:35 upgrade libgl1-mesa-dev:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:36 upgrade libgles2-mesa-dev:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:45 upgrade mesa-va-drivers:riscv64 21.2.4-1 21.2.5-1
2021-11-06 15:51:46 upgrade mesa-vdpau-drivers:riscv64 21.2.4-1 21.2.5-1

Nothing new in dmesg. When I have some time I’ll try if reverting to the old version solves the issue.

Edit:

apt install libgbm-dev=21.2.4-1 libegl-mesa0=21.2.4-1 libgbm1=21.2.4-1 libgl1-mesa-dri=21.2.4-1 libglx-mesa0=21.2.4-1 libglapi-mesa=21.2.4-1 libegl1-mesa=21.2.4-1 libegl1-mesa-dev=21.2.4-1 libgl1-mesa-dev=21.2.4-1 libgles2-mesa-dev=21.2.4-1 mesa-va-drivers=21.2.4-1 mesa-vdpau-drivers=21.2.4-1

Fails, it cannot find the version anymore. I guess building from source is the only way, it’d be necessary for bisecting anyway…

It seems to be a problem with debian’s build. Building mesa (21.3.0, at least) from source solved the problem.

It seems the debian packaging change that caused this is:

mesa (21.2.3-1) unstable; urgency=medium

  [ Timo Aaltonen ]
  * New upstream release.
  * rules: Build with -O2 for ppc64el.
  * Build with llvm 13.

  [ Aurelien Jarno ]
  * Disable LLVM support on riscv64, it doesn't have JIT. (Closes: #995618)

 -- Timo Aaltonen <tjaalton@debian.org>  Mon, 04 Oct 2021 15:18:27 +0300

I suspect disabling LLVM also disappears radeonsi, as it uses LLVM for the shader compiler.

I’ve relayed this to Aurelien along with what I believe to be the fix (that still disables the broken llvmpipe)

1 Like

Thank you !

hello, i ve just upgraded from 21.10 to 22.04 Ubuntu and similar slowness immediately appears at next reboot (with new kernel 5.15 or even if trying the previoulsy fine recompiled 5.13). I know it was risky ;-). This omnipresent LLVM part has similar unexpected effect on VisionFive Riscv board, but it seems to be required by more and more software…
I’l try to recompile MESA next W.E., just to give a try.

I’m not able to try it myself, FWIW it looks like the change that fixed my issue did land in the Ubuntu release 22.04 http://changelogs.ubuntu.com/changelogs/pool/main/m/mesa/mesa_22.0.1-1ubuntu2/changelog

…
mesa (21.2.3-1) unstable; urgency=medium

  [ Timo Aaltonen ]
  * New upstream release.
  * rules: Build with -O2 for ppc64el.
  * Build with llvm 13.

  [ Aurelien Jarno ]
  * Disable LLVM support on riscv64, it doesn't have JIT. (Closes: #995618)

 -- Timo Aaltonen <tjaalton@debian.org>  Mon, 04 Oct 2021 15:18:27 +0300
…

packages.ubuntu.com doesn’t have a file listing for riscv64 so I’m not able to check if radeonsi driver is in there.

This topic has some instructions that might be useful for building Mesa from source for this hardware combo: Ubuntu AMDGPU Drivers - #14 by vmedea

1 Like

thanks, i will test building it on the Unmatched soon. I’ve just rebuilt MESA on the VisionFive on Fedora -but an older MESA release- so the process is still fresh. I hope rebuilding the Radeon part will solve the problem for my Unmatched with its R570, to enjoy Ubuntu 22 on it :slight_smile:

hello,
Finally yesteday i built from sources the MESA 21.3.8, everything was fine, testing from local installation /usr/local/lib/riscv-linux-gnu and i shutdown, thinking i would need to adjust ldconfig to add this path permanently … but booting today the display was already ok, amdgpu driver was listed in lsmod… so fixed.
Looking in /etc/ld.so.conf.d/ there was a riscv64-linux-gnu.conf that contains already the path to compiled libraries. :slight_smile:
Thanks for the links above anyway.

1 Like