• Stars
    star
    417
  • Rank 103,829 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

The supported modes by the command-line tool are:

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

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

As a preliminary step, make sure that you have the following installed on your system:

  • CMake 3.10 or above. For auto-detecting the Vulkan SDK version 3.7 or above is required.
  • Python 2.7 or above
  • Qt (in case that you are interested in building the GUI app; you can build the command line executable without Qt). Qt 5.15.2 is recommended.

cd to the build sub-folder, and run:

prebuild.bat --qt <path of Qt's msvc2017_64 folder> --vs 2017

Where <path to Qt's msvc2017_64 folder> is the path to the Qt msvc2017_64 folder, such as C:\Qt\Qt5.15.2\msvc2017_64.

Running the prebuild script will fetch all the dependencies and generate the solution file for Visual Studio. After successfully running the preuild script, open RGA.sln from build\windows\vs2019 (or vs2017), and build:

  • RadeonGPUAnalyzerCLI project for the command line executable
  • RadeonGPUAnalyzerGUI project for the GUI app

Some useful options of the prebuild script:

  • --vs : generate the solution files for a specific Visual Studio version. For example, to target VS 2019, add --vs 2019 to the command.
  • --qt : full path to the folder from where you would like the Qt binaries to be retrieved. By default, CMake would try to auto-detect Qt on the system.
  • --vk-include and --vk-lib: full paths to where the Vulkan SDK include and Vulkan lib folders. By default, CMake would try to auto-detect the Vulkan SDK on the system.
  • --cli-only: only build the command line tool (do not build the GUI app)
  • --no-fetch: do not attempt to update the third-party repositories

If you are intending to analyze DirectX 11 shaders using RGA, copy the x64 version of Microsoft's D3D compiler to a subdirectory named "utils" under the RGA executable's directory (for example, D3DCompiler_47.dll).

-=-

If for some reason you do not want to use the prebuild.bat script, you can also manually fetch the dependencies and generate the solution and project files: Start by running the FetchDependencies.py script to fetch the solution's dependencies. To generate the solution file for VS 2017 in x64 configuration, use:

cmake.exe -G "Visual Studio 15 2017 Win64"

If you are intending to analyze DirectX shaders using RGA, copy the x64 version of Microsoft's D3D compiler to a subdirectory named "utils" under the RGA executable's directory (for example, D3DCompiler_47.dll).

Building on Ubuntu

  • One time setup:

    • Install the Vulkan SDK (version 1.1.97.0 or above). To download the Vulkan SDK, visit https://vulkan.lunarg.com/
    • sudo apt-get install libboost-all-dev
    • sudo apt-get install gcc-multilib g++-multilib
    • sudo apt-get install libglu1-mesa-dev mesa-common-dev libgtk2.0-dev
    • sudo apt-get install zlib1g-dev libx11-dev:i386
    • Install CMake 3.10 or above. For auto-detecting the Vulkan SDK version 3.7 or above is required.
    • Install python 3.6 (or above)
    • To build the GUI app, you should also have Qt installed
  • Build:

    cd to the build sub-folder

    On Linux, it is recommended to explicitly pass to CMake the location of the Vulkan SDK include and lib directories as well as the location of Qt. For example:

    ./prebuild.sh --qt ~/Qt-5.15.2/5.15.2/gcc_64 --vk-include ~/work/vulkan-sdk/1.1.97.0/x86_64/include/ --vk-lib ~/work/vulkan-sdk/1.1.97.0/x86_64/lib/

    This will fetch all the dependencies and generate the make files.

    Then, cd to the auto-generated subfolder build/linux/make and run make.

    -=-

    If for some reason you do not want to use the prebuild.sh script, you can also manually fetch the dependencies and generate the makefiles:

    • run: python3 fetch_dependencies.py

    • run: cmake –DCMAKE_BUILD_TYPE=Release (or: Debug)

      It is recommended to create a directory to hold all build files, and launch cmake from that directory.

      For example:

      • cd to the RGA repo directory
      • mkdir _build
      • cd _build
      • cmake –DCMAKE_BUILD_TYPE=Release ../
    • run: make

Running

GUI App

Run the RadeonGPUAnalyzerGUI executable. The app provides a quickstart guide and a help manual under Help.

Command Line Executable

Run the rga executable.

  • Usage:
    • General: rga -h

    • DirectX 12: rga -s dx12 -h

    • DirectX 11: rga -s dx11 -h

    • DirectX Raytracing: rga -s dxr -h

      Note: RGA's DX11 mode requires Microsoft's D3D Compiler DLL in runtime. If you copy the relevant D3D Compiler DLL to the utils subdirectory under the executable's directory, RGA will use that DLL in runtime. The default D3D compiler that RGA public releases ship with is d3dcompiler_47.dll.

    • OpenGL: rga -s opengl -h

    • OpenCL offline: rga -s opencl -h

    • Vulkan live-driver: rga -s vulkan -h

    • Vulkan offline - glsl: rga -s vk-offline -h

    • Vulkan offline - SPIR-V binary input: rga -s vk-offline-spv -h

    • Vulkan offline - SPIRV-V textual input: rga -s vk-offline-spv-txt -h

