Unreal Engine crashing with a GPU crash or "D3D device lost": how to find the cause and fix it
A frequent reason Unreal Engine 5 closes suddenly on Windows is a GPU crash: the graphics card or its driver stops responding and the D3D device is lost. Confirm that in the log first, then update the driver, free up video memory, and only after that look at the Windows TDR timeout and the engine's debug options.
On this page
What it means
"Unreal Engine crashing" covers several different failures. A crash is any problem the program cannot recover from. Some come from a deliberate failed check in the code (an assert), and others from bugs in a plugin, in project code or in an asset. This article deals with one frequent cause in both the editor and games: the GPU crash.
In a GPU crash, the graphics card or its driver stops responding and the D3D device is lost. The CPU callstack in the crash report then only shows what the CPU was doing at that moment, so it usually does not point at the real cause. That is why the log matters more than the callstack here.
If the crash happens right at launch and the log says nothing about the GPU, start with Game crashes on startup on Windows. For the same error inside a particular game, see DXGI_ERROR_DEVICE_HUNG (0x887A0006) and Apex Legends DXGI_ERROR_DEVICE_REMOVED.
Symptoms and causes
You are likely dealing with this problem if:
- The editor or game closes suddenly, or shows a "GPU Crash" or "D3D Device Lost" message.
- The log contains
DXGI_ERROR_DEVICE_REMOVED,DXGI_ERROR_DEVICE_HUNGor "GPUCrash - exiting due to D3D device being lost - D3D Hung".
The usual causes, most common first:
- GPU out of video memory (VRAM)
- Large scenes, high resolutions, several open viewports or other GPU-heavy programs can fill VRAM.
- Windows TDR timeout
- Timeout Detection and Recovery resets the GPU when a single operation takes longer than the timeout. Heavy ray tracing, Lumen and similar work can trigger it.
- Engine, driver or OS bug
- Epic also lists a bug in engine code, in the graphics driver or in the operating system as possible causes.
- Hardware problem
- A faulty or unstable graphics card can produce the same error.
How to fix it
Work through these in order. They start with the quickest, safest checks and move to deeper repairs; stop as soon as the problem is gone.
1.Confirm it is a GPU crash by reading the log
The fixes below only apply to GPU crashes. The log tells you whether yours is one.
- For the editor, open the project folder and look in
Saved/Logsfor the logs andSaved/Crashesfor crash reports. - For a packaged game on Windows, open the crash folder under your user profile.
C:\Users\<user>\AppData\Local\<Project>\Saved\Crashes - Open the newest log in a text editor and search for
DXGI_ERROR_DEVICE_REMOVED,DEVICE_HUNGorGPUCrash. A hit means this is a GPU crash. No hit means a CPU-side crash, and the callstack inSaved/Crashesis what you need to follow.
2.Update the graphics driver
Epic points to driver bugs as a possible cause of GPU crashes, so a current driver is the cheapest thing to rule out.
- Download the latest driver from your GPU vendor's own website (NVIDIA, AMD or Intel) and install it.
- Restart the PC and run the project again.
3.Free up video memory
Running out of VRAM is one of the causes Epic documents.
- Open Task Manager, go to Performance and select your GPU. Watch Dedicated GPU memory while the editor or game runs.
- Close other GPU-heavy programs, such as browsers with many tabs, other games or video tools.
- In the editor, lower the viewport Screen Percentage or the resolution, and keep only one viewport open.
- If you build the project, use lower-resolution textures and meshes or add culling.
4.Split heavy ray tracing work into tiles
If the crash is a TDR timeout caused by one very long GPU operation, tiling splits it into several shorter ones, each a separate GPU command buffer.
- Set both console variables to a value above 0. Each tile then becomes its own command buffer.
r.RayTracing.GlobalIllumination.RenderTileSize r.RayTracing.Reflections.RenderTileSize
5.Narrow down an engine or driver bug with launch options and console variables
These options help show whether the crash comes from a threading or timing problem, a render pass or a specific feature.
- Launch once with
-gpucrashdebugging, and separately once with-d3ddebug. Do not combine the two. - Test with
-onethreadand-forcerhibypassto look for threading or timing problems. - Set
r.RDG.Debug=1to report render passes that were not set up properly. Setr.RDG.ImmediateMode=1for more useful callstacks (it may change behavior). - Switch the RHI, for example from DX12 to DX11. Hardware ray tracing needs DX12.
- Toggle Lumen, Nanite and Ray Tracing, or hide objects in the scene, to find which one triggers the crash.
6.Raise the Windows TDR timeouts
Gives the GPU more time before Windows resets it.
Before you start: This edits the registry. Create a restore point first (search for Create a restore point in the Start menu) and change only the two values below.
- Press WinR, type
regeditand press Enter. - Go to this key.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers - Create a DWORD (32-bit) Value named
TdrDelayand set it to60(decimal). - Create a second DWORD (32-bit) Value named
TdrDdiDelayand set it to60(decimal). Note the spelling: one place in Epic's page writes it differently, butTdrDdiDelayis the correct name. - Restart the PC.
7.Report the crash
If you have narrowed it to an engine or driver bug, a report is the way to get it fixed.
- Note that editor builds compiled from source do not send crash data to Epic.
- For packaged builds, enable Include Crash Reporter in the project packaging settings, or set the value below in
Config/DefaultGame.ini.IncludeCrashReporter=True - As of UE 5.4, Epic does not receive reports from packaged builds. Reports go to the endpoint you set as
DataRouterUrlunder[CrashReportClient].
Check that it worked
- Run the same scene or level that crashed before, for longer than it used to survive, without the editor or game closing.
- Check the newest file in
Saved/Logsand confirm it has noDXGI_ERROR_DEVICE_REMOVED,DEVICE_HUNGorGPUCrashentries. - Watch GPU memory in Task Manager and make sure it stays below the card's limit.
If it still fails
- If the log shows no GPU error, the crash is not a GPU crash. Use the callstack in
Saved/Crashesto look for a faulty plugin, project code or a corrupted asset. - If the crash returns after the driver, VRAM and TDR steps, test with the other RHI (DX11 or DX12) and with Lumen, Nanite and Ray Tracing toggled to find the trigger, then report it with the log.
- Repeated device-lost errors in several different programs can point to failing hardware. Test the card in another game or on another PC if you can.
- Epic's own documentation and forums are the place to ask about engine bugs.
Questions
Does the same advice apply on macOS or Linux?
The sources used here cover Windows only. The log and registry paths above are Windows paths.
Sources
- How to Fix a GPU Driver Crash When Using Unreal EngineOfficial · Epic Games
- Crash Reporting in Unreal EngineOfficial · Epic Games