The Best Linux Vulkan Driver For AMD GPUs: Mesa RADV vs AMDVLK
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.
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 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, 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:
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.
Going down to "Medium" content quality makes the official test run fine with both drivers.
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)
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 far below where it should be in that benchmark.
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.
RADV wins the vkmark benchmark by a margin that is so small it is barely measurable.
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).
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 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.
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.
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
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
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
$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.