Support

For support, please visit the RGA repository github page: https://github.com/GPUOpen-Tools/RGA

Style and Format Change

The source code of this product is being reformatted to follow the Google C++ Style Guide https://google.github.io/styleguide/cppguide.html

In the interim you may encounter a mix of both an older C++ coding style, as well as the newer Google C++ Style.

Please refer to the _clang-format file in the root directory of the product for additional style information.

License

Radeon GPU Analyzer is licensed under the MIT license. See the License.txt file for complete license information.

Copyright information

Please see RGA_NOTICES.txt for copyright and third party license information.

More Repositories

1

compressonator

Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs
C++
1,300
star
2

radeon_gpu_profiler

Radeon GPU Profiler (RGP) is a tool from AMD that allows for deep inspection of GPU workloads.
390
star
3

GPU-Reshape

GPU Reshape (GRS) is an API & vendor agnostic instrumentation framework, with instruction level validation.
C++
379
star
4

ocat

The Open Capture and Analytics Tool (OCAT) provides an FPS overlay and performance measurement for D3D11, D3D12, and Vulkan
C++
325
star
5

gpu_performance_api

GPU Performance API for AMD GPUs
C++
250
star
6

radeon_raytracing_analyzer

The Radeon Raytracing Analyzer (RRA) is a tool to visualize and inspect Bounding Volume Hierarchies (BVH) for ray tracing applications.
C++
245
star
7

frame_latency_meter

C++
217
star
8

radeon_memory_visualizer

The Radeon Memory Visualizer (RMV) is a software tool that will allow users to analyze video memory usage on AMD Radeon GPUs.
C++
124
star
9

radeon_compute_profiler

The Radeon Compute Profiler (RCP) is a performance analysis tool that gathers data from the API run-time and GPU for OpenCLâ„¢ and ROCm/HSA applications. This information can be used by developers to discover bottlenecks in the application and to find ways to optimize the application's performance.
C++
84
star
10

radeon_gpu_detective

Tool for post-mortem analysis of GPU crashes.
C++
50
star
11

vscode_extensions

Handy extensions for Visual Studio Code to work on AMD GPU technologies
TypeScript
28
star
12

isa_spec_manager

Utilities for accessing AMD's Machine-Readable GPU ISA Specifications.
C++
18
star
13

device_info

C++
16
star
14

dev_driver_tools

Developer Driver Tools components (Radeon Developer Service and Radeon Developer Panel)
C++
16
star
15

radeon_developer_panel

The Radeon Developer Panel (RDP) is a software tool that allows users to capture RGP profiles, RMV traces, RRA scenes, and RGD crash analysis dumps on Radeon GPUs.
16
star
16

appsdk

C
10
star
17

adl

C
10
star
18

qt_common

C++
8
star
19

common_src_amddxext

C
6
star
20

common_lib_ext_zlib_1.2.8

C
6
star
21

dynamic_library_module

C++
5
star
22

opengl

C
4
star
23

common_src_amdtoswrappers

Common OS Abstraction layer shared by multiple tool projects
C++
4
star
24

tsingleton

C++
4
star
25

common_src_amdtbasetools

Common base code shared by multiple tool projects
C++
4
star
26

common_src_misc

C++
3
star
27

common_src_amdvkext

C
3
star
28

common_lib_amd_acl

C
3
star
29

adl_util

C++
3
star
30

windows_kits

CMake
3
star
31

common_lib_amd_ags_4.0.0

HLSL
3
star
32

tinyxml_2

C++
3
star
33

common_lib_ext_opengles

C
3
star
34

common_lib_ext_utf8cpp

C++
3
star
35

update_check_api

The UpdateCheckAPI repository provides utility source code for AMD Tools to check for new releases available through GitHub's Release API.
C++
3
star
36

common_src_miniz

C
2
star
37

common_lib_ext_tinyxml2_5.0.1

C++
2
star
38

common_src_version_info

C#
2
star
39

common_lib_ext_glew_1.9

C
2
star
40

comgr_utils

C++
2
star
41

common_src_amdtmutex

C++
2
star
42

common_lib_ext_boost_1.59

C++
2
star
43

common_src_cmake_modules

CMake
2
star
44

common_lib_ext_zlib_1.2.10

C
2
star
45

common_src_acl_module_manager

C++
2
star
46

system_info_utils

C++
2
star
47

common_lib_ext_opencv_2.49

C++
2
star
48

common_src_celf

C++
2
star
49

common_src_vsprops

Common Visual Studio build settings shared across multiple projects
2
star
50

common_lib_ext_openexr_2.2

C++
1
star
51

common_lib_ext_yaml_cpp

C++
1
star