A GPU crash can cause the Unity Editor to close unexpectedly and return a graphics error, for example, Unrecoverable D3D12 device error! Run with -force-d3d12-debug and see logs for more info. Diagnosing these crashes is often difficult because the cause might not be in your project’s code. This page explains how to identify the source of a GPU crash and provides a set of steps to troubleshoot and resolve GPU crashes.
There are a number of errors that you might encounter that are referred to as GPU crashes when developing in Unity:
Unity doesn’t communicate directly with your GPU. Instead, it relies on a layered driver stack between your project and the hardware. This stack contains multiple dynamic link-libraries (DLLs). Each library acts as a bridge in the rendering pipeline, handling tasks like shader compilation, resource management, and command translation.
When something goes wrong in one of these DLLs, the impact can be severe. Because they operate at the system level, traditional debugging methods are often inadequate. You can still get valuable insights from driver symbol servers, but you can’t step through the driver code like you can with your own code.
Therefore, understanding the graphics driver architecture is essential. The flow is as follows:
User-mode drivers are complex as they’re responsible for compiling shaders, managing GPU memory and resources, and often working around bugs in applications.
A crash usually occurs when the driver encounters an unexpected situation, such as:
Before troubleshooting the driver directly, it’s important to rule out other system-level issues.
Perform the following checks:
sfc /scannow, followed by DISM /Online /Cleanup-Image /RestoreHealth.A crash is typically either a graphics driver issue or a GPU hardware issue.
To find the cause, you need to examine the crash log. For the location of crash reports on your computer, refer to the Log files reference.
Common symptoms of a GPU-related failure include:
If Unity intercepts the crash, you can examine the stack trace at the end of the Editor.log file. A graphics-related failure typically shows a specific stack trace that involves Unity’s rendering thread and the graphics API. Look for these key markers:
GfxDeviceWorker::RunGfxDeviceWorker. This indicates the engine failed while dispatching instructions to the GPU rather than during standard game logic.D3D12Fence::Wait.Device failed error (887a0006) or Device removal.d3d12: GfxDevice was not out of Local memory.A call stack might look like the following example:
========== OUTPUTTING STACK TRACE ==================
0x00007FFF7F3580DA (KERNELBASE) RaiseException
0x00007FFDF037F596 (Unity) LaunchBugReporter
0x00007FFDF0BC03A7 (Unity) EditorMonoConsole::LogToConsoleImplementation
0x00007FFDF0BC0EE3 (Unity) EditorMonoConsole::LogToConsoleImplementation
0x00007FFDF2AA2ED8 (Unity) DebugStringToFilePostprocessedStacktrace
0x00007FFDF2AA26E1 (Unity) DebugStringToFile
0x00007FFDF21608F5 (Unity) CheckDeviceStatus
0x00007FFDF21CB7A2 (Unity) CheckCompletedValue
0x00007FFDF21D1E70 (Unity) D3D12Fence::Wait
0x00007FFDF2195721 (Unity) GfxDeviceD3D12::QueuePresent
0x00007FFDF21C20DE (Unity) D3D12Window::EndRendering
0x00007FFDF1D077CD (Unity) GfxDeviceWorker::RunCommand
0x00007FFDF1D09FCC (Unity) GfxDeviceWorker::RunExt
0x00007FFDF1D0A0FF (Unity) GfxDeviceWorker::RunGfxDeviceWorker
0x00007FFDF2AC12FC (Unity) Thread::RunThreadWrapper
0x00007FFF80CBE8D7 (KERNEL32) BaseThreadInitThunk
0x00007FFF81F2C53C (ntdll) RtlUserThreadStart
========== END OF STACKTRACE ===========
The log might also point to the exact script or asset that caused the GPU to enter a fatal state. For example, a reference to CreateResources in the log might trace back to a specific script and line number:
CreateResources
...
GPUCrash:CreateResources () (at Assets/GPUCrash.cs:25)
GPUCrash:Update () (at Assets/GPUCrash.cs:47)
To view detailed logs, check the following prerequisites:
-force-d3d12-debug-force-d3d12-editor-pix-events
Note: You can also use the argument -force-d3d12-debug-gbv to return crash information, however, it’s recommended only as a secondary step in the debug process. It enables GPU-based validation (GBV), which can add a large amount of debug information to crash logs. Analyze the log without this flag first to avoid the production of large files.
These arguments enable Microsoft’s Device Removed Extended Data (DRED) API, which can provide more insight into the GPU state at the time of the crash.
When viewing the log, validation errors are displayed as d3d12 validation error: <message>.
For most crashes, the name of the .dll file in your crash log is the key to identifying the source. The vast majority of these happen in a User-Mode Driver (UMD), which translates commands from graphics APIs like DirectX into instructions your GPU can understand.
| DLL file | Manufacturer | Type | Description |
|---|---|---|---|
amdxc64.dll |
AMD | UMD | Detects whether DirectX, OpenGL or Vulkan graphics API is in use. |
atidxx64.dll |
AMD | UMD | Translates DirectX API calls, shaders, and resources into GPU-specific structures. |
igc64.dll |
Intel | UMD | Compiles HLSL or GLSL into optimized machine code for Intel GPU architectures. Crashes here often indicate shader compilation issues. For example, this might be caused by a shader that uses features in an unexpected way or hits compiler bugs. |
igd10um64.dll |
Intel | UMD | Translates DirectX API calls, shaders, and resources into GPU-specific structure for older Intel GPUs, for example Intel HD/UHD Graphics pre–11th gen. |
igd10um64xe.dll |
Intel | UMD | Translates DirectX API calls, shaders, and resources into GPU-specific structures for modern Xe architecture (11th Gen Core and newer, including Arc GPUs). |
nvwgf2umx.dll |
NVIDIA | UMD | Translates DirectX API calls, shaders, and resources into GPU-specific structures. |
nvoglv64.dll |
NVIDIA | UMD | If you target OpenGL instead of DirectX, this translates OpenGL API calls, compiles GLSL shaders, and manages the entire OpenGL rendering pipeline. |
After identifying the driver, follow these steps to resolve the issue.
Updating a driver isn’t always enough to fix a crash. A clean installation removes all old and potentially corrupt files before installing a fresh version.
AMD:
NVIDIA:
Intel:
If the crash persists, try installing an older version of a driver.
Corrupted shader caches maintained by Unity and the graphics driver can cause recurring compilation crashes. To clear the caches completely, delete the contents of the following folders:
| Type of cache | Location | Description |
|---|---|---|
| Unity’s shader cache | Library/ShaderCache |
Delete the contents of this folder to clear the project Library shader cache for the Unity Editor. |
| Driver shader caches |
%LOCALAPPDATA%\AMD\DxCache %LOCALAPPDATA%\AMD\DxcCache %LOCALAPPDATA%\AMD\VkCache %LOCALAPPDATA%\AMD\GLCache %LOCALAPPDATA%\AMD\DX9Cache %LOCALAPPDATA%\Intel\ShaderCache %LOCALAPPDATA%\NVIDIA\DXCache %LOCALAPPDATA%\D3DSCache %ProgramFiles(x86)%\Steam\steamapps\shadercache
|
Delete the contents of these folders to clear the driver shader cache for the built Player. |
After clearing these caches, restart your computer to ensure no cached shaders remain in memory.
If the crash is specific to DX12, you can temporarily revert to DX11 while you investigate the root cause. Use the D3D12 Device Filtering Asset to create a fallback.
If you have tried the solutions in this document and the crash still persists, you can submit a bug report. When you submit your report, include as much detail as possible and list the steps to reproduce the issue.
For more information on reporting bugs, refer to How to report bugs.