Skip to content

The Radeon GPU Analyzer (RGA) is an offline compiler and code analysis tool for Vulkan, DirectX, OpenGL, and OpenCL.

License

Notifications You must be signed in to change notification settings

GPUOpen-Tools/radeon_gpu_analyzer

Repository files navigation

RGA (Radeon™ GPU Analyzer)

Radeon GPU Analyzer is a compiler and code analysis tool for Vulkan®, DirectX®, OpenGL® and OpenCL™. Using this product, you can compile high-level source code for a variety of AMD GPU and APU architectures, independent of the type of GPU/APU that is physically installed on your system.

You can use RGA to produce the following output:

  • RDNA™ and GCN ISA disassembly
  • Intermediate language disassembly: AMDIL, DXIL and DXBC for DirectX, SPIR-V for Vulkan, LLVM IR for Offline OpenCL
  • Hardware resource usage statistics, such as register consumption, static memory allocation and more
  • Compiled binaries
  • Live register analysis (see http://gpuopen.com/live-vgpr-analysis-radeon-gpu-analyzer/ for more info)
  • Control flow graphs
  • Build errors and warnings

The RGA package contains both a GUI app and a command-line executable.

The supported modes by the GUI app are:

  • Vulkan - GLSL/SPIR-V as input, together with the Vulkan pipeline state; compiled through AMD's Vulkan driver
  • OpenCL - AMD's LLVM-based Lightning Compiler for OpenCL
  • Binary Analysis - analyze pre-compiled AMD GPU Code Object binary files

The supported modes by the command-line tool are:

  • Binary Analysis - analyze pre-compiled AMD GPU Code Object binary files
  • DX12 (see https://gpuopen.com/radeon-gpu-analyzer-2-2-direct3d12-compute/ and https://gpuopen.com/radeon-gpu-analyzer-2-3-direct3d-12-graphics/ for more details)
  • DX11
  • DXR
  • Vulkan - compilation of GLSL/SPIR-V together with the API's pipeline state, using AMD's Vulkan driver
  • Vulkan Offline - using a static compiler, accepts GLSL/SPIR-V as input. Note: to ensure that the results that RGA provides are accurate and reflect the real-world case, please use the new Vulkan live driver mode (which is also supported in the GUI application).
  • OpenCL - AMD's LLVM-based Lightning Compiler for Offline OpenCL
  • OpenGL

System Requirements

  • Windows: 10, 64-bit. Visual Studio 2015 or later.
  • Linux: Ubuntu 20.04. Build with gcc 4.7.2 or later.
  • Vulkan SDK 1.1.97.0 or later. To download the Vulkan SDK, visit https://vulkan.lunarg.com/

To run the tool, you would need to have the AMD Radeon Adrenalin Software (Windows) or amdgpu-pro driver (Linux) installed for all modes, except for the following "offline" modes, which are independent of the driver and hardware:

  • Vulkan offline mode
  • OpenCL mode
  • OpenGL mode
  • DX11 mode
  • Binary Analysis mode

For the non-offline modes, it is strongly recommended to run with the latest drivers so that the latest compiler is used and the latest architectures can be targeted.

A specific note for Vulkan mode users:

RGA releases are packaged with the AMD Vulkan driver to enable users who run on machines without an AMD GPU or driver. This is not the case if you build the tool yourself. To enable a custom RGA build on a non-AMD machine, copy the "amdvlk" folder from an RGA release archive to your build output folder (make sure to place the folder in the same folder hierarchy as in the release archive). Please note that this is a workaround and not the recommended configuration.

Build Instructions

Building on Windows