r.GPUCrashDebugging.Aftermath.ResourceTracking
r.GPUCrashDebugging.Aftermath.ResourceTracking
#Overview
name: r.GPUCrashDebugging.Aftermath.ResourceTracking
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable resource tracking for Aftermath dumps
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.GPUCrashDebugging.Aftermath.ResourceTracking is to enable resource tracking for Aftermath dumps in GPU crash debugging scenarios. This setting variable is part of the GPU crash debugging system in Unreal Engine, specifically for the NVIDIA Aftermath technology.
This setting variable is primarily used in the RHI (Rendering Hardware Interface) module and is referenced in both D3D11 and D3D12 implementations. It’s particularly relevant for Windows-based DirectX rendering.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a read-only console variable, which means its value can be set at engine startup or through configuration files, but not changed during runtime.
This variable interacts with several other Aftermath-related variables, such as:
- r.GPUCrashDebugging.Aftermath.Markers
- r.GPUCrashDebugging.Aftermath.Callstack
- r.GPUCrashDebugging.Aftermath.TrackAll
Developers must be aware that enabling this variable may have performance implications, as resource tracking can introduce overhead. It should primarily be used for debugging purposes, especially when investigating GPU crashes or hangs.
Best practices when using this variable include:
- Enable it only when needed for debugging GPU issues.
- Use it in conjunction with other Aftermath variables for comprehensive crash information.
- Be mindful of the performance impact in production builds.
- Consider enabling it by default in editor builds for easier debugging (as seen in the D3D11 implementation).
- Use command-line parameters or configuration settings to control its state, rather than hardcoding it in source.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/RHI.cpp:1151
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarGPUCrashDebuggingAftermathResourceTracking(
TEXT("r.GPUCrashDebugging.Aftermath.ResourceTracking"),
0,
TEXT("Enable resource tracking for Aftermath dumps"),
ECVF_ReadOnly
);
static TAutoConsoleVariable<int32> CVarGPUCrashDebuggingAftermathTrackAll(
#Loc: <Workspace>/Engine/Source/Runtime/D3D12RHI/Private/D3D12Adapter.cpp:668
Scope (from outer to inner):
file
function void FD3D12Adapter::CreateRootDevice
Source code excerpt:
static IConsoleVariable* MarkersCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.Markers"));
static IConsoleVariable* CallstackCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.Callstack"));
static IConsoleVariable* ResourcesCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.ResourceTracking"));
static IConsoleVariable* TrackAllCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.TrackAll"));
const bool bEnableMarkers = FParse::Param(FCommandLine::Get(), TEXT("aftermathmarkers")) || (MarkersCVar && MarkersCVar->GetInt());
const bool bEnableCallstack = FParse::Param(FCommandLine::Get(), TEXT("aftermathcallstack")) || (CallstackCVar && CallstackCVar->GetInt());
const bool bEnableResources = FParse::Param(FCommandLine::Get(), TEXT("aftermathresources")) || (ResourcesCVar && ResourcesCVar->GetInt());
const bool bEnableAll = FParse::Param(FCommandLine::Get(), TEXT("aftermathall")) || (TrackAllCVar && TrackAllCVar->GetInt());
#Loc: <Workspace>/Engine/Source/Runtime/Windows/D3D11RHI/Private/Windows/WindowsD3D11Device.cpp:1342
Scope (from outer to inner):
file
function void FD3D11DynamicRHI::StartNVAftermath
Source code excerpt:
static IConsoleVariable* MarkersCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.Markers"));
static IConsoleVariable* CallstackCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.Callstack"));
static IConsoleVariable* ResourcesCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.ResourceTracking"));
static IConsoleVariable* TrackAllCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GPUCrashDebugging.Aftermath.TrackAll"));
const bool bEnableInEditor = GIsEditor && !FParse::Param(FCommandLine::Get(), TEXT("nogpucrashdebugging"));
const bool bEnableMarkers = FParse::Param(FCommandLine::Get(), TEXT("aftermathmarkers")) || (MarkersCVar && MarkersCVar->GetInt()) || bEnableInEditor;
const bool bEnableCallstack = FParse::Param(FCommandLine::Get(), TEXT("aftermathcallstack")) || (CallstackCVar && CallstackCVar->GetInt());
const bool bEnableResources = FParse::Param(FCommandLine::Get(), TEXT("aftermathresources")) || (ResourcesCVar && ResourcesCVar->GetInt());