• Stars
    star
    379
  • Rank 113,004 (Top 3 %)
  • Language
    C++
  • License
    Other
  • Created about 3 years ago
  • Updated 15 days ago

Reviews

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

Repository Details

GPU Reshape (GRS) is an API & vendor agnostic instrumentation framework, with instruction level validation.

GPU Reshape

GPU Reshape offers API agnostic instrumentation of GPU side operations to perform, e.g., validation of potentially undefined behaviour, supporting both Vulkan and D3D12 (DXIL). No application side integration is required.

GPU Reshape is an open collaboration between Miguel Petersen (author), Advanced Micro Devices and Avalanche Studios Group.

Cover.png


Quick Start - Features - Build - API - Motivation - UIX


Current feature scope provides instrumentation on operations which are either undefined behaviour, or typically indicative of user fault such as:

  • Resource Bounds
    Validation of resource read / write coordinates against its bounds.
  • Export Stability
    Numeric stability validation of floating point exports (UAV writes, render targets, vertex exports), e.g. NaN / Inf.
  • Descriptor Validation
    Validation of descriptors, potentially dynamically indexed. This includes undefined, mismatched (compile-time to runtime), out of bounds descriptor indexing, and missing table bindings.
  • Concurrency Validation
    Validation of resource concurrency, i.e. single-producer or multiple-consumer, between queues and events.
  • Resource Initialization
    Validation of resource initialization, ensures any read was preceded by a write.
  • Infinite Loops
    Detection of infinite loops. Experimental.

The future feature scope includes profiling and debugging functionality, such as branch hot spots, live breakpoints, and assertions. For the full planned feature set, see Features.

Instrumentation as a framework

The toolset provides a generalized SSA-based intermediate language from which all instrumentation is done, bi-directionally translated to SPIRV and DXIL. Each feature, such as the validation of out-of-bounds reads, operates solely on the intermediate language and has no visibility on the backend language nor API.

Each feature can alter the program as it sees fit, such as adding basic-blocks, modifying instructions, and even removing instructions. The feature is given a Program, which act as the abstraction for the active backend, from which the user has access to all functions, basic-blocks, instructions, types, etc..., and is able to modify as necessary. After modification, the backend then performs just-in-time recompilation of the modified program back to the backend language.

The toolset additionally provides a set of building blocks needed for instrumentation:

  • Message Streams help facilitate GPU -> CPU communication, and also serves as the base for inter-process/endpoint communication.
  • Persistent data such as buffers, textures and push / root constants, visible to all instrumentation features. Certain features require state management.
  • User programs, entirely user driven compute kernels written through the intermediate language. All persistent data visible.
  • User side command hooking, certain features may wish to modify state, invoke kernels, before the pending command.
  • Resource tokens, abstracting away differences in binding models by providing a token from shader resource handles. Each token provides a physical UID, resource type and sub-resource base.
  • Command scheduling, record and submit custom (abstracted) command buffers / lists.

Features do not need to concern themselves with backend specifics, such as vectorized versus scalarized execution, control-flow requirements, and other implementation details. Given compliance, each feature will translate seamlessly to the backend language.

This toolset aims to serve as a framework for instrumentation, acting as a modular base from which any number of tools, techniques, optimizations, etc..., can be implemented.

Testing Suite

A list of applications GPU Reshape is tested against for stability and validity.

Games

  • Call of the Wild: The Angler (Avalanche, DX12)
  • Second Extinction (Avalanche, Vulkan)
  • Rage 2 (Avalanche / id Software, Vulkan)
  • Chernobylite (The Farm 51, DX12)
  • Dying Light 2 (Techland, DX12)
  • The Lord of the Rings: Gollum (Daedalic Entertainment, DX12)
  • A Plague Tale: Requiem (Asobo Studio, DX12)
  • Ratchet & Clank: Rift Apart (Insomniac Games / Nixxes Software, DX12)
  • Forspoken (Square Enix, DX12)
  • The Riftbreaker (EXOR Studios, DX12)
  • Starfield (Bethesda Game Studios, DX12)
  • Cyberpunk 2077 (CD PROJEKT RED, DX12)

Engines

  • Unreal Engine 4 (Epic Games, DX12, Vulkan)
  • Unreal Engine 5 (Epic Games, DX12, Vulkan)

AMD

  • FidelityFX-SDK (DX12, Vulkan)
  • FSR2 (DX12, Vulkan)
  • GLTFSample (DX12, Vulkan)
  • ParallelSort (DX12, Vulkan)
  • SPDSample (DX12, Vulkan)
  • SSSRSample (DX12, Vulkan)
  • TressFX (DX12, Vulkan)

Khronos

  • Vulkan-Samples (Vulkan, certain extensions pending support, e.g. descriptor buffers)

Microsoft

  • MiniEngine ModelViewer (DX12)

Known Issues

  • Raytracing and mesh shaders are currently pass-through, no instrumentation is done on them.
  • Initialization feature false positives. Resources can be initialized in a myriad of ways, this will be improved with time.
  • Loop feature not catching all timeouts. The loop feature is currently experimental, and relies on non-standard guarantees.
  • Application launches, not attaching, will only connect to the first device, which may not necessarily be the intended device.

Credit

GPU Reshape was initially developed as a prototype tool by Miguel Petersen at Avalanche Studios Group, extending validation tools to shader side operations. It was then requested to continue development externally through an open collaboration on GPUOpen.

Development was supported by:

  • Lou Kramer (AMD)
  • Jonas Gustavsson (AMD)
  • Marek Machlinski (AMD)
  • Rys Sommefeldt (AMD)
  • Mark Simpson (AMD)
  • Daniel Isheden (Avalanche Studios)
  • Alexander Polya (Avalanche Studios)
  • Wiliam Hjelm (Avalanche Studios)

Copyright (c) 2024 Advanced Micro Devices, Inc., Fatalist Development AB (Avalanche Studio Group), and Miguel Petersen.

All Rights Reserved.

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_analyzer

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

radeon_gpu_profiler

Radeon GPU Profiler (RGP) is a tool from AMD that allows for deep inspection of GPU workloads.
390
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