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.
Kernel driver
Compiling support in the kernel
This is not very hard. Firstly download the required packages. Run the command sudo 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 run sudo 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! 🙂
You’re awesome. I’ve been waiting for this guide for six months. There are a bunch of resources on the Arch Wiki and Gentoo and the like, but nothing specifically for Ubuntu. Thanks a ton for putting it together.
Glad to know someone found it useful. 🙂
>There are a bunch of resources on the Arch Wiki and Gentoo and the like, but nothing specifically for Ubuntu.
That’s what I found to be the case too. You can try out the AMDGPU-PRO driver too if you are using Ubuntu 16.04.
Is this possible to do on Ubuntu 14.04.5? I am using a DELL laptop with SI dedicated GPU and so far I have been unable to use it. And I am forced to stick to 14.
Not easily, without potentially sacrificing the stability of your system. The SI GPU should be working on 14.04.5, albeit the performance/power management may not be as good.
I would recommend you to try out the “LTS Enablement Stack” if you aren’t using that already: https://wiki.ubuntu.com/Kernel/LTSEnablementStack
AMDGPU/AMDGPU-PRO would need you to update to Ubuntu 16.04 or Ubuntu 16.10 to try it out safely.
This #step 1 so screwed my system, x does not load. Any help on restoring back to defaults? online suggestions dont work. Get (EE) Backtrace fault.
I messed up. I put in a wrong PPA accidentally while writing that up. You need to remove the Xorg edgers PPA, which I accidentally put in the commands instead of the Padoka PPA.
Do this:
sudo apt-get install ppa-purge
sudo ppa-purge ppa:xorg-edgers/ppa
Let me know if that works for you. Again I am extremely sorry for messing up. I’ve updated the post.
Worked for my r9 270x with kernel 4.10.0-rc7. I had to use dist-upgrade instead of upgrade.
Do you have any experience using amdgpu with kvm+vfio? I can passthrough my AMD 7870 successfully to a Windows Guest and a Fedora 24 Guest (using standard radeon driver).
I tried multiple distros / kernels, so far no luck. With a fresh 16.04, Padoka PPA and your kernel it boots with no errors and i can see in dmesg, lsmod and xorg.log that amdgpu get’s loaded but in the end Xorg complains:
(EE) No devices detected.
(EE) no screens found.
and i’m stuck in console with blinking cursor. Any ideas how to track down the problem?
It’s quite a coincidence that I was playing around with GPU passthrough these days. I tried passthroughing my card to a Linux guest on ESXI but it just wouldn’t start the radeon kernel driver even though I could see the card in lspci. It worked for Windows. I am yet to try KVM+VFIO.
Amdgpu, especially for GCN 1.0 cards is still very young. I’d recommend you to try a 4.10.x kernel. Make sure you add the Padoka PPA and update too. But I’d say if it works on the radeon kernel driver and you are happy with the performance, there is no need to switch really. There is a reason why it is not enabled by default.
Also try filing a bug here: https://bugzilla.kernel.org/. You may be asked to move it to the Xorg bug tracker. If you can, post it on Phoronix forums as well. There are many people working on the driver that visit there.
Hey, thanks for your quick reply. I finally got it to work with an Arch Linux guest. I also made a dist-upgrade on my Ubuntu host in between and i think qemu was one of the updated packages – i’m still on qemu 2.5 though, same as before – so maybe i was lucky with a bugfix for my specific problem.
Anyways my current setup:
Z77 Mainboard + i5 3570
Ubuntu 16.04 Host with IGD Intel
qemu 2.5 + ovmf + libvirt booting:
Arch Linux 2017.02.01 with vfio’ed AMD 7870 GPU
Arch kernel (currently 4.9.8) has amdgpu CIK/SI support enabled per default and after a standard gnome install xorg starts just fine with the amdgpu driver (don’t forget to blacklist radeon and add amdgpu to initramfs, as described in the Arch Wiki amdgpu article). I’ll probably try to install amdgpu-pro on top of it at some point.
Looks like Arch Linux in general is by far the best option for these kind of things.
So best of luck for your progress. Although i never tried ESXi, i have the feeling that KVM + VFIO will be the better choice in the long run for many reasons.
Excellent! I am on Arch as well now. Still deciding on a GPU(need displayport) for the host. I’ll just passthrough my more powerful R9 280(7950) for the Windows guest and use Windows guest on one monitor and Arch Linux host on the other.
I’m curious on why you are running Linux on a VM with passthrough. Could have just used the guest. BTW there is an excellent application called Synergy to sync keyboard/mouse between systems.
Also can I email you on your provided mail id? I’d really like to know more about how you got it all to work incase I get stuck somewhere. I had tried KVM on Proxmox earlier but it all went awfully wrong after an update which made my system unbootable.
Yea sure, feel free to contact me via email. I’m happy to help.
I compiled the kernel like you said, but couldn’t install it. Could you please help?
user@notebook:~/k$ sudo dpkg -i linux-headers-4.9.13_1.0.amdgpu_amd64.deb
Selecting previously unselected package linux-headers-4.9.13.
(Reading database … 282292 files and directories currently installed.)
Preparing to unpack linux-headers-4.9.13_1.0.amdgpu_amd64.deb …
Unpacking linux-headers-4.9.13 (1.0.amdgpu) …
Setting up linux-headers-4.9.13 (1.0.amdgpu) …
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.13 /boot/vmlinuz-4.9.13
Error! echo
Your kernel headers for kernel 4.9.13 cannot be found at
/lib/modules/4.9.13/build or /lib/modules/4.9.13/source.
That’s quite strange. Not sure why you are hitting the issue. Are you using any DKMS modules? Make sure you have the kernel headers installed for the kernel you are running just in case. Also you can maybe try my precompiled kernel.
I’m extremely sorry for the late reply. Was caught up with work.
It’s ok, thanks anyway. I did resolve it straight way: just created a symlink at /lib/modules/4.9.13/build, taken it from /lib/modules/4.9.13-040913-generic/build. I had also installed a kernel from kernel.ubuntu.com.
But the sad part is, that it didn’t help to get my Radeon HD 8750M any faster. glmark2 shows same 480 score, regardless what kernel I boot. And Vulkan tests were not so smooth also on half resolution and not detailed mode.
There was something interesting, I think you should know about it. As you said, I copied .config from v4.9.13 Kernel, taken from Ubuntu site. And as I run menuconfig and navigated to Device Drivers>Graphics support, I saw, that “amdgpu support for SI parts” was already enabled. For “CIK Parts” was disabled.
Do I understand it right, that support for “Southern Islands” chipset, i.e. for my HD 8750M is already in mainline for kernel 4.9.13 and I don’t need to compile it self?
And yes, I have DKMS modules, if it matters – virtualbox’s modules.
Headers were installed, but from 4.9.13-040913-generic package.
I’d like to note that compilation on Ubuntu with the make-kpkg command fails under kernels > 4.9. This is due to kernel developers removing the “REPORTING-BUGS” file from the source tree. If you want to continue using make-kpkg, copy the file from the 4.9 tree to your kernel source.
thank you very match!!
Thanks for the guide – it got me running amdgpu on kernel 4.9.11 in 16.04.2 earlier.
However, in an update to 4.9.21, things seem to have been broken.
Performance has dropped substantially, and booting 4.9.11 instead doesn’t change anything.
I did get an error about missing firmware for Tonga and Topaz cards when installing 4.9.21 but ignored it as my card is an r9 270x.
Do you have any advice? Thanks
Try upgrading the linux-firmware package by grabbing the package from here: https://launchpad.net/ubuntu/+source/linux-firmware
I would recommend you to try out the 4.10.x series kernel as well.
This website definitely has all the information and facts I needed about this subject and didn’t know who to ask.
Hi Varun,
Thanks for the great guide. I think on Ubuntu 17.04 support for SI and CIK cards is enabled by default in the kernel, so the only step required in 17.04 is to blacklist the radeon module.
Im trying to build the kernel, but i can’t get the headers.deb.
i managed to build and install but after reboot i get black screen with blinking cursor.
any help
Pingback: Amdgpu em Debian turbinado – leia a descrição para mais detalhes | Driver Download Pro Laptop
I’m on a fresh install :
rba-To-be-filled-by-O-E-M 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
And I’ve just blacklisted radeon, is it possible that now AMDGPU is just working properly?
Also my lspci -k | grep -EA3 ‘VGA|3D|Display’ says:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Curacao XT [Radeon R7 370 / R9 270X/370 OEM]
Subsystem: ASUSTeK Computer Inc. Curacao XT [Radeon R7 370 / R9 270X/370 OEM]
Kernel driver in use: amdgpu
Kernel modules: radeon, amdgpu
varun, quick question i see mainline kernel is 4.15 now will this work with this kernel or should i be looking out for just 4.9 as you have described in the example.
Super helpful, thank you very much!
For me it only worked when I also added the following params to GRUB:
Southern Island (GCN 1.0):
amdgpu.si_support=1 radeon.si_support=0
Sea Island (GCN 1.1):
amdgpu.cik_support=1 radeon.cik_support=0
I used mainline 4.16 kernel on ubuntu 17.10 – I think the regular kernel, 4.13.0, already comes with enabled support, so you likely don’t need to compile a new kernel at this time of writing. If you need to, 4.16 does work.
Does this how to is good for ubuntu 18.04?
I think it should be enabled by default. Try running
lsmod | grep amdgpu
to see if the kernel module is loaded or not. You may have to disable the radeon kernel module just to be sure.
Inspiron-7520:~$ lspci -k|egrep ‘VGA|in use’
Kernel driver in use: ivb_uncore
Kernel driver in use: pcieport
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
Kernel driver in use: i915
Kernel driver in use: xhci_hcd
Kernel driver in use: mei_me
Kernel driver in use: ehci-pci
Kernel driver in use: snd_hda_intel
Kernel driver in use: pcieport
Kernel driver in use: pcieport
Kernel driver in use: ehci-pci
Kernel driver in use: lpc_ich
Kernel driver in use: ahci
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Chelsea LP [Radeon HD 7730M] (rev ff)
Kernel driver in use: amdgpu
Kernel driver in use: r8169
Kernel driver in use: ath9k
I was able to activate amdgpu but the performance is the same as intel. Using glxgears and other benchmark its the same or worse.
some say that AMD on 18.04 does not work well
I feel the AMDGPU driver may not be active. Try blacklisting the i915 module.
ozp@ozp-Inspiron-7520:~$ DRI_PRIME=1 glxinfo | grep “OpenGL renderer”
OpenGL renderer string: AMD Radeon HD 7700M Series (CAPE VERDE / DRM 3.23.0 / 4.15.0-32-generic, LLVM 6.0.0)
It looks like the amdgpu is active. I did the benchmark with DRI_PRIME.
Great to hear that. 🙂
Yes, but the AMD performance is the same as intel. With glxgears or other benchmark
Did you try playing a game?
Not yet, I dont know which one to use as a test. Clearly the visuals of AMD are better when I benchmark. But the “results” are the same or even worse than Intel.
There must be something wrong.