Differences between revisions 22 and 23
Revision 22 as of 2019-06-12 06:37:03
Size: 4565
Editor: ?Bastif
Comment:
Revision 23 as of 2019-06-12 16:43:36
Size: 4565
Editor: ?Bastif
Comment:
Deletions are marked like this. Additions are marked like this.
Line 31: Line 31:
   * [[attachment:01-amdgpu_19.10_on_linux_4.19-v2.patch]]    * [[attachment:01-amdgpu_19.10_on_linux_4.19-v4.patch]]
Line 40: Line 40:
   `~# patch -p1 < 01-amdgpu_19.10_on_linux_4.19-v2.patch`    `~# patch -p1 < 01-amdgpu_19.10_on_linux_4.19-v4.patch`

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

My 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.

Although I upgraded to linux 4.19 on stretch, 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 (v19.10) 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.

Steps in brief (detailed procedure below)

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

  3. Apply a patch to the amdgpu-dkms source so that is does compile with linux 4.19 on debian
  4. Reconfigure amdgpu-dkms
  5. Reboot & it's done

Notes:

  • From what I observed, DKMS compiles for the running kernel and for the highest kernel version installed. It is unlikely compilation will work with my patch applied on something else than v4.19, so you should remove the linux-headers-* packages of the other versions installed
  • In case your system freezes at boot with 4.19, add the "nomodeset" kernel parameter at boottime into grub (or by amending /etc/default/grub ). Once in 4.19 you can proceed with DKMS compilation with the steps bellow

What you need/Prerequistes

Procedure

  1. Extract the archive downloaded from AMD

    • ~$ tar -xvJf amdgpu-pro-19.10-785425-ubuntu-18.04.tar.xz

  2. Install only these 2 packages : amdgpu-dkms & amdgpu-core. This will fail at the end because it cannot compile on 4.19 without applying my patch.

    • ~# dpkg -i amdgpu-dkms_19.10-785425_all.deb amdgpu-core_19.10-785425_all.deb

  3. Apply the patch to the amdgpu source code
    • ~# cd /usr/src/amdgpu-19.10-785425
      ~# patch -p1 < 01-amdgpu_19.10_on_linux_4.19-v4.patch

  4. Reconfigure the amdgpu-dkms package so that it does compile against 4.19
    • ~# dpkg-reconfigure amdgpu-dkms

  5. Normally, building & installation should have succeeded

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

    • ~# dmesg | grep "amdgpu version

Additional notes

  • If you are on stretch I strongly suggest you upgrade to the latest mesa, libdrm, libglvnd, wayland packages from stretch-backports. I'm not sure this is actually mandatory, but on my system the packages from these source are in their stretch-backports versions:

    • mesa 18.2.8
    • libdrm 2.4.95
    • libglvnd 1.1.0
    • wayland 1.16.0
  • All this has been done on:
    • Stretch 9.9 with kernel 4.19 & packages described above

    • Buster 10.0 as of 2019-Jun-11
    • With version : amdgpu-pro-19.10-785425 (released by AMD in Apr/2019)
  • amdgpu-dkms provides the firmwares inside the deb package (/usr/src/amdgpu-19.10-785425/firmware/). They will be installed in the /lib/firmware/$(uname -r) directory during its installation. During firmware loading, the kernel will search first in /lib/firmware/$(uname -r) and only then, if not found, in /lib/firmware/ (see kernel code or debian kernel code), so the firmware from amdgpu-dkms has priority over the one provided by debian package firmware-amd-graphics which puts the files in /lib/firmware/.