Fixing issue: “amdgpu kernel module failed to build”

Tomas Savenas
2 min readDec 3, 2020

Recently, I have faced the issue on Ubuntu 20.04 when installing AMD Pro drivers. I have got the message: “amdgpu kernel module failed to build”. Turn out the latest kernel version 5.4.0–56-generic has issues with GPU drivers. By far, there’s no solution but to get one iteration below (5.4.0–54-generic). I tested, and it’s working fine. [1]

DuplicateSignature: dkms:amdgpu-dkms-firmware:1:5.6.5.24-1109583:/var/lib/dkms/amdgpu/5.6.5.24-1109583/build/amd/amdgpu/amdgpu_bios.c:200:9: error: implicit declaration of function ‘pci_platform_rom’ [-Werror=implicit-function-declaration]
Package: amdgpu-dkms-firmware 1:5.6.5.24-1109583
PackageVersion: 1:5.6.5.24-1109583
SourcePackage: amdgpu-dkms
Title: amdgpu-dkms-firmware 1:5.6.5.24-1109583: amdgpu kernel module failed to build

Before need to check the Kernel version

uname -r

Before continuing, check if you have it. You might find in the boot directory or

ls /boot

or

dpkg -l | grep linux- | grep 5.4.0-54

Installation

sudo apt install -y linux-image-5.4.0-54-generic
sudo apt install -y linux-headers-5.4.0-54
sudo apt install -y linux-headers-5.4.0-54-generic
sudo apt install -y linux-modules-extra-5.4.0-54-generic

Need to do it not remotely, login to the terminal, and reboot with command. You see a boot option chose an advanced boot, and you.

Press ESC and navigate to advanced boot options. You will get a couple or more options. Certainly below, there is an old example but look for the 5.4.0–54-generic version.

Is everything okay, you have a normal boot and internet. You need to remove an old version of Kernel and update the grub.

sudo apt remove -y linux-headers-5.4.0-56-generic linux-image-5.4.0-56-generic 
sudo apt remove -y linux-image-unsigned-5.4.0-56-generic
sudo apt remove -y linux-headers-5.4.0-56
sudo apt remove -y linux-modules-5.4.0-56-generic

check if you’ve removed everything

ls /boot

The last command.

sudo update-grub && sudo reboot

After this, you can install AMD drivers [2]

Reference

#1 https://community.amd.com/t5/drivers-software/can-t-install-amdgpu-drivers-on-ubuntu-20-04-1-5-4-0-56-generic/m-p/427234
#2 https://tomas-savenas.medium.com/installing-nvidia-and-amd-gpu-driver-on-linux-server-4f1f1d4360d

--

--

Tomas Savenas

Kibernetinio saugumo entuziastas; Aktyviausias Lietuvis TryHackMe platformoje; Inovacijų valdymo ir Antreprenerystės Magistrantas @ KTU