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!

5 Likes

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).

7 Likes

Thank you, it runs now!

Thanks! I can confirm that this fixes my issue.

1 Like

Hi, where to put the r.ShaderPipelineCache.SaveUserCache=0? Have tried to add it in project’s defaultengine.ini and defaultgame.ini, also have it in game used in BP. But pipelinecache is still created after each shipping build play session.

4 Likes

would like to know that too.

meanwhile you can create an empty _PCD3D_SM6.upipelinecache yourself, then set it to read only. saves you the time to delete the file after every run.

1 Like

(post deleted by author)

Hi! I have updated to version 5.5.1, but the issue still persists. I have to manually delete the _PCD3D_SM6.upipelinecache file each time before I can run it.

I also have the same problem in 5.5.1 and shipping builds.

Seem to stuck to black screen now instead of crashing. The empty readonly upipelinecache file work nicely, but require quite messy trick from game testers.

Couldn’t be addressed, at the end @TiagoCostaUE ?

Tons of users complaining about and still without being able to package, everywhere.

1 Like

Yes, issue still there in 5.5.1 sadly

1 Like

I imagine that a problem that prevents the final product of your users to work should be a priority issue… or not? and how disgusting is the habit these days of companies to first say that we should not worry, that everything will be fixed in the next version, and as soon as it is not fixed, we only hear silence from them… most likely because of this type of mentality is the reason why the video game industry is in crisis.

2 Likes

Unfortunately the previous fix didn’t address all causes of this issue and that wasn’t detected in time for 5.5.1.

There will be a workaround for this issue in 5.5.2 and further improvement is already in UE5/Main for a future release.

2 Likes

(post deleted by author)

Thank you @TiagoCostaUE ,

As there are a few major bugs, like this one, do you think (I understand you can’t give a date, but your personal opinion, if you can) 5.5.2 will be more or less urgent, maybe arriving before the end of the year? Or totally impossible? (any opinion or very rude approximation would be great, anyway) Just to keep the hope, or find an alternative and change our dev strategy (we are close to release and our project is already ready into UE5.5, just waiting to package or deciding to release based on 5.3).

Thank you very much

Using version 5.5.1: Disabling MegaLights from project settings seems to have solved the issue for me.

1 Like

Any info on where this file can be found? I can certainly wait for 5.5.2 before I publich but I would like to be able to test my built game ASAP. If this workaround can help me do that then great… so… the location of that file…? Anyone? :slight_smile:

Thanks in advance