Drivers – How to Fix AMD GPU-dkms Not Building in Kernel 5.8/5.8-xanmod

20.04amdgpudkmsdriverskernel

I recently bought the ASUS TUF Gaming FA506IH with Ryzen 5 4600H and dedicated NVIDIA gtx 1650Ti. I am not much of a gamer so I installed Ubuntu 20.04 and thought of not using Nvidia drivers (because of compatibility issue with newer kernels) until I needed it, and just go with the integrated Radeon graphics. However, I noticed that newer gen Radeon graphics are not supported in 5.4 kernel so I installed mainline 5.8 kernel and after installing the amdgpu drivers, it seems to work fine, but I am getting an error with dkms saying it is not supported in kernel 5.8. I also tried xanmod kernel 5.8, but still the same issue. This is the error message that I get when amdgpu tries to build its package on this kernel.

Setting up amdgpu-dkms (1:5.6.0.15-1098277) ...
Removing old amdgpu-5.6.0.15-1098277 DKMS files...

------------------------------
Deleting module version: 5.6.0.15-1098277
completely from the DKMS tree.
------------------------------
Done.
Loading new amdgpu-5.6.0.15-1098277 DKMS files...
Building for 5.8.16-xanmod1
Building for architecture x86_64
Building initial module for 5.8.16-xanmod1
ERROR (dkms apport): kernel package linux-headers-5.8.16-xanmod1 is not supported
Error! Bad return status for module build on kernel: 5.8.16-xanmod1 (x86_64)
Consult /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/make.log for more information.
dpkg: error processing package amdgpu-dkms (--configure):
 installed amdgpu-dkms package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of amdgpu:
 amdgpu depends on amdgpu-dkms (= 1:5.6.0.15-1098277); however:
  Package amdgpu-dkms is not configured yet.

dpkg: error processing package amdgpu (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.

Errors were encountered while processing:
 amdgpu-dkms
 amdgpu
E: Sub-process /usr/bin/dpkg returned an error code (1)

I get the same error when I try installing amdgpu on kernel 5.8.*-generic.

Best Answer

While searching more about this topic. I came to know that you don't really need to install any proprietary drivers for the newer gen AMD Renoir graphics to work on any kernel >= 5.7, because the support already comes out-of-the-box. So I just uninstalled amdgpu using amdgpu-uninstall and everything works fine now.


As suggested by @red_trumpet in the comments section, you can also install the driver without dkms with the command ./amdgpu-install --no-dkms. You can also specify an opencl installation using ./amdgpu-install --opencl=pal,legacy --no-dkms. I've tested this, and have been using this for two months now.

NOTE: This does not work with the pro version of the driver.

Related Question