Differences between revisions 54 and 55
Revision 54 as of 2020-12-06 15:34:24
Size: 9322
Editor: ?Bastif
Comment: small rewording
Revision 55 as of 2021-05-07 17:47:41
Size: 9631
Editor: ?Bastif
Comment: Update with latest versions of driver
Deletions are marked like this. Additions are marked like this.
Line 22: Line 22:
I tested this with the following versions of amdgpu : 19.10-785425, 19.20-812932, 19.30-855429, 19.50-967956, 20.10-1048554, 20.30-1109583, 20.40-1147286, 20.40-1147287, 20.45-1164792 .<<BR>> Some versions need to apply patches to allow compilation on kernel 4.19. Versions to which it applies to are listed bellow. I tested this with the following versions of amdgpu : 19.10-785425, 19.20-812932, 19.30-855429, 19.50-967956, 20.10-1048554, 20.30-1109583, 20.40-1147286, 20.40-1147287, 20.45-1188099, 20.50-1234664, 21.10-1247438 .<<BR>> Some versions need to apply patches to allow compilation on kernel 4.19. Versions to which it applies to are listed bellow.
Line 35: Line 35:
   * (needs manual patching) [[https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-45|Radeon™ Software for Linux® 20.45]] (Release Date: November 18, 2020)    * [[https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-21-10|Radeon™ Software for Linux® 21.10]] (Release Date: April 20, 2021)
Line 37: Line 37:
   * [[https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-50|Radeon™ Software for Linux® 20.50]] (Release Date: March 22, 2021)
   * [[https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-45|Radeon™ Software for Linux® 20.45]] (Release Date: November 18, 2020)
Line 49: Line 51:
  * for driver version 20.40 & 20.45 : [[attachment:01-amdgpu_20.40_on_linux_4.19-v3.patch]]   * for driver version 20.40 : [[attachment:01-amdgpu_20.40_on_linux_4.19-v3.patch]]

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.

I tested this with the following versions of amdgpu : 19.10-785425, 19.20-812932, 19.30-855429, 19.50-967956, 20.10-1048554, 20.30-1109583, 20.40-1147286, 20.40-1147287, 20.45-1188099, 20.50-1234664, 21.10-1247438 .
Some versions need to apply patches to allow compilation on kernel 4.19. Versions to which it applies to are listed bellow.

Steps in brief (detailed procedure below)

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

  3. If the version you plan to use needs patching you will have :
    1. to apply a patch to the amdgpu-dkms source so that it does compile with linux 4.19 on debian.
    2. Reconfigure amdgpu-dkms
  4. Reboot & it's done

What you need/Prerequisites

Procedure

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

  1. Extract the archive downloaded from AMD

    • ~$ tar -xvf amdgpu-pro-20.40-1147287-ubuntu-18.04.tar.xz
      ~# cd amdgpu-pro-20.40-1147287-ubuntu-18.04

  2. Install these packages : amdgpu-dkms-firmware (since v20.10), amdgpu-dkms & amdgpu-core.

    • ~# dpkg -i amdgpu-dkms-firmware_*.deb
      ~# dpkg -i amdgpu-core_*.deb amdgpu-dkms_*.deb
      Please note compilation of amdgpu-dkms will fail if the version needs patching. This is expected at this stage. Proceed with next step to apply the patch and achieve compilation & installation.

  3. Skip this step if the version doesn't need patching :
    Apply the patch to the amdgpu source code (please adapt yourself for your version)

    • ~# cd /usr/src/amdgpu-5.6.14.224-1147287/
      ~# patch -p1 < 01-amdgpu_20.40_on_linux_4.19-v3.patch

  4. Skip this step if the version doesn't need patching :
    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.40 it says "version: 5.6.14.20.40")

    • ~# dmesg | grep "amdgpu version"

Notes:

  • From what I observed, DKMS compiles for both 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. This used to be true for v19.10, but may not be true anymore with 19.30. I didn't give it a try with 19.30.
  • amdgpu v19.50 compilation fails towards kernel 5.3 & 5.4 (I didn't try with 5.0, 5.1 & 5.2). You can add this line to /usr/src/amdgpu-19.50-967956/dkms.conf to skip compilation for that version : BUILD_EXCLUSIVE_KERNEL="^(4\.|5\.[0-2])"

  • 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

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


CategoryProposedDeletion

  • Recommends installing upstream proprietary packages compiled for Ubuntu
    • These are the DKMS packages containing the source of amdgpu driver which is then compiled toward the current kernel installed on debian.
  • Instructs user to patch files provided by packages
    • Fixed: No more patching is needed with 19.30, but I kept them anyway in case someone needs the older version
  • Page title does not follow wiki convention
    • Fixed