AMDGPU-Pro 17.50 Drivers, the Vega 64 and (K)Ubuntu 16.04.3 - Black screen fix

Submitted by Silvershock on Fri, 12/29/2017 - 15:13

So a friend of mine (who is insane) lent me an AMD Vega 64. If you don't know what that is, it's a beast. Anyway, I had to get it running properly in my Linux spin of choice, Kubuntu 16.04. Prior to this card, I was running the 17.20 release of the new AMDGPU-Pro driver stack, which was lovely and stable and fast for me. Unfortunately, there are two issues using this with the Vega:

  1. Official support for the Vega didn't appear until 17.30 (current drivers at time of writing are 17.50)
  2. The 16.04.3 release of Ubuntu and its variants introduced some issues with the AMD stack that were not really resolved until 17.40

Sure enough, while the Vega seemed surprisingly happy at first running on 17.20, I started seeing glitches. The most game-breaking of these came when my desktop idled out and auto-locked the screen. Any attempt to log back in from the lock screen failed instantly, and I had to restart the machine. Obviously this was not acceptable, so I downloaded the 17.50 drivers and installed them.

Black screen. Shit.

The same happened with the 17.40 drivers; more black, more swearing. After several hours of trial and error, I have landed on a configuration that works, and is surprisingly easy to put together. Simply put, you need a newer kernel.

Because Ubuntu's Long-Term Support releases stay around for five years at a time, some of their core software can get a little old in the tooth. For fresh installations this is less of an issue - slap the new kernel in and live with it. For existing installations, Canonical really don't want to break things, so they don't upgrade you as fast. If you want to fast-forward your system to a much newer kernel, they provide the Hardware Enablement Stack. This is basically a backport of what newer releases of the OS are running. It's properly supported (see the link above for more details) and easy to install, so let's do exactly that!

Step 1: Prep the AMDGPU-Pro Drivers

Grab the latest available build of the AMDGPU-Pro drivers from AMD's website. At the time of writing, 17.50 is the latest, and is available here:
http://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-Release-Notes.aspx

Download the *.tar.gz file and extract it somewhere easily accessible. You'll end up with a subfolder full of Debian-format packages, and a script to install them. Leave those where they are for now, we'll use them later.

Step 2: Uninstall your current drivers

Depending on which drivers you're currently using, this may be an exercise for the reader. However, if you're using AMDGPU-Pro, AMD has made this extremely easy by dropping the uninstall command into your PATH variable. Simply open a kernel and type:

sudo amdgpu-pro-uninstall

The drivers will uninstall themselves. It's usually very quick and neat. Once you're done, reboot:

sudo reboot

Step 3: Upgrade your kernel

If things progress for you as they did for me, there is now a black screen where your login screen should be. Don't panic. Hit CTRL+ALT+F2 on your keyboard to drop to a terminal, and log in there. Once you're in, and you've read the Ubuntu article on potential consequences of using the Enablement Stack, type the following to upgrade to kernel 4.10.x:

sudo apt-get install --install-recommends linux-generic-hwe-16.04 xserver-xorg-hwe-16.04

After a fair amount of chugging, the new kernel should be installed. Reboot again.

Step 4: Install the AMDGPU-Pro 17.50 Drivers

Again, YMMV, but if things are progressing for you as they did for me, you should now have....another black screen! This one might even have a blinking cursor, lucky you. CTRL+ALT+F2 back to a terminal again, and head to the folder where you extracted the 17.50 drivers. Once you're there, type the following if you're using a Vega:

./amdgpu-pro-install -y --opencl=rocm

And use this if you're on a card pre-Vega:

./amdgpu-pro-install -y --opencl=legacy

The drivers should now automatically set themselves up without intervention from you. When they're done, one last reboot and you should see your login screen, shiny and new. That's it! Told you it was easy. With this one change to my OS, my Vega seems to be stable and happy.

Really glad to get this working. The performance of AMD cards in Linux has been coming on in leaps and bounds ever since they burned their dreadful old driver stack to the ground and rebuilt them as AMDGPU, and it's looking like a future where I can finally bottle Windows up into an accelerated virtual machine where it belongs, instead of dual booting. That will be a fine day indeed.