DX12 Graphics Crash in Editor, Force DX11 Fixes It

I am getting constant editor crashes ranging from immediately on project open to 5 minutes after opening the project. Running with command args -force-d3d11 appears to fix the crashes. The issue first appeared in the project created in 6000.3.1f1 and after updating to the latest version 6000.3.4f1 is still constant. Project is using URP. PC GPU is 2060 Super 8gb running latest studio drivers 591.74 but this issue was still constant with driver version 581.57.

I am currently unsure how to further debug this issue. If anyone else has encountered anything similar, advice would be appreciated. Please also let me know if there is any more detail that needs to be added to this post.

Here is the crash log when running with args -force-d3d12-debug:

d3d12 validation error (catergory: 9, id: 232): ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware).
d3d12: CreateCommandAllocator failed (887a0005).
d3d12: Device failed error (887a0005).
d3d12: Device removed reason (887a0006).
d3d12: GfxDevice was not out of Local memory
d3d12: Local memory usage:
 Budget: 7589593088
 CurrentUsage: 1408757760
 AvailableForReservation: 67108864
 CurrentReservation: 3929014272
d3d12: GfxDevice was not out of Non-Local memory
d3d12: Non-Local memory usage:
 Budget: 15867766784
 CurrentUsage: 655962112
 AvailableForReservation: 0
 CurrentReservation: 8068101120

Prior to the crash there was a lot of similar errors logged (around 900 lines of them):

d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000228F5AD27D0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1145)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282A92BAC0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1269)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x0000022932397650:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1253)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000228F5AD4D80:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1129)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000228F5AD0EB0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1080)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282AC51670:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:984)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000228F5AD40F0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1115)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282AC55540:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1006)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282AC59410:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1021)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282AC56E60:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1035)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282AC5D2E0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1050)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000228F5AD3460:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1065)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000228F5AD5A10:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1096)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x0000022932391E60:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1160)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000229323911D0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1191)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000229323950A0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1208)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x0000022932392AF0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1225)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x00000229323969C0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1237)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282A92C750:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1283)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282A92AE30:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1299)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282A92A1A0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1314)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282A92D3E0:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1332)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 921): ID3D12CommandQueue1::ExecuteCommandLists: An ID3D12Resource object (0x000002282A92F990:'D3D12ScratchBufferInternal::D3D12ScratchBufferInternal() ScratchBuffer (tag:1347)') referenced in a command list (0x0000022976E5A980:'Async command list (RenderPass)') was deleted prior to executing the command list.  This is invalid and can result in application instability.
d3d12 validation error (catergory: 9, id: 232): ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an u

This was the crash log previously without debug args:

d3d12: swapchain present failed (887a0005).
d3d12: swapchain present failed (887a0005).
d3d12: Device failed error (887a0005).
d3d12: Device removed reason (887a0006).
d3d12: GfxDevice was not out of Local memory
d3d12: Local memory usage:
 Budget: 7589593088
 CurrentUsage: 1280516096
 AvailableForReservation: 67108864
 CurrentReservation: 3929014272
d3d12: GfxDevice was not out of Non-Local memory
d3d12: Non-Local memory usage:
 Budget: 15867766784
 CurrentUsage: 1763643392
 AvailableForReservation: 0
 CurrentReservation: 8068101120
Unrecoverable D3D12 device error! Run with -force-d3d12-debug and see logs for more info.
Cannot use DisplayDialog because it was run from a thread that is not the main thread: Fatal Error! Unrecoverable D3D12 device error! Run with -force-d3d12-debug and see logs for more info.

I’d file a bug report if it is consistnent

Check if you have HAGS enabled, and if so, turn it off (I think you have to reboot). It can cause GPU “time outs”. I’ve had driver-level popups of timeouts recently, mostly during high-load situations (open Unity project alongside Rider and other apps). Since disabling HAGS I’ve not had these anymore

HAGS = Hardware-Accelerated GPU Scheduling
It’s in Windows settings, somewhere under Graphics.

Hey, seems like the same issue as Debugging player 6.3 upgrade. Are you by any chance able to report a bug on this with a project that reproduces this issue?

