Mesa 21.1.0-rc1 Is Released With Variable Rate Shading Support For AMD GPUs, New Vulkan Extensions And More
The first release candidate for Mesa 21.1, is scheduled to be released on May 5th, has been set in stone. It is a good indication of what the final 21.1 release will have: Variable Rate Shading support on the very latest AMD RX 6000 GPUs, new Vulkan features, OpenGL 4.6 support in the OpenGL-To-Vulkan translation layer, graphics optimizations for Intel's 12th generation GPUs/CPUs and a bit more.
A VTX3D Radeon HD 7850 Vchamp 2GB GDDR5 on a MSI AM3 motherboard. The OpenGL and Vulkan capabilities it can offer GNU/Linux users is provided by the Mesa graphics stack.
Mesa a everything-on-one graphics library that provides all the free software graphics drivers used by Linux-based operating systems. The upcoming 21.1 versions brings some notable features for those who happen to have the very latest AMD graphics hardware, some nice features to those who happen to use a CPU-integrated Intel GPU and some minor updates for everyone else.
The Goodies For AMD Graphics Users
Variable rate shading support for those who have a Radeon RX 6000 series GPUs makes it possible to increase the frame-rate in Vulkan games by doing fewer fragment shader invocations per pixels. The new
RADV_FORCE_VRS= variable makes it possible to apply them to blocks of
2x1 instead of just one pixel at a time. This does have a impact on the visual quality. The Mesa developers have applied some trickery to deactivate it when loss visual quality becomes to apparent. The result is that some games will get a performance boost by up to 30% (with
RADV_FORCE_VRS=2x2) all the time, some games get a performance boost some of the time and some will barely get any at all.
RADV_FORCE_VRS= is not enabled by default, those who want to experiment with this feature will have to explicitly enable it.
The AMD support for a resizable graphics memory bar, "smart access memory" as AMD likes to market it, has gained a new
RADV_PERFTEST=sam Mesa option for force-enabling it for Vulkan games on seemingly unsupported systems with. This does not mean that you can enable a resizable bar on your trusty old Athlon II with a Radeon 7850 GPU. 5000 series AMD processors are the only ones AMD lists on the SAM support page, and it is only supported if such a CPU is sitting in a motherboard with a AMD B550 or X570 chipset. That doesn't mean you can't use it on Intel machines, several of their CPUs and motherboard chipsets can do it. Many of the machines (specially non-AMD) that can work with a resizable bar are not identified as such by Mesa.
RADV_PERFTEST=sam will just make Mesa try to force-enable it when Vulkan games and applications are launched with that variable set. It may or may not do something depending on what kind of hardware you have.
There's also far less interesting "support" for AMD's special-purpose Aldebaran graphics chips coming in Mesa 21.1.
CHIP_ALDEBARAN is a data-center "GPU" without graphics ports based on the older Vega (gfx9) family. The new code for it makes Mesa aware of it's existence and that's about it.
Mesa 21.1-rc1 contains a welcome fix for VAAPI hardware encoding on AMD hardware. The Mesa 21 release broke it, you get a slide-show if you hardware encode video using AMD hardware with Mesa 21.0 (and 21.0.2). Mesa 21.0.3, scheduled to be released on April 21st, will contain the same fix.
The Goodies For Intel Graphics Users
There is one commit in particular that caught our eye on the Intel side: iris: Support I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC, a performance boosting patch for 12th generation Intel graphics chips first submitted by Nanley Chery in September 2019. It increases performance by between 3.58% and 18.04% on those chips.
Another interesting patch disables dynamic VAO fastpath on 8th and 9th generation graphics chips from Intel. This optimizations speeds things up on earlier and later graphics chips, but it hurt performance a lot on 8th and 9th generation chips.
There's a rather long list of other minor changes to both the Intel Iris OpenGL driver and the Intel ANV Vulkan driver listed in the git commit log for 21.1-rc1. None of them stand out as being revolutionary, but that doesn't mean that nothing is going on. The Intel graphics team, Collabra and even the AMD Open Source Lab have made a long list of smaller improvements to the Mesa Intel drivers since Mesa 21.0 was released barely more than a month ago.
New Vulkan Features
Mesa 21.1 will bring support for the
VK_KHR_zero_initialize_workgroup_memory extension, which allows the use of a null constant initializer on shader workgroup memory variables, and the
VK_KHR_workgroup_memory_explicit_layout extension, which allows shaders to explicitly define the layout of workgroup storage class memory and create aliases between variables from that storage class in a compute shader, to both the Intel ANV driver and the AMD RADV driver.
The proprietary Nvidia Display Driver for Linux gained support for both of those extensions with the release of version 465.24.02 on April 14th, 2021.
Meas's software Vulkan implementation, lavapipe, is now Vulkan 1.1 compliant. It is really slow, modern processors are just not meant to do a modern graphics cards work. Still, it works, and it is pretty interesting from a purely technical point of view.
Zink, a pretty neat OpenGL to Vulkan translation, is another neat Vulkan-based Mesa technology that's progressing rather rapidly. It will support OpenGL 4.6 when Mesa 21.1 is released. Anyone writing a brand new driver for a brand new graphics card would now, in theory, skip writing a huge OpenGL driver and proceed directly to Vulkan and use Zink to run any and all existing OpenGL applications. Doing so would be a bit unwise since Zink is rather slow, but it is possible.
You can test Zink, even if you have a working OpenGL driver, by setting the environment variable
MESA_LOADER_DRIVER_OVERRIDE=zink if you are curious about what it can do.
Several Mesa drivers support using a shader cache that lets Mesa compile GPU shaders once and re-use the compiled code on subsequent loads of the same game or application. This speeds up loading times by a decent amount. The cached shader files are currently stored as single files in
.cache/mesa_shader_cache. You may find that you have 30000+ files stored there if you use Linux regularly.
Timothy Arceri as contributed code that allows Mesa to use a single shader cache file for each application at the behest of the Valve Corporation. Valve runs the profitable Steam game store and launcher. They want this functionality so they can more easily distribute pre-compiled shaders along with the games people purchase from their store. Steam is already capable of using single file shader caches when Mesa 21.1 is released. Using Steam is not a requirement, it can be enabled per-application or globally by setting environment variable
Gallium Nine developer Axel Davy managed to squeeze some last minute improvements to the Gallium Nine Direct3D 9 Gallium driver such as by-default enabled thread submit and tear-free discard support. Wine users could use Gallium Nine as a third alternative to DXVK and Wines built-in Direct3D 9 to OpenGL translation layer.
The Panfrost driver for Mali GPUs, common in by many Chromebooks and the Pinebook Pro, has also seen a long list of improvements. Alyssa Rosenzweig, the primary Panfrost maintainer and author of articles such as Software freedom isn’t about licenses – it’s about power, has been hard at work the last month.
Mesa 21.1 will be released on May 5th 2021 unless last-minute bugs that are severe enough to block the release are found. It will, in that case, be released the following week on May 12th. This release cycle is handled by Eric Engestrom who has recently replaced Dylan Baker as the Mesa 3D projects release manager. The source code for 21.1-rc1 can be acquired from mesa.freedesktop.org/archive/. The Mesa team would like you to report any bugs complaints about it to gitlab.freedesktop.org/mesa/mesa/-/issues/new. Any severe complaints will be added to the list of release-blocking issues listed at https://gitlab.freedesktop.org/mesa/mesa/-/milestones/25 (none are listed at this time).