Valve Engineer Fixes Massive Performance Issue For RADV Driver With AMD FSR2 Sample

Written by Michael Larabel in Radeon on 1 November 2024 at 10:26 AM EDT. 35 Comments
RADEON
With the upcoming Mesa 24.3 release there is a huge improvement coming for those using the RADV Radeon Vulkan driver with the AMD FidelityFX Super Resolution 2 sample app.

Samuel Pitoiset of Valve's Linux driver team discovered a very important performance fix for the Mesa RADV driver so there isn't such a big hole in the AMD FSR2 performance of its sample app compared to using the AMDVLK/AMDGPU-PRO official Vulkan driver code from AMD.

The issue dates back to a two year old bug report that the Mesa RADV driver performs "significantly less" than the AMDGPU-PRO driver for running the AMD FSR2 sample app. After not much activity on the issue the past two years, recently it ticked into interest of Valve engineers.

Samuel Pitoiset authored this Mesa merge in the AMD NIR code to cull triangles/lines when all W positions are zero. He commented there that it "Fixes the massive performance difference between RADV and PRO with the FSR2 sample." In the actual commit message Pitoiset elaborated:
"It looks like the fixed-func hardware is very slow to cull primitives with zero pos.w but shader based culling helps a lot.

This fixes a massive performance gap with the FSR2 demo / sample app compared to AMDGPU-PRO, +228% on RDNA2.

Based on my investigation, AMDGPU-PRO seems to always cull these primitives. Note that disabling NGG culling with AMDGPU-PRO reports the same performance as RADV without that fix. Also note that the FSR2 sample doesn't specify any cull mode (ie. VK_CULL_MODE_NONE is used), so this is the only reason PRO was culling more than RADV."

This 228% improvement for the AMD FidelityFX Super Resolution 2 (FSR2) performance with its sample app comes with reworking less than one dozen lines of code.

AMD FSR2 logo


The change is in Mesa 24.3-devel currently for this big improvement for those wanting to use FSR2 upscaling of the sample app with the popular RADV driver.

Update: It's since been clarified that this performance improvement is around the FSR2 sample application and not the FSR2 algorithm/implementation itself.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week