We’re hitting DirectX 12 crashes consistently, on every 6.3 project, across multiple teams, and multiple computers. New Unity versions are sadly unusable if you need any DX12 features, we had to downgrade to 6.2 for now.
Filed an incident report on our test playground project, IN-132982! I hope it helps come to a solution more quickly!

All the best,
Sam

Curious that just going back to 6.2 seems to have fixed it for you. Are you absolutely certain this is the case? In case crashes still occur, just less frequently or under different circumstances.

I and many others have zero issues with DX12 so I’m suspecting a combo of a system issue triggered by Unity (bug or otherwise). DX12 problems have been plaguing some users in various ways ever since 6.1 made DX12 the default, and they were all “fixed” by switching to DX11.

In case you have the opportunity to do a clean Windows install from scratch on a system that previously crashed I’d be curious to hear if that fixes the crashes.

Me too. I just updated my project from Unity 6.2 to 6.3 (deleted Library folder before the update), and it gives “Unrecoverable D3D12 Device” when I open my main scene (not clean/basic scenes, maybe is some model or shader).

I think its same problem like here: Unity Light Baking Crash On Unity 6000.3.2f1 - #19 by unity_27NFUoGCKItEVA

We have a fix for this issue, it just landed to 6.5 alpha: Unity Issue Tracker - Crash on CheckDeviceStatus when moving in the scene view on a specific scene

We will be backporting the fix to Unity 6.3 and 6.4.

Any thoughts on when this backport will occur? I just upgraded from 6.2 to 6.3 and have this very problem. It was perfectly fine in 6.2

It was released in 6000.3.9f1 yesterday. What version did you upgrade to?

3.8…naturally lol figures. missed the fix by 1 day

Should note, when i readded dx12 back then activated auto api, the editor restarted then crashed with a UNKNOWN error.
Once i removed the -force-d3d11 it loaded fine.

=================================================================
	Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at UnityEditor.Search.LMDBIndexStorage:Internal_MergeArtifacts_Injected <0x000f3>
	  at UnityEditor.Search.LMDBIndexStorage:Internal_MergeArtifacts <0x0023a>
	  at UnityEditor.Search.LMDBIndexStorage:MergeArtifacts <0x002d2>
	  at UnityEditor.Search.SearchDatabase:MergeArtifacts <0x0086a>
	  at <>c__DisplayClass131_1:<ProcessIncrementalUpdate>b__2 <0x000d2>
	  at <>c__DisplayClass54_0:<RunThread>b__0 <0x00224>
	  at System.Threading.ThreadHelper:ThreadStart_Context <0x001ad>
	  at System.Threading.ExecutionContext:RunInternal <0x0061d>
	  at System.Threading.ExecutionContext:Run <0x0008a>
	  at System.Threading.ExecutionContext:Run <0x001e2>
	  at System.Threading.ThreadHelper:ThreadStart <0x000d2>
	  at <Module>:runtime_invoke_void__this___object <0x00325>
=================================================================

Editor.txt (830.6 KB)

That looks unrelated. Does it reproduce reliably with -force-d3d11?

No seems to have just been the once. shrug

Just updated to 6000.3.9f1 and still crashes constantly. Not fixed.

For reference, for everyone, since I haven’t mentioned this here yet:

Re-install (latest stable) graphics driver with the “force firmware reset” option that the installers have a checkbox for. You may need to use the “custom” install choice to see it.

There had been two reports by now where doing that had fixed DX12 related issues. Perhaps it also helps with persistent crashes.

It didnt work, though the timing between crashes extended to 4-5 minutes rather than 30seconds.

Hi,

I also see random crashes in Unity 6.3 in DX12, every other project i converted that worked fine just crashes, both URP and HDRP ones.

I assume under certain conditions all projects would crash, just have not activated them yet in few.

This is totally unacceptable and there is no real solution than Unity stop defaulting to DX12 as is simply not working.

Please consider removing DX12 as default, as its state currently is completely broken. And add a big warning to not use it also.

Plus DX12 is much slower than DX11, so is generally a version to avoid.

Note that i don’t see these crashes at all when change to DX11 or Vulkan in all affected projects.

Thanks

Please file bug reports so we could fix those issues. The vast majority of users are not seeing crashes that you are so you must be running into some corner cases.