Linux 5.9 Brings Hardware Accelerated Video Playback To 10+ Year Old AMD Graphics Cards Using The "amdgpu" Linux Kernel Driver

From LinuxReviews
Jump to navigationJump to search
Amdlogo.png

AMD kicked off their HD 7000 series graphics cards with the launch of the Radeon HD 7970 code-named "Tahiti" in December 2011. Linux users are finally able to get working Hardware Video Decoding and Vulkan support on these and other older AMD graphics cards using the Linux kernel's "amdgpu" driver.

written by 윤채경 (Yoon Chae-kyung). published 2020-09-10last edited 2020-09-14

Radeon-7850-vaapi.jpg
The mpv video player playing a video with SNSD performing "Time Machine" on stage. Playback is done using hardware accelerated video decoding on a Radeon 7850 GPU powered by the "amdgpu" kernel driver. The desktop environment is something called Xfce 4.14 and the GNU/Linux distribution is an upcoming IBM product called "Fedora 33".'

The Linux graphics driver for AMD graphics cards was named radeon when the Radeon HD 7000 series graphics cards were launched back in 2011. That driver worked alright at the time and basic things like OpenGL backed by the Mesa graphics stack, video accelerated playback and HDMI audio worked fine on early "Graphics Core Next" (GCN) based cards.

Vulkan-1.2.png
Those with 10 year old AMD graphics cards can finally use Vulkan and hardware accelerated video decoding.

AMD started developing a shiny new revolutionary Linux driver called amdgpu around the time their third generation GCN "Volcanic Island" cards were launched. AMD stuck the amdgpu driver and sort of forgot about the radeon driver. That left those with first and second-generation GCN cards in the cold as second-class citizens.

Using the radeon driver on older AMD graphics cards and APUs was fine for many years, and those with older cards did not miss out on much until the advent of the Vulkan graphics API. The Mesa RADV Vulkan driver can only be used with the amdgpu graphics driver.

amdgpu did get some support for older cards a few years back but there were some glaring problems with using that driver:

  • HDMI audio didn't work on most cards.
  • Hardware accelerated video encoding and decoding was unsupported.

That meant that those with old AMD graphics cards had to choose between Vulkan OR hardware accelerated video decoding. You could not have both features.

That situation will finally be rectified when Linux 5.9 is released. AMD developer Alex Jivin took it upon himself to port UVD and VCE power managment, UVD clock control and VCE clock control for Southern Island graphics cards from the radeon driver to the amdgpu driver this summer and the code was sneaked in during the Linux 5.9 merge window. AMD has also provided new amdgpu firmware for these cards.

Linux 5.9 finally allows those with very old AMD graphics cards to use Vulkan and have working hardware accelerated video encoding and decoding.

Vkmark on radeon 7850.jpg
vulkaninfo and the vkmark Vulkan benchmark running on a AMD Radeon HD 7850 GPU using the amdgpu module on kernel 5.9 rc4.

amdgpu is still not the default driver for older AMD graphics cards. Using a kernel parameter is still required. You will need to use one of the following kernel parameters to choose it:

Ancient AMD tech Kernel options enabling the amdgpu driver
Southern Islands cards
HD7750-HD7970, HD8550M-HD8790M

R9 270, R7 240, R7 250, R9-280, R9 370X

radeon.si_support=0 amdgpu.si_support=1
Sea Islands

HD7790, HD8180-HD8400
R7 260, R9 290
AMD E1-6010, Athlon 5350, ++

radeon.cik_support=0 amdgpu.cik_support=1

Kernel parameters can be added to GRUB_CMDLINE_LINUX= in /etc/sysconfig/grub (assuming you are using the GRUB bootloader).

AMD HD7850 GPU.20200108.jpg
The around ten years old AMD Radeon HD 7850 technology can now be used for Vulkan and hardware accellerated video decoding on Linux using the amdgpu driver.

We have tested the shiny new amdgpu support for a decade old graphics cards in Linux 5.9 using Linux 5.9 rc4 and a AMD Radeon 7850 with 2 GiB RAM. This particular first-generation GCN card finally works as it should have when it was launched in March 2012. HDMI audio output works, Vulkan works and VAAPI accelerated hardware video decoding works. They've even made suspend to RAM work. Suspend to disk, on the other hand, is utterly broken. Perhaps they forgot about that one. Still, the current situation is better than it was when we wrote our "The Current State Of Older AMD Graphics Hardware On Linux: What Driver To Use And What To Expect" article earlier this year.

Radeon-7850-amdgpu-after-suspend-to-disk.jpg
The kernel ring buffer (dmesg) on a machine with a Radeon HD 7850 GPU running Linux 5.9 rc4 after resuming from hibernation. The screenshot was taken by ssh-ing in from another machine since there's no hope of getting anything on the attached monitor at that point.

OpenCL compute using the Radeon Open Compute framework is of course not supported on any of the older first and second generation GCN cards. AMD didn't write a huge graphics compute framework just so hobbyists can have OpenCL acceleration in LibreOffice. You can use Radeon Open Compute for that purpose on most RX 400-series cards and newer but you can forget about it if your card is older than that.

The newfound support for hardware video decoding on older AMD graphics cards is probably a big part of the reason why some AMD fanboys call AMD graphics cards "fine wine": It may take a decade but you'll eventually get most of the feature-set you should have gotten right away when you bought the card. AMD has added support for their upcoming "Sienna Cichlid" and "Navy Flounder" graphics chips to Linux 5.9 so we can only hope those who buy these upcoming AMD cards based on an entirely new architecture (they are not NAVI-based, amdgpu/sdma_v5_2.c clearly shows it's a new display core) will get them mostly working quicker than those who bought first-generation GCN cards did.

5.00
(one vote)

avatar

Anonymous user #1

19 days ago
Score 1++
It'd be nice to be able to get ROCm working on my R9 390 (which is a renamed R9 290). It's apparently doable, but I do wonder how much is missing from the firmware blob to enable it properly.
avatar

Anonymous user #2

18 days ago
Score 1++
AFAIK the ROCm stack should work on your 290/390 today. We added support a few years ago since Hawaii was the fastest FP64 part available. Since then Vega20 has taken over as the primary FP64 workhorse and so testing focus has shifted as well, but I don't believe we have disabled or removed Hawaii support.
avatar

Anonymous user #3

18 days ago
Score 0++
snsd and time machine, bring back memories.
avatar

Anonymous user #4

12 days ago
Score 0++
I sure am glad I never bought an AMD GPU. I've had OpenGL and VDPAU on Nvidia GT520 1GB 30W card on Phenom 9550 for 9 years. AMD did good with Phenom 9550/RX770 though, still going strong after 12 years but upgrading to 10Gbit enet meant replacing GT520x16 with GT710x1 so I could use the PCIe Gen2 x16 slot for the 10Gbit x4. It gets about 7.5 Gbit/s BUT that's still faster than SATA Gen2&3. Phenom 9550/RX770 is finally near the end of the line. No more bandwidth. Same PCIe Gen2 10Gbit x4 in B350/450 gets full 10Gbit. BTW, GT710x1 has working OpenGL and VDPAU too. AMD needs to hire more Linux programmers if they ever hope to catch up to OLD Nvidia cards. AMD GPU Linux neglect is scandalous and they should be ashamed of themselves. It sounds like AMD is trying to compete now BUT having to wait 10 years for OpenGL + VAAPI is ridiculous. Kudos for amdgpu being fully open source, well sort of at least. Those firmware blobs aren't open source.
avatar

Anonymous user #4

12 days ago
Score 0++
Is Ryzen 4000+Vega going to use Zen3 for the CPU, or is it going to be Zen2+NewVega? I hope it doesn't take 10 years for AMD to get OpenGL + VAAPI working on Ryzen+Vega. I'm old. I'll be dead by then. Hurry up AMD.
Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.