Vulkan driver now uses Valve's ACO build backend

In the code base used to form the Mesa 20.2 version, the RADV driver, Vulkan for AMD chips switched to backend default to compile shaders »ACO«, developed by Valve as an alternative to the LLVM shader compiler.

This specified change was done with the end of obtaining an increase in the productivity of the games and a reduction in its launch time.

The change from RADV controller to new backend was possible after reaching parity in ACO functionality with the old AMD developed backend for the AMDGPU driver, which continues to be used in the RadeonSI OpenGL driver.

Testing by Valve showed that ACO is almost twice as fast as the AMDGPU shader build compiler and demonstrates an increase in FPS in some games when running on systems with the RADV driver.

The AMD OpenGL and Vulkan drivers currently use a shader compiler that is part of the LLVM upstream project. That project is huge and has a lot of different goals, and the online compilation of game shaders is just one of them. 

That can lead to development tradeoffs, where improving game-specific functionality is more difficult than it would be otherwise, or where game-specific features are often accidentally broken by LLVM developers working on other things.

The backend of ACO aims to ensure that the code is generated in the most optimal way possible for game app shaders and achieve very high compilation speed.

ACO it is written in C ++, developed keeping in mind the applicability for JIT compilation, and use the quick ones to iterate over data structures, avoiding pointer-based structures like linked lists and strings from using def. The intermediate representation of the code is completely based on SSA (Single Static Allocation) and allows for the allocation of records, accurately calculating the record based on the shader.

The intermediate representation of the code is completely based on SSA (Single Static Allocation) and allows for the allocation of records, accurately calculating the record based on the shader.

Currently only pixels are supported (fragments) and compute shaders on discrete AMD GPUs (dGPU VI +). However, ACO already correctly collects shaders for all games tested, including complex shaders from Shadow of the Tomb Raider and Wolfenstein II.

The proposed ACO prototype for the test it is almost twice as fast as the AMDGPU shader compiler and demonstrates an increase in FPS in some games when run on systems with the RADV controller.

To understand a little more about the relevance of adopting Valve's code, it is important to foreground that the objective is to guarantee the most optimal code generation possible for game app shaders, as well as very high compilation speed.

The shader compiler available in Mesa uses LLVM components, They do not allow to achieve the desired compilation speed and do not allow full control of the control flow, which in the past has already caused serious errors.

In addition, avoiding LLVM makes it possible to implement a more aggressive analysis discrepancies and finer log load management, enabling more efficient executable file generation.

Finally, it is also It is important to note that at the moment ACO works only for the Mesa RADV Vulkan controller. But the ACO developers have confirmed that their next step will be to start working on expanding ACO's capabilities to support the OpenGL RadeonSI driver, so that in the future and for this driver, ACO can replace the default LLVM shader compiler. .

How much those who prefer to continue with the backend that was used previously from the LLVM shader compiler, they can go back to it, they just have to change a variable.

The environment variable that is provided to make this change is "RADV_DEBUG = llvm".


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   VaryHeavy said

    And how does a user choose which backend to run a game with? What files does it have to modify?