├── .gitignore
├── .readthedocs.yaml
├── Buildinfo.properties.in
├── CMakeLists.txt
├── License.txt
├── README.md
├── RGD_NOTICES.txt
├── RGD_RELEASE_NOTES.txt
├── _clang-format
├── build
├── dependency_map.py
├── fetch_dependencies.py
├── pre_build.py
└── utils
│ └── get_version.py
├── documentation
├── Makefile
├── make.bat
├── requirements.txt
└── source
│ ├── _static
│ ├── style.css
│ └── theme_overrides.css
│ ├── _templates
│ └── layout.html
│ ├── conf.py
│ ├── help_manual.rst
│ ├── images
│ ├── driver-experiments-select-api.png
│ ├── driver-experiments-select-experiment.png
│ ├── enable-crash-analysis.png
│ ├── enable-driver-experiments.png
│ ├── open-text-summary.png
│ ├── rgd-advanced-options.png
│ └── select-text-output-format.png
│ └── index.rst
├── external
├── .gitattributes
├── amd_gpu_dis
│ ├── Include
│ │ └── CodeObjectDisassemblerApi.h
│ └── Lib
│ │ ├── Linux
│ │ └── x64
│ │ │ └── libamdgpu_dis.so
│ │ └── VS2022
│ │ └── x64
│ │ ├── amdgpu_dis.dll
│ │ └── amdgpu_dis.lib
└── dev_driver
│ └── include
│ └── rgdevents.h
├── samples
└── sample_crash_dump.rgd
├── source
├── radeon_gpu_detective_backend
│ ├── CMakeLists.txt
│ ├── rgd_amd_gpu_dis_loader.cpp
│ ├── rgd_amd_gpu_dis_loader.h
│ ├── rgd_asic_info.cpp
│ ├── rgd_asic_info.h
│ ├── rgd_code_object_comgr_handle.h
│ ├── rgd_code_object_database.cpp
│ ├── rgd_code_object_database.h
│ ├── rgd_crash_info_registers_parser.h
│ ├── rgd_crash_info_registers_parser_context.cpp
│ ├── rgd_crash_info_registers_parser_context.h
│ ├── rgd_crash_info_registers_parser_rdna2.cpp
│ ├── rgd_crash_info_registers_parser_rdna2.h
│ ├── rgd_crash_info_registers_parser_rdna3.cpp
│ ├── rgd_crash_info_registers_parser_rdna3.h
│ ├── rgd_crash_info_registers_parser_rdna4.cpp
│ ├── rgd_crash_info_registers_parser_rdna4.h
│ ├── rgd_data_types.h
│ ├── rgd_enhanced_crash_info_serializer.cpp
│ ├── rgd_enhanced_crash_info_serializer.h
│ ├── rgd_exec_marker_tree_serializer.cpp
│ ├── rgd_exec_marker_tree_serializer.h
│ ├── rgd_hash.h
│ ├── rgd_marker_data_serializer.cpp
│ ├── rgd_marker_data_serializer.h
│ ├── rgd_parsing_utils.cpp
│ ├── rgd_parsing_utils.h
│ ├── rgd_register_parsing_utils.cpp
│ ├── rgd_register_parsing_utils.h
│ ├── rgd_resource_info_serializer.cpp
│ ├── rgd_resource_info_serializer.h
│ ├── rgd_serializer.cpp
│ ├── rgd_serializer.h
│ ├── rgd_serializer_json.cpp
│ ├── rgd_serializer_json.h
│ ├── rgd_utils.cpp
│ ├── rgd_utils.h
│ └── rgd_version_info.h.in
└── radeon_gpu_detective_cli
│ ├── CMakeLists.txt
│ ├── main.cpp
│ └── windows
│ ├── resource.h
│ └── rgd.rc
└── test
├── RGD_TEST_README.md
├── scripts
├── TestRunner.py
└── input_description_files
│ ├── RgdAllTests.json
│ └── RgdDriverSanity.json
└── source
└── rgd_test
├── CMakeLists.txt
├── main.cpp
├── test_rgd_file.cpp
└── test_rgd_file.h
/.gitignore:
--------------------------------------------------------------------------------
1 | build/CMake
2 | build/win
3 | build/linux
4 | .vscode
5 | *.vs
6 | *.csproj.user
7 | obj
8 | build/__pycache__
9 | external/rmv
10 | external/update_check_api
11 | external/system_info_utils
12 | external/rdf
13 | external/third_party
14 | external/comgr_package
15 | Buildinfo.properties
16 | rgd_version_info.h
17 | documentation/build
18 | *~
19 | *.aps
--------------------------------------------------------------------------------
/.readthedocs.yaml:
--------------------------------------------------------------------------------
1 | # .readthedocs.yaml
2 | # Read the Docs configuration file
3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4 |
5 | # Required
6 | version: 2
7 |
8 | # Set the version of Python and other tools you might need
9 | build:
10 | os: ubuntu-22.04
11 | tools:
12 | python: "3.11"
13 |
14 | # Build documentation in the docs/source directory with Sphinx
15 | sphinx:
16 | configuration: documentation/source/conf.py
17 |
18 | # We recommend specifying your dependencies to enable reproducible builds:
19 | # https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20 | python:
21 | install:
22 | - requirements: documentation/requirements.txt
--------------------------------------------------------------------------------
/Buildinfo.properties.in:
--------------------------------------------------------------------------------
1 | BUILD_NUMBER=@RGD_BUILD_NUMBER@
2 | VERSION_NUMBER=@RGD_MAJOR_VERSION@.@RGD_MINOR_VERSION@
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #=============================================================================
2 | # Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
3 | # @author AMD Developer Tools Team
4 | # @file
5 | # @brief Top level CMakeLists file.
6 | #=============================================================================
7 |
8 | cmake_minimum_required (VERSION 3.10)
9 | project (RGD)
10 |
11 | # Define version information
12 | set(RGD_MAJOR_VERSION 1)
13 | set(RGD_MINOR_VERSION 4)
14 | set(RGD_PATCH_NUMBER 0)
15 | if (NOT RGD_BUILD_NUMBER)
16 | set(RGD_BUILD_NUMBER 0)
17 | endif ()
18 |
19 | string(TIMESTAMP DATE "\"%m/%d/%Y\"")
20 | string(TIMESTAMP YEAR "\"%Y\"")
21 |
22 | configure_file("${CMAKE_SOURCE_DIR}/Buildinfo.properties.in" "${CMAKE_SOURCE_DIR}/Buildinfo.properties")
23 | configure_file("${CMAKE_SOURCE_DIR}/source/radeon_gpu_detective_backend/rgd_version_info.h.in" "${CMAKE_SOURCE_DIR}/source/radeon_gpu_detective_backend/rgd_version_info.h")
24 |
25 | # Add cmake utilities
26 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/rmv/cmake")
27 | include(dev_tools)
28 |
29 | add_definitions(-DCOMGR_DYNAMIC_LINKING)
30 |
31 | # Include directories for all projects.
32 | set(AMDGPU_DIS_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/external/amd_gpu_dis/Include/)
33 | set(AMD_COMGR_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/external/comgr_package/comgr/include/)
34 | include_directories("${PROJECT_SOURCE_DIR}/external/")
35 | include_directories("${PROJECT_SOURCE_DIR}/external/rdf/rdf/inc/")
36 | include_directories("${PROJECT_SOURCE_DIR}/external/third_party/")
37 | include_directories("${PROJECT_SOURCE_DIR}/external/comgr_package/comgr/include/")
38 | include_directories("${PROJECT_SOURCE_DIR}/external/comgr_package/comgr_utils/")
39 |
40 | # rgd command line tool.
41 | add_subdirectory (source/radeon_gpu_detective_cli)
42 |
43 | add_subdirectory (source/radeon_gpu_detective_backend)
44 |
45 | # RDF.
46 | add_definitions(-DRDF_CXX_BINDINGS)
47 | option(RDF_STATIC "Build RDF as a static library" ON)
48 | add_subdirectory(external/rdf/imported/zstd)
49 | add_subdirectory(external/rdf/rdf)
50 |
51 | # RMV.
52 | add_subdirectory(external/rmv/source/parser parser)
53 | add_subdirectory(external/rmv/source/backend backend)
54 |
55 | # System info.
56 | set(SYSTEM_INFO_BUILD_RDF_INTERFACES ON)
57 | add_subdirectory(external/system_info_utils)
58 |
59 | # Test rgd app.
60 | add_subdirectory(test/source/rgd_test)
61 |
62 | # COMGR.
63 | add_subdirectory(external/comgr_package/comgr_utils ComgrUtils)
64 |
65 | # Define the location of dependent libraries
66 | IF(WIN32)
67 | set(AMD_COMGR_LIBS_DIR ${PROJECT_SOURCE_DIR}/external/comgr_package/comgr/lib/VS2022/x64)
68 | set(AMDGPU_DIS_LIBS_DIR ${PROJECT_SOURCE_DIR}/external/amd_gpu_dis/Lib/VS2022/x64)
69 | ELSEIF(UNIX)
70 | set(AMD_COMGR_LIBS_DIR ${PROJECT_SOURCE_DIR}/external/comgr_package/comgr/lib/x64)
71 | set(AMDGPU_DIS_LIBS_DIR ${PROJECT_SOURCE_DIR}/external/amd_gpu_dis/Lib/Linux/x64)
72 | ENDIF()
73 |
74 | # Locate shared library components referenced by multiple targets
75 | IF(WIN32)
76 | set (AMD_COMGR_LIB_FILENAME amd_comgr_2)
77 | ELSEIF(UNIX)
78 | set (AMD_COMGR_SHARED ${CMAKE_SHARED_LIBRARY_PREFIX}amd_comgr${CMAKE_SHARED_LIBRARY_SUFFIX})
79 | set (AMD_COMGR_LIB_FILENAME amd_comgr)
80 | ENDIF()
81 | set (AMD_COMGR_SHARED ${CMAKE_SHARED_LIBRARY_PREFIX}${AMD_COMGR_LIB_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
82 | set (AMDGPU_DIS_SHARED ${CMAKE_SHARED_LIBRARY_PREFIX}amdgpu_dis${CMAKE_SHARED_LIBRARY_SUFFIX})
83 |
84 | find_library(AMD_COMGR_LIB ${AMD_COMGR_LIB_FILENAME} PATHS ${AMD_COMGR_LIBS_DIR} NO_DEFAULT_PATH)
85 | find_file(AMD_COMGR_SHAREDLIB ${AMD_COMGR_SHARED} PATHS ${AMD_COMGR_LIBS_DIR} NO_DEFAULT_PATH)
86 | find_library(AMDGPU_DIS_LIB amdgpu_dis PATHS ${AMDGPU_DIS_LIBS_DIR} NO_DEFAULT_PATH)
87 | find_file(AMDGPU_DIS_SHAREDLIB ${AMDGPU_DIS_SHARED} PATHS ${AMDGPU_DIS_LIBS_DIR} NO_DEFAULT_PATH)
88 |
89 | message ("Comgr found at ${AMD_COMGR_LIB}")
90 | message ("Comgr shared at ${AMD_COMGR_SHAREDLIB}")
91 | message ("AMDGPU_Dis found at ${AMDGPU_DIS_LIB}")
92 | message ("AMDGPU_Dis shared at ${AMDGPU_DIS_SHAREDLIB}")
93 | message ("AMDGPU_Dis include at ${AMDGPU_DIS_INCLUDE_DIR}")
94 |
95 | set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
96 | set(CPACK_COMPONENTS_GROUPING IGNORE)
97 |
98 | set(CPACK_PACKAGE_VERSION "${RGD_MAJOR_VERSION}.${RGD_MINOR_VERSION}.${RGD_PATCH_NUMBER}.${RGD_BUILD_NUMBER}")
99 |
100 | if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
101 | set(CPACK_RGD_CLI_PACKAGE_NAME "radeon_gpu_detective_debug")
102 | set(CPACK_RGD_TEST_PACKAGE_NAME "rgd_test_debug")
103 | else ()
104 | set(CPACK_RGD_CLI_PACKAGE_NAME "radeon_gpu_detective")
105 | set(CPACK_RGD_TEST_PACKAGE_NAME "rgd_test")
106 | endif ()
107 |
108 | set(CPACK_RGD_CLI_FULL_PACKAGE_NAME "${CPACK_RGD_CLI_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
109 | set(CPACK_RGD_TEST_FULL_PACKAGE_NAME "${CPACK_RGD_TEST_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
110 | set(CPACK_ARCHIVE_RGD_CLI_COMPONENT_FILE_NAME "${CPACK_RGD_CLI_FULL_PACKAGE_NAME}")
111 | set(CPACK_ARCHIVE_RGD_TEST_COMPONENT_FILE_NAME "${CPACK_RGD_TEST_FULL_PACKAGE_NAME}")
112 |
113 | # Archive RGD CLI configuration
114 | install(TARGETS radeon_gpu_detective_cli
115 | RUNTIME
116 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}
117 | COMPONENT rgd_cli_component)
118 |
119 | install(FILES RGD_NOTICES.txt
120 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}
121 | COMPONENT rgd_cli_component)
122 | install(FILES README.md
123 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}
124 | COMPONENT rgd_cli_component)
125 | install(FILES RGD_RELEASE_NOTES.txt
126 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}
127 | COMPONENT rgd_cli_component)
128 | install(DIRECTORY documentation/build/rgd
129 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}/help/
130 | COMPONENT rgd_cli_component)
131 | install(DIRECTORY samples
132 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}
133 | COMPONENT rgd_cli_component)
134 |
135 | # Define the location of dependent libraries for RGD CLI.
136 | IF(WIN32)
137 | install(FILES external/amd_gpu_dis/Lib/VS2022/x64/amdgpu_dis.dll
138 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}
139 | COMPONENT rgd_cli_component)
140 | install(FILES external/comgr_package/comgr/lib/VS2022/x64/amd_comgr_2.dll
141 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}
142 | COMPONENT rgd_cli_component)
143 | ELSEIF(UNIX)
144 | install(FILES ${AMDGPU_DIS_SHAREDLIB}
145 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}/lib/
146 | COMPONENT rgd_cli_component)
147 | install(FILES ${AMD_COMGR_SHAREDLIB}
148 | DESTINATION ./${CPACK_RGD_CLI_FULL_PACKAGE_NAME}/lib/
149 | COMPONENT rgd_cli_component)
150 | ENDIF()
151 |
152 | # Archive RGD TEST configuration
153 | install(TARGETS rgd_test
154 | RUNTIME
155 | DESTINATION ./${CPACK_ARCHIVE_RGD_TEST_COMPONENT_FILE_NAME}/${CPACK_RGD_CLI_FULL_PACKAGE_NAME}/
156 | COMPONENT rgd_test_component)
157 |
158 | install(TARGETS radeon_gpu_detective_cli
159 | RUNTIME
160 | DESTINATION ./${CPACK_ARCHIVE_RGD_TEST_COMPONENT_FILE_NAME}/${CPACK_RGD_CLI_FULL_PACKAGE_NAME}/
161 | COMPONENT rgd_test_component)
162 |
163 | install(FILES test/RGD_TEST_README.md
164 | DESTINATION ./${CPACK_RGD_TEST_FULL_PACKAGE_NAME}/
165 | COMPONENT rgd_test_component)
166 |
167 | install(DIRECTORY test/scripts/input_description_files
168 | DESTINATION ./${CPACK_RGD_TEST_FULL_PACKAGE_NAME}/
169 | COMPONENT rgd_test_component)
170 |
171 | install(FILES test/scripts/TestRunner.py
172 | DESTINATION ./${CPACK_RGD_TEST_FULL_PACKAGE_NAME}/
173 | COMPONENT rgd_test_component)
174 |
175 | # Define the location of dependent libraries for RGD TEST.
176 | IF(WIN32)
177 | install(FILES external/amd_gpu_dis/Lib/VS2022/x64/amdgpu_dis.dll
178 | DESTINATION ./${CPACK_ARCHIVE_RGD_TEST_COMPONENT_FILE_NAME}/${CPACK_RGD_CLI_FULL_PACKAGE_NAME}/
179 | COMPONENT rgd_test_component)
180 | install(FILES external/comgr_package/comgr/lib/VS2022/x64/amd_comgr_2.dll
181 | DESTINATION ./${CPACK_ARCHIVE_RGD_TEST_COMPONENT_FILE_NAME}/${CPACK_RGD_CLI_FULL_PACKAGE_NAME}/
182 | COMPONENT rgd_test_component)
183 | ENDIF()
184 |
185 | include(CPack)
186 |
187 | cpack_add_component(rgd_cli_component
188 | DISPLAY_NAME "Radeon GPU Detective ${CPACK_PACKAGE_VERSION} ${RGD_BUILD_SUFFIX}"
189 | DESCRIPTION "RGD application")
190 |
191 | cpack_add_component(rgd_test_component
192 | DISPLAY_NAME "RGD Tests ${CPACK_PACKAGE_VERSION} ${RGD_BUILD_SUFFIX}"
193 | DESCRIPTION "RGD backend tests and driver sanity tests")
194 |
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # radeon_gpu_detective
2 | RGD is a tool for post-mortem analysis of GPU crashes.
3 |
4 | The tool performs offline processing of AMD GPU crash dump files and generates crash analysis reports in text and JSON formats.
5 |
6 | To generate AMD GPU crash dumps for your application, use Radeon Developer Panel (RDP) and follow the Crash Analysis help manual.
7 |
8 | ## Build Instructions ##
9 | It is recommended to build the tool using the "pre_build.py" script which can be found under the "build" subdirectory.
10 |
11 | **Steps:**
12 |
13 | ``
14 | cd build
15 | ``
16 |
17 |
18 | ``
19 | python pre_build.py
20 | ``
21 |
22 | The script supports different options such as using different MSVC toolsets versions. For the list of options run the script with `-h`.
23 |
24 | By default, a solution is generated for VS 2022. To generate a solution for a different VS version or to use a different MSVC toolchain use the `--vs` argument.
25 | For example, to generate the solution for VS 2019 with the VS 2019 toolchain (MSVC 16), run:
26 |
27 | ``
28 | python pre_build.py --vs 2019
29 | ``
30 |
31 | ## Running ##
32 | Basic usage (text output):
33 |
34 | ``
35 | rgd --parse -o