r.GPUCrashDebugging.Aftermath.Callstack

r.GPUCrashDebugging.Aftermath.Callstack

#Overview

name: r.GPUCrashDebugging.Aftermath.Callstack

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.GPUCrashDebugging.Aftermath.Callstack is to enable callstack capture in Aftermath dumps for GPU crash debugging. This setting variable is part of the GPU crash debugging system in Unreal Engine 5, specifically for the NVIDIA Aftermath technology.

This variable is primarily used in the RHI (Rendering Hardware Interface) subsystem of Unreal Engine 5, particularly in the D3D11 and D3D12 RHI implementations. It’s referenced in the core RHI module and the D3D11RHI and D3D12RHI modules.

The value of this variable is set as a console variable (CVar) with a default value of 0, meaning it’s disabled by default. It can be changed through the console, configuration files, or command-line parameters.

This variable interacts with other Aftermath-related variables such as:

Developers should be aware that enabling this variable may have performance implications, as capturing callstacks can introduce overhead. It should primarily be used for debugging purposes, especially when investigating GPU crashes or hangs.

Best practices for using this variable include:

  1. Enable it only when necessary for debugging GPU crashes.
  2. Use it in conjunction with other Aftermath variables for comprehensive GPU crash analysis.
  3. Be aware of potential performance impact in production builds.
  4. Consider enabling it conditionally, such as only in editor or development builds.
  5. When enabled, ensure that symbol files are available for accurate callstack resolution.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/RHI.cpp:1144

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarGPUCrashDebuggingAftermathCallstack(
	TEXT("r.GPUCrashDebugging.Aftermath.Callstack"),
	0,
	TEXT("Enable callstack capture in Aftermath dumps"),
	ECVF_ReadOnly
);

static TAutoConsoleVariable<int32> CVarGPUCrashDebuggingAftermathResourceTracking(

#Loc: <Workspace>/Engine/Source/Runtime/D3D12RHI/Private/D3D12Adapter.cpp:667

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());

#Loc: <Workspace>/Engine/Source/Runtime/Windows/D3D11RHI/Private/Windows/WindowsD3D11Device.cpp:1341

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());