These instructions apply only for GCN 1.0/Southern Island cards and GCN 1.1/Sea Islands cards. You can check if your card falls in this categories here.
The AMDGPU driver is a newer driver for GNU/Linux and promises better performance and Vulkan support. You will need to do two steps to make it work.
- Userspace drivers – You need to get the latest Mesa and Xorg. You can do this by adding in the Padoka PPA, which contains the same. It is generally tested and then snapshotted so there are lesser chances of breakages. Also it is built on LLVM’s 4.0 branch, which offers faster shader compilation. For this just do sudo add-apt-repository ppa:paulo-miguel-dias/mesa -y, update the repositories with sudo apt-get update and install the needed package and update the packages with sudo apt-get install -y xserver-xorg-video-amdgpu && sudo apt-get -y upgrade. That’s it! Support for RADV Vulkan driver is enabled as well in this PPA.
- Kernel driver – You will need to compile support in for the AMDGPU driver for your card. For cards pre GCN 1.2 it is disabled by default at the time of writing this article. Experimental support for Southern Islands is only included post the 4.9.x series. You will also have to blacklist support for the default radeon driver.
Also make sure you are running Ubuntu 16.04 or Ubuntu 16.10.
Compiling support in the kernel
This is not very hard. Firstly download the required packages. Run the commandsudo apt-get install -y git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc && sudo apt-get --no-install-recommends install -y kernel-package. Grab the latest mainline kernel from kernel.org. And then extract with cd Downloads && tar xvf linux-4.9.tar.xz command. Replace linux-4.9.tar.xz with the downloaded file. You can also verify if the download with PGP with instructions listed here. We’ll use the running kernel’s config as a base to compile the kernel with AMDGPU support. Run cd linux-4.9 && cp /boot/config-$(uname -r) .config. Then run make menuconfig to change the config. Navigate to Device Drivers>Graphics support and press space to select Enable amdgpu support for SI/CIK parts.
Clean the source tree and reset kernel parameters with make-kpkg clean and then run fakeroot make-kpkg --initrd --revision=1.0.amdgpu kernel_image kernel_headers -j 9. Replace -j 9 with -j (no. of CPU cores + 1). After compilation is done, install with cd .. && sudo dpkg -i linux-headers-4.9.0_1.0.amdgpu_amd64.deb && sudo dpkg -i linux-image-4.9.0_1.0.amdgpu_amd64.deb. File names could be different. Replace appropriately.
If you are interested you can grab my build here. Support for SI and CIK cards is enabled.
Blacklisting radeon module
We will have to blacklist radeon kernel module to make sure AMDGPU kernel is selected. Do sudo nano /etc/default/grub to edit the bootloader config and add in modprobe.blacklist=radeon next to GRUB_CMDLINE_LINUX_DEFAULT line so that it looks like this GRUB_CMDLINE_LINUX_DEFAULT="quiet splash modprobe.blacklist=radeon". Then runsudo update-grub2 to update the bootloader entries. Now reboot!
lsmod | grep radeon shouldn’t show up any entries, while lsmod | grep amdgpu should show something like this.
amdgpu 1464838 11
i2c_algo_bit 6043 1 amdgpu
ttm 86686 1 amdgpu
drm_kms_helper 144788 1 amdgpu
drm 333536 9 amdgpu,ttm,drm_kms_helper
i2c_core 51875 5 i2c_piix4,i2c_algo_bit,amdgpu,drm_kms_helper,drm
You can run vulkaninfo command to verify that Vulkan is enabled as well.
Unity has some Vulkan demos that should work fine with the RADV Vulkan driver. They are experimental and so is RADV so YMMV. You can get them from a Google Plus post here. I couldn’t get them to work without crashing.
If I get some spare time I may set up a PPA and a script to build fresh kernels and auto upload to that. No promises tho! 🙂