How to install official AMDGPU linux driver with kernel 4.19.x on Stretch and Buster

This page recommends potentially unsafe practices

This page documents non-recommended practices such as installing packages meant for other GNU/Linux distributions and manually patching files provided by packages.

Bastif's system is made of an AMD Athlon 200GE with Radeon Vega Graphics CPU/APU on a B450M motherboard (Asus PRIME B450M-A). This APU uses the amdgpu driver provided by the linux kernel.

?NagyElemerKaroly's system contains a 'AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx' and is a Lenovo V155. This works with either 19.50 and Debian Buster up to linux-image-4.19.0-11-amd64, or with a patched 20.10 and linux-image-4.19.0-12-amd64. linux-image-4.19.0-12-amd64 breaks the amdgpu dkms build but can be patched (see Debian Bug #972794). Version 20.20-20.40 fail to start X with linux-image-4.19.0-12-amd64. Also, secure boot must be turned off in all cases and something blacklists the amdgpu module from time to time, which must be un-blacklisted by editing /etc/modprobe.d/* to work. Some versions (20.20, 20.30, 20.40) gray the screen between GRUB and X on linux-image-4.19.0-11-amd64 so if you use cryptdisk, you have to enter your password blindly.

With linux 4.19 on debian buster (10) or stretch (9), the system freezes during boot-up and until now the only way to make it boot was either to use kernel >= 4.20 or use the "nomodeset" kernel parameter.

However it is possible to make that system boot with the AMDGPU driver provided by AMD on a linux kernel 4.19 (which is currently backported on Stretch and also the linux kernel version of Buster).

I guess that could help also those having a AMD Ryzen 2200G (or any AMD Raven Ridge APU) if they face a similar issue, or anyone who may want to have a more up-to-date amdgpu driver.

It tested this with the following versions of amdgpu : v19.10-785425, v19.20-812932, v19.30-855429, v19.50-967956, v20.10-1048554, v20.30-1109583 .
- For version 19.10 and 19.20 it was necessary to apply patches to allow compilation on kernel 4.19,
- but since 19.30 patching is not needed any more.

Steps in brief (detailed procedure below)

  1. Get the linux driver from amd's website
  2. Install amdgpu-dkms & amdgpu-core packages

  3. Skip this step if you use version >= 19.30 (it now builds without patching). But if you still want to use 19.10 or 19.20 you will have to apply a patch to the amdgpu-dkms source so that it does compile with linux 4.19 on debian.

  4. Reconfigure amdgpu-dkms
  5. Reboot & it's done

What you need/Prerequisites


This procedure is detailed for version 20.30, please adapt it for previous versions if you prefer to use these.

  1. Extract the archive downloaded from AMD

    • ~$ tar -xvf amdgpu-pro-20.30-1109583-ubuntu-20.04.tar.xz
      ~# cd amdgpu-pro-20.30-1109583-ubuntu-20.04

  2. Install these packages : amdgpu-dkms-firmware (since v20.10), amdgpu-dkms & amdgpu-core. (With 19.10 or 19.20 this will fail at the end because it cannot compile on 4.19 without applying my patch, but with 19.30 it should finish successfully).

    • ~# dpkg -i amdgpu-dkms-firmware_*.deb
      ~# dpkg -i amdgpu-core_*.deb amdgpu-dkms_*.deb

  3. Skip this step if you use version >= 19.30. Do this ONLY if you want to use 19.10 or 19.20 : Apply the patch to the amdgpu source code (please adapt yourself for 19.20)

    • ~# cd /usr/src/amdgpu-19.10-785425
      ~# patch -p1 < 01-amdgpu_19.10_on_linux_4.19-v4.patch

  4. Skip this step if you use version >= 19.30. Do this ONLY if you want to use 19.10 or 19.20 : Reconfigure the amdgpu-dkms package so that it does compile against 4.19

    • ~# dpkg-reconfigure --force amdgpu-dkms

  5. Normally, building & installation should have succeeded

  6. Reboot
  7. Check which version is loaded during boot (for me with amdgpu 20.30 it says "version:")

    • ~# dmesg | grep "amdgpu version"


Additional notes