r.DumpGPU.Directory
r.DumpGPU.Directory
#Overview
name: r.DumpGPU.Directory
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Directory to dump to.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DumpGPU.Directory is to specify the directory where GPU dump files should be saved. This setting variable is part of Unreal Engine’s rendering and debugging system, specifically for GPU-related diagnostics and performance analysis.
The Unreal Engine subsystem that relies on this setting variable is the rendering core, as evidenced by its location in the RenderCore module (DumpGPU.cpp file).
The value of this variable is set through a console variable (CVar) system. It can be set programmatically or through the console/configuration files. The default value is an empty string.
This variable interacts with another variable named GDumpGPUDirectoryCVar, which is the actual TAutoConsoleVariable object that stores and manages the r.DumpGPU.Directory value.
Developers must be aware that:
- This variable is used to determine where GPU dump files are saved.
- If left empty, the engine may use a default location or may not be able to save dump files.
- The directory specified must be writable by the application.
Best practices when using this variable include:
- Setting it to a known, writable directory when GPU dumps are needed for debugging or performance analysis.
- Ensuring the specified directory has sufficient space for potentially large dump files.
- Clearing or changing the directory regularly to avoid filling up disk space with old dump files.
Regarding the associated variable GDumpGPUDirectoryCVar:
The purpose of GDumpGPUDirectoryCVar is to provide a programmatic interface for the r.DumpGPU.Directory setting within the engine’s code. It allows the engine to read and potentially modify the directory setting at runtime.
This variable is part of the RenderCore module and is used internally by the engine to manage the GPU dump directory setting.
The value of GDumpGPUDirectoryCVar is set when the engine initializes its console variables, and it mirrors the value of r.DumpGPU.Directory.
GDumpGPUDirectoryCVar interacts directly with r.DumpGPU.Directory, as they represent the same setting. It’s also used in conjunction with other GPU dumping-related variables like GDumpGPUUploadCVar.
Developers should be aware that:
- This is an internal engine variable and should not be directly modified in game code.
- Changes to r.DumpGPU.Directory will be reflected in this variable.
Best practices for GDumpGPUDirectoryCVar include:
- Using the appropriate engine functions or console commands to modify the GPU dump directory, rather than attempting to change this variable directly.
- When reading the dump directory in engine code, use the GetValueOnGameThread() method of GDumpGPUDirectoryCVar to ensure thread-safe access.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:150
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
static TAutoConsoleVariable<FString> GDumpGPUDirectoryCVar(
TEXT("r.DumpGPU.Directory"), TEXT(""),
TEXT("Directory to dump to."),
ECVF_Default);
static TAutoConsoleVariable<int32> GDumpGPUUploadCVar(
TEXT("r.DumpGPU.Upload"), 1,
TEXT("Allows to upload the GPU dump automatically if set-up."),
#Associated Variable and Callsites
This variable is associated with another variable named GDumpGPUDirectoryCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:149
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<FString> GDumpGPUDirectoryCVar(
TEXT("r.DumpGPU.Directory"), TEXT(""),
TEXT("Directory to dump to."),
ECVF_Default);
static TAutoConsoleVariable<int32> GDumpGPUUploadCVar(
TEXT("r.DumpGPU.Upload"), 1,
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:2063
Scope (from outer to inner):
file
function FString FRDGBuilder::BeginResourceDump
Source code excerpt:
NewResourceDumpContext->Time = FDateTime::Now();
{
FString CVarDirectoryPath = GDumpGPUDirectoryCVar.GetValueOnGameThread();
FString EnvDirectoryPath = FPlatformMisc::GetEnvironmentVariable(TEXT("UE-DumpGPUPath"));
FString DirectoryPath;
if (!CVarDirectoryPath.IsEmpty())
{
DirectoryPath = CVarDirectoryPath;