Shipping build crashes with DX12 and Raytracing enabled

Hello everyone,

I’ve encountered a problem when enabling DX12 and hardware ray tracing. In a Shipping build, the project crashes on startup with the following error (but only on some machines, even with similar hardware configurations):

Engine Version: 5.5.0 (no additional plugins)

Crash log:

LowLevelFatalError [File:D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp] [Line: 991]
RayTracingDevice->CreateStateObject(&Desc, IID_PPV_ARGS(Result.GetInitReference())) failed
at D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp:663
with error E_INVALIDARG

Reichfall_Win64_Shipping!D3D12RHI::VerifyD3D12Result()
Reichfall_Win64_Shipping!FD3D12PoolAllocator::CreatePlacedResource()
Reichfall_Win64_Shipping!FD3D12RayTracingPipelineCache::FShaderCompileTask::DoTask()
Reichfall_Win64_Shipping!TGraphTask<FD3D12RayTracingPipelineCache::FShaderCompileTask>::ExecuteTask()
Reichfall_Win64_Shipping!UE::Tasks::Private::FTaskBase::TryExecuteTask()
Reichfall_Win64_Shipping!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __ptr64 __cdecl(bool),48>::TTaskDelegateImpl<LowLevelTasks::FTask::Init<UE::Tasks::Private::FTaskBase::Init'::2'::<lambda_1> >'::5'::<lambda_1>,0>::CallAndMove()
Reichfall_Win64_Shipping!LowLevelTasks::FTask::ExecuteTask()
Reichfall_Win64_Shipping!LowLevelTasks::FScheduler::WorkerLoop()
Reichfall_Win64_Shipping!operator<<()
Reichfall_Win64_Shipping!FThreadImpl::Run()
Reichfall_Win64_Shipping!FRunnableThreadWin::Run()

Relevant Code in D3D12RayTracing.cpp:

	// Existing collection objects

	for (int32 CollectionIndex = 0; CollectionIndex < ExistingCollections.Num(); ++CollectionIndex)
	{
		Subobjects[Index++] = D3D12_STATE_SUBOBJECT{ D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION, &ExistingCollections[CollectionIndex] };
	}

	// Done!

	checkf(Index == Subobjects.Num(), TEXT("All pipeline subobjects must be initialized."));

	// Create ray tracing pipeline state object

	D3D12_STATE_OBJECT_DESC Desc = {};
	Desc.NumSubobjects = Index;
	Desc.pSubobjects = &Subobjects[0];
	Desc.Type = StateObjectType;

	VERIFYD3D12RESULT(RayTracingDevice->CreateStateObject(&Desc, IID_PPV_ARGS(Result.GetInitReference()))); // crash!

	INC_DWORD_STAT(STAT_D3D12RayTracingCreatedPipelines);
	INC_DWORD_STAT_BY(STAT_D3D12RayTracingCompiledShaders, NumExports);

	return Result;
}

DirectX Debug Log:

D3D12 ERROR: ID3D12Device::CreateStateObject: Resource bindings for function "RayGen_56888ca624d69fc5" not compatible with associated root signatures (if any): local root signature object: 0x00000181432A6E60:'Unnamed ID3D12RootSignature Object', global root signature object: 0x00000181656E0E20:'Unnamed ID3D12RootSignature Object'. Error detail: Shader CBV descriptor range (BaseShaderRegister=1, NumDescriptors=1, RegisterSpace=4) is not fully bound in a root signature. If the intent is this will be resolved later when this state object is combined with other state object(s), use a D3D12_STATE_OBJECT_CONFIG subobject with D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS set in Flags. [ STATE_CREATION ERROR #1194: CREATE_STATE_OBJECT_ERROR]

D3D12: **BREAK** enabled for the previous message, which was: [ ERROR STATE_CREATION #1194: CREATE_STATE_OBJECT_ERROR ]

Interestingly, as long as I don’t click OK on the error message box, the application appears to work fine.

  • Does anyone have ideas on what might be causing this issue?
  • Is there a workaround for this without modifying Unreal Engine source files?

Any help is appreciated!

Getting the same crash here with my Shipping build. Can play for a time if I ignore the message but then exits.

LowLevelFatalError [File:D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp] [Line: 991]
RayTracingDevice->CreateStateObject(&Desc, IID_PPV_ARGS(Result.GetInitReference())) failed
at D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp:663
with error E_INVALIDARG

0x00007ff6f3722be7 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f36ce005 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f36cfe00 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f36d0c58 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1c9ecf1 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1e39b12 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1c9ff3b UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f36c1811 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f36d8183 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f37f2c04 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f37f5090 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1c9ecf1 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1c8b4bf UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1c8dfee UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1ca0923 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1c87e91 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1d15a74 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1e545a7 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff6f1e54379 UE_StTeilo-Win64-Shipping.exe!UnknownFunction
0x00007ff8b73b259d KERNEL32.DLL!UnknownFunction

Crash in runnable thread Foreground Worker #1

Any help would be great, because disabling Ray Tracing to fix this is not ideal going forward,

Same here, no idea what’s going on…
The first build I did on 5.5 worked, but none after that…

Tried deleting temp/cache files and updated drivers

Hi! This is a known issue and will be addressed in 5.5.1.

In the meantime you can delete %localappdata%\<ProjectName>\Saved\<ProjectName>_PCD3D_SM6.upipelinecache and run with r.ShaderPipelineCache.SaveUserCache=0 which should prevent it from happening again (note that this cvar override should removed once 5.5.1 is released).

2 Likes

Thank you, it runs now!

Thanks! I can confirm that this fixes my issue.