The Best Linux Vulkan Driver For AMD GPUs: Mesa RADV vs AMDVLK

From LinuxReviews
Jump to navigationJump to search
Vulkan-logo.png

There are two Vulkan drivers for AMD graphics cards available: The RADV driver that comes with Mesa and the AMDVLK driver from AMD. Here is a test of the latest AMDVLK 2021.Q2.1 driver against the latest Mesa 21.0.3 RADV driver in some graphical and compute applications.

written by 윤채경 (Yoon Chae-kyung)  2021-04-17 - last edited 2021-04-20. © CC BY

Asahi by Futuris 10.jpg
The Asahi scene demo rendered in Wine with RADV.

All the GNU/Linux distributions come with the Mesa RADV Vulkan driver for AMD graphics cards as part of the standard Mesa graphics stack. There is another alternative, a special Vulkan driver from AMD called AMDVLK. It has to be acquired and installed separately.

Both drivers will mostly provide the same performance with Vulkan compute as a notable exception. Which you should use is therefore mostly a question of what driver works best with the game(s) you would like to play. Both AMDVLK and RADV work fine with most games, but there are some that work better with AMDVLK or vice versa. It is, luckily, quite easy to have both drivers installed and choose what game or application uses what driver.

Graphics Performance[edit]

Graphics performance is, as you will see from the numbers, nearly equal. The RADV driver is generally about 2% faster. There are a few special exceptions where AMDVLK performance drops like a rock, but those aren't common.

Basemark GPU[edit]

Basemark GPU 1.2.1 Vulkan at 1080p Medium using RADV Mesa 20.2rc4.jpg

Basemark GPU, out of Finland, fails to run through the "official test" with default settings with the AMDVLK driver. The amdgpu kernel module will spew out some errors and then the X server will crash. It used to fail with the Mesa RADV driver too, but that has not been the case in quite some time. The AMDVLK page proposes using this to fix issues with libdrm versions earlier than 2.4.92:

File: $HOME/.config/amdPalSettings.cfg
MaxNumCmdStreamsPerSubmit,4
CommandBufferCombineDePreambles,1

We tried those settings even though our libdrm version is newer. It did not help, and the default official Basemark GPU test still fails with AMDVLK on our GPU.

Basemark 1.2.1 "Official" test
MSI RX 470 8 GiB

Going down to "Medium" content quality makes the official test run fine with both drivers.

Basemark 1.2.1 "Official" test, Medium Quality
MSI RX 470 8 GiB

The latest Mesa RADV driver scores higher, but the margin it wins by is barely outside of run to run variation. There really isn't much of a difference between the two in the Basemark benchmark beyond the fact that AMDVLK can't run it unless you reduce the settings.

MSI Kombustor (Wine)[edit]

MSI Kombustor v4.1.6.0 On Linux Using Wine.jpg
A MSI logo rendered by MSI Kombustor 4.1.6.0, running in Wine, using Vulkan.

MSI Kombustor is a GPU stress-test program for Windows with several built-in benchmarks. It runs fine in Wine. You do not need the latest Wine version, it has worked fine in Wine for years. It uses Vulkan directly, the benchmarks do not go through any DirectX to Vulkan translation layer like a DirectX graphics benchmark would do.

The results are mostly equal except for the TessMark benchmarks. The AMDVLK score is Blond-anime-girl-with-red-questionmark.png far below where it should be in that benchmark.

MSI Kombustor 4.1.7.0, Wine 6.6, FurMark-Donut, Wine
MSI RX 470 8 GiB
MSI Kombustor 4.1.7.0, Wine 6.6, FurMark-MSI, Wine
MSI RX 470 8 GiB
MSI Kombustor 4.1.7.0, Wine 6.6, Phong-Donut,, Wine
MSI RX 470 8 GiB
MSI Kombustor 4.1.7.0, Wine 6.6, TessMark-X32, Wine
MSI RX 470 8 GiB
MSI Kombustor 4.1.7.0, Wine 6.6, TessMark-X16, Wine
MSI RX 470 8 GiB

The odd difference between RADV and AMDVLK in the TessMark tests have been like that since the first time we tried benchmarking the two using that test years ago. Do note that we are not aware of any real games exhibiting such a gigantic performance difference. You may encounter it, bit isn't not likely. The numbers are quite equal in the other tests. The Mesa RADV driver is faster by a few percent, but there isn't any huge and notable difference between the two.

vkmark[edit]

vkmark is a really simple Linux-native Vulkan benchmark. It doesn't use any particularly advanced Vulkan features, but it does produce a result.

vkmark -s 1920x1050 (higher is better)
MSI RX 470 8 GiB

RADV wins the vkmark benchmark by a margin that is so small it is barely measurable.

Vulkan Compute[edit]

Blond-anime-girl-with-red-questionmark.png

Vulkan Compute is an area where AMDVLK is noticeably slower than the Mesa RADV Vulkan driver. There is, as you will see from the numbers, a huge difference. Which driver you use doesn't matter all that much in graphical applications, they both perform similarly. Compute really is a very different story.

waifu2x and RealSR are both popular image up-scaling programs. waifu2x is most suitable for anime pictures, RealSR is suitable for all kinds of pictures. waifu2x will always up-scale 2x, RealSR will always up-scale 4x. These are not theoretical workloads, these benchmarks measure how long it takes to up-scale real images using Vulkan compute. We have verified that the resulting images are identical, none of the Vulkan drivers cheat in any way (unlike what we see in the LuxMark OpenCL benchmark with Mesa Clover prior to Mesa 21 and AMD ROCm, the image Clover from Mesa <=20.3.x produces isn't correct or valid).

waifu2x[edit]

waifu2x-ncnn-vulkan, 100 anime girls with questionmarks, in seconds
MSI RX 470 8 GiB

RealSR[edit]

realsr-ncnn-vulkan, 20 anime girls with questionmarks, in seconds
MSI RX 470 8 GiB

It is very apparent that RADV offers much, much better performance than AMDVLK when it comes to Vulkan compute and that is specially true in the RealSR image up-scaling test. It is interesting to note that AMDVLK appears to be getting slightly slower, not faster, with each new release.

libplacebo[edit]

Libplacebo is a multimedia rendering library taken from the mpv movie player core. Each test consists of a variety of tasks done using Vulkan GPU compute.

libplacebo, deband_heavy, FPS (higher is better)
MSI RX 470 8 GiB
libplacebo, polar_nocompute, FPS (higher is better)
MSI RX 470 8 GiB
libplacebo, hdr_peakdetect, FPS (higher is better)
MSI RX 470 8 GiB


libplacebo, av1_grain_lap, FPS (higher is better)
MSI RX 470 8 GiB

Wine Compatibility[edit]

Windows software using Vulkan directly works equally fine with RADV and AMDVLK with the TessMark MSI Kombustor tests being a notable exception.

That is not the case with DirectX 11 games in Wine with DXVK translating DX11 to Vulkan. Absolutely nothing using DX11 works with AMDVLK. Windows software using DirectX 9 seems to work fine with AMDVLK.

You should probably avoid AMDVLK if you use Windows DirectX software in Wine regularly.

In Conclusion[edit]

AMDVLK performs slightly worse in graphical applications and much worse in compute applications. There's little reason to bother with the AMD AMDVLK driver unless there is some game or application that doesn't work as it should with the Mesa RADV driver. There may be specific Vulkan games where it works better.

Choosing The Currently Active Vulkan Driver[edit]

Note: AMDVLK lacks support for certain APUs like the Athlon 5350. You may not be able to use it if you have an older AMD APU. RADV does work with those.

AMDVLK v-2021.Q2.1 comes with something AMD calls "AMD switchable graphics layer" in the form of a implicit layer library and configuration file in /etc/vulkan/implicit_layer.d/amd_icd64.json.

This lets you choose what Vulkan driver to use by setting AMD_VULKAN_ICD to AMDVLK or RADV if you choose to install the AMDVLK driver side-by-side with the Mesa RADV Vulkan driver.

Mesa RADV AMD_VULKAN_ICD="RADV"
AMD AMDVLK AMD_VULKAN_ICD="AMDVLK"

AMDVLK will be the default if AMD_VULKAN_ICD is unset.

A simple trick is to add env AMD_VULKAN_ICD="RADV" to the Exec line in a games .desktop file (files in /usr/share/applications/ and $HOME/.local/share/applications desktop environments use to provide menu items).

Using that "switchable graphics" thing makes only one Vulkan driver show up in the games and applications that let you choose within the game or application, and that would be most of them. Wine and a few other things are exceptions, the first (0) Vulkan device is used if multiple are installed. You can simply mv /etc/vulkan/implicit_layer.d/amd_icd64.json /etc/vulkan/implicit_layer.d/amd_icd64.nope to disable the AMD switchable graphics temporarily or permanently.

On a similar note, you may want to rm /usr/share/vulkan/icd.d/lvp_icd.*.json if you never ever want to use the Mesa's super-slow Vulkan CPU implementation.

0.00
(0 votes)


avatar

Chaekyung

8 months ago
Score 0++

We covered -cl-fast-relaxed-math in our initial article about LuxMark in October 2020, we are aware that it cases a garbled image on all drivers.

Mesa Clover is another story, Mesa versions prior to 21 fail to produce a valid result no matter what options you use.
Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.