Setting up your AMD video card in Ubuntu 20.04

Ubuntu 20.04 just arrived with fractional scaling of the desktop available from the settings. Yes, you have to turn it on first to be able to choose fractional scaling of 125% or 150%, but finally you don’t have to edit gnome settings to do this. Also, this time it might work as intended too…


I have an ASUS Radeon R9 390X STRIX OC 8GB GDDR5 (STRIX-R9390X-DC3OC-8GD5-GAMING) video card which is getting quite old in 2020 but still is quite perfect for my huge gaming backlog. I’ll probably stick with it for a few more years.

I also have a LG 32UK550 4K UHD VA FreeSync HDR LED Monitor and do want to enjoy the extra crisp resolution. Unfortunately my eyes are getting a bit old, so using Windows or Linux in native 4K resolution is out of the question.

The sensible thing to do is to turn desktop scaling to 125% or 150% to stay on the native resolution and still enjoy crisp and appropriately sized text. This works out of the box on Windows 10, but was always problematic on Linux.

I tried a bunch of Ubuntu versions and even other distributions, but when desktop scaling was even available, I always had some flickering text when typing something as if the window manager tried to redraw the windows after each keystroke. This rendered the user experience totally unacceptable, so after weeks of experimenting I had to settle to using the 4K monitor on 1440p resolution. This way there was no flickering, the content was sized okayish, but the image was just not as crisp as on native 4K.

Fast forward about 7 months and Ubuntu 20.04 arrives. After a quick reinstall, I sadly had to conclude that the flickering text problem still persists. Also, the official AMD drivers are not yet available, so I’m stuck with the open source radeon driver shipped with the distro, which tends to freeze my computer when watching youtube videos. Another thing is that using the monitor in 1440p seems to be a bit more blurry than with Ubuntu 18.04 with the amdgpu-pro drivers.

Don’t worry, we are coming to a happy ending soon 🙂

So, after some digging I found the solution to make everything work. At the moment 125% desktop scaling seems to work perfectly without flickering and youtube didn’t froze my computer either.

Step one: Use the official amdgpu driver from a third-party PPA repository

I found out in this article that you can use the official drivers by adding a PPA with the following commands:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt update && sudo apt -y upgrade

If you ever need to get rid of it, use these commands:

sudo apt install ppa-purge
sudo ppa-purge ppa:oibaf/graphics-drivers

Go ahead, reboot your computer. Issue the following command to see if the driver is active:

lshw -c video

Look for the keyword “driver=”. If you see “amdgpu” there, your are ready, no need to continue with this article. However if you see “radeon” there, you are still on the open source driver and need to take a few more steps.

Step two: Blacklist the radeon module

To tell the truth, I’m not sure if this step is really necessary, so if you succeed with only step one and three, please tell me in a comment, so I can update the article.

If you run the following command…

lspci -k | grep -EA3 'VGA|3D|Display'

… you’ll see that you have two kernel modules available: radeon and amdgpu.

To disable radeon, you have to edit /etc/modprobe.d/blacklist.conf:

sudo mcedit /etc/default/grub

…and add the following line at the end:

 blacklist radeon

Now update grup by issuing the following command:

sudo update-initramfs -u

Be aware that if you reboot now, you might end up in a very low desktop resolution.

Step three: modeset magic

We have to add a few parameters to Grub to make the amdgpu driver work. The commands are straight from my previous article.

Edit the /etc/default/grub file:

sudo mcedit /etc/default/grub

Add these lines:

GRUB_GFXMODE=1920x1080x32
GRUB_CMDLINE_LINUX_DEFAULT="radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1 amdgpu.dpm=1 amdgpu.modeset=1"

Run these commands to modify grub and reboot:

sudo update-grub2 && sudo update-initramfs -u -k all<br>
sudo reboot


Update:

Unfortunately desktop scaling support still seems to be incomplete. I ran into the following problems and none of the solutions that Google spat out worked:

  • Gimp doesn’t scale, so the interface is tiny with microscopic icons. Images being edited in 100% zoom are shown without desktop scaling, so no serious editing can be done as the exported image is larger.
  • Spotify doesn’t scale, so the interface is tiny. It works but is really hard to see in native 4K resolution.
  • The mouse cursor from the loging screen gets stuck and is visible as a second, smaller mouse cursor on the desktop.
  • Performance gets a huge hit, the system just doesn’t seem to be snappy at all.

I tried using the system as it is for a few days, but had to go back to 1440p resolution to have a stable and usable system. The image is not as sharp, but at least everything works as it should.

All in all, I should have bought a monitor with native 1440p resolution, but back then I had no idea about the possible problems I ran into. No matter, this is quite usable now and maybe Ubuntu 20.10 will finally provide full desktop scaling support.