VR App Crashing with DatasmithRuntime

Environment:

  • Unreal Engine 5.3.2
  • Windows 10/11
  • Meta Quest Pro

Issue:

I am developing a VR application and using DatasmithRuntime to display 3D data. Occasionally, the application crashes while displaying the 3D data. This issue occurs approximately 1 out of every 10 times with specific data sets. Notably, this issue only occurs in VR mode, not in non-VR mode.

How can I resolve this error?

When running VR Preview in Editor Play, Visual Studio shows the following call stack during the crash:

A breakpoint instruction (__debugbreak() statement or a similar call) was executed in UnrealEditor.exe.

[Inline Frame] UnrealEditor-RenderCore.dll!TRDGHandle<FRDGView,unsigned short>::{ctor}(int InIndex=65536) Line 313
	at E:\UE532\Engine\Source\Runtime\RenderCore\Public\RenderGraphDefinitions.h(313)
[Inline Frame] UnrealEditor-RenderCore.dll!TRDGHandleRegistry<TRDGHandle<FRDGView,unsigned short>,2>::Last() Line 507
	at E:\UE532\Engine\Source\Runtime\RenderCore\Public\RenderGraphDefinitions.h(507)
UnrealEditor-RenderCore.dll!TRDGHandleRegistry<TRDGHandle<FRDGView,unsigned short>,2>::Insert(FRDGView * Object=0x0000087402535130) Line 425
	at E:\UE532\Engine\Source\Runtime\RenderCore\Public\RenderGraphDefinitions.h(425)
[Inline Frame] UnrealEditor-RenderCore.dll!TRDGHandleRegistry<TRDGHandle<FRDGView,unsigned short>,2>::Allocate(FRDGAllocator & Allocator, const wchar_t * const &) Line 441
	at E:\UE532\Engine\Source\Runtime\RenderCore\Public\RenderGraphDefinitions.h(441)
UnrealEditor-RenderCore.dll!FRDGBuilder::CreateSRV(const FRDGBufferSRVDesc & Desc={...}) Line 109
	at E:\UE532\Engine\Source\Runtime\RenderCore\Public\RenderGraphBuilder.inl(109)
[Inline Frame] UnrealEditor-Renderer.dll!FRDGBuilder::CreateSRV(FRDGBuffer *) Line 110
	at E:\UE532\Engine\Source\Runtime\RenderCore\Public\RenderGraphBuilder.h(110)
UnrealEditor-Renderer.dll!FInstanceCullingContext::BuildRenderingCommandsInternal(FRDGBuilder & GraphBuilder={...}, const FGPUScene & GPUScene, FInstanceCullingContext::EAsyncProcessingMode AsyncProcessingMode, FInstanceCullingDrawParams * InstanceCullingDrawParams=0x0000087402533ba0) Line 703
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\InstanceCulling\InstanceCullingContext.cpp(703)
UnrealEditor-Renderer.dll!FInstanceCullingContext::BuildRenderingCommands(FRDGBuilder & GraphBuilder, const FGPUScene & GPUScene, FInstanceCullingDrawParams * InstanceCullingDrawParams) Line 536
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\InstanceCulling\InstanceCullingContext.cpp(536)
UnrealEditor-Renderer.dll!FSimpleMeshDrawCommandPass::BuildRenderingCommands(FRDGBuilder & GraphBuilder={...}, const FSceneView & View={...}, const FGPUScene & GPUScene={...}, FInstanceCullingDrawParams & OutInstanceCullingDrawParams={...}) Line 57
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\SimpleMeshDrawCommandPass.cpp(57)
UnrealEditor-Renderer.dll!FProjectedShadowInfo::RenderProjection(FRDGBuilder & GraphBuilder={...}, const FShadowProjectionPassParameters & CommonPassParameters, int ViewIndex=0, const FViewInfo * View=0x0000087439610000, const FLightSceneProxy * LightSceneProxy=0x00000873f9b45700, const FSceneRenderer * SceneRender=0x0000087426fddc00, bool bProjectingForForwardShading=true, bool bSubPixelShadow=false) Line 1251
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\ShadowRendering.cpp(1251)
UnrealEditor-Renderer.dll!FSceneRenderer::RenderShadowProjections(FRDGBuilder & GraphBuilder={...}, FRDGTexture * OutputTexture=0x00000873ecfdf710, const FMinimalSceneTextures & SceneTextures={...}, const FLightSceneProxy * LightSceneProxy=0x00000873f9b45700, TArrayView<FProjectedShadowInfo const * const,int> Shadows={...}, bool bSubPixelShadow, bool bProjectingForForwardShading=true) Line 2061
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\ShadowRendering.cpp(2061)
UnrealEditor-Renderer.dll!FSceneRenderer::RenderShadowProjections::__l16::<lambda_1>::operator()(FRDGTexture * OutputTexture=0x00000873ecfdf710, bool bSubPixel) Line 2125
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\ShadowRendering.cpp(2125)
UnrealEditor-Renderer.dll!FSceneRenderer::RenderShadowProjections(FRDGBuilder & GraphBuilder={...}, const FMinimalSceneTextures & SceneTextures={...}, FRDGTexture * ScreenShadowMaskTexture=0x00000873ecfdf710, FRDGTexture * ScreenShadowMaskSubPixelTexture=0x0000000000000000, const FLightSceneInfo * LightSceneInfo=0x00000872ff4bc080, bool bProjectingForForwardShading=true) Line 2137
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\ShadowRendering.cpp(2137)
UnrealEditor-Renderer.dll!FDeferredShadingSceneRenderer::RenderForwardShadowProjections(FRDGBuilder & GraphBuilder={...}, const FMinimalSceneTextures & SceneTextures={...}, FRDGTexture * & OutForwardScreenSpaceShadowMask=0x0000000000000000, FRDGTexture * & OutForwardScreenSpaceShadowMaskSubPixel=0x0000000000000000) Line 1030
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\LightGridInjection.cpp(1030)
UnrealEditor-Renderer.dll!FDeferredShadingSceneRenderer::Render(FRDGBuilder & GraphBuilder={...}) Line 3513
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\DeferredShadingRenderer.cpp(3513)
UnrealEditor-Renderer.dll!RenderViewFamilies_RenderThread(FRHICommandListImmediate & RHICmdList={...}, const TArray<FSceneRenderer *,TSizedDefaultAllocator<32>> & SceneRenderers={...}) Line 4574
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\SceneRendering.cpp(4574)
UnrealEditor-Renderer.dll!FRendererModule::BeginRenderingViewFamilies::__l87::<lambda_3>::operator()(FRHICommandListImmediate & RHICmdList={...}) Line 4848
	at E:\UE532\Engine\Source\Runtime\Renderer\Private\SceneRendering.cpp(4848)
UnrealEditor-Renderer.dll!TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamilies'::`87'::FDrawSceneCommandName,`FRendererModule::BeginRenderingViewFamilies'::`87'::<lambda_3>>::DoTask(ENamedThreads::Type CurrentThread=1351867372, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent={...}) Line 209
	at E:\UE532\Engine\Source\Runtime\RenderCore\Public\RenderingThread.h(209)
UnrealEditor-Renderer.dll!TGraphTask<TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamilies'::`87'::FDrawSceneCommandName,`FRendererModule::BeginRenderingViewFamilies'::`87'::<lambda_3>>>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread, bool bDeleteOnCompletion) Line 1265
	at E:\UE532\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h(1265)
[Inline Frame] UnrealEditor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & CurrentThread=ActualRenderingThread, ENamedThreads::Type) Line 866
	at E:\UE532\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h(866)
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall=223) Line 758
	at E:\UE532\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp(758)
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 649
	at E:\UE532\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp(649)
UnrealEditor-RenderCore.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 411
	at E:\UE532\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp(411)
UnrealEditor-RenderCore.dll!FRenderingThread::Run() Line 564
	at E:\UE532\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp(564)
UnrealEditor-Core.dll!FRunnableThreadWin::Run() Line 149
	at E:\UE532\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp(149)
UnrealEditor-Core.dll!FRunnableThreadWin::GuardedRun() Line 71
	at E:\UE532\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp(71)
[External Code]

The variables at the error point in Visual Studio are as follows:

When packaging the application and loading the 3D data, the crash reporter shows the following call stack during a crash:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000010

Hoge_Win64_Shipping!FRHIBufferViewCache::GetOrCreateUAV() [E:\UE532\Engine\Source\Runtime\RHI\Private\RHI.cpp:2037]
Hoge_Win64_Shipping!FRDGBuilder::InitRHI() [E:\UE532\Engine\Source\Runtime\RenderCore\Private\RenderGraphBuilder.cpp:3777]
Hoge_Win64_Shipping!FRDGBuilder::BeginResourcesRHI() [E:\UE532\Engine\Source\Runtime\RenderCore\Private\RenderGraphBuilder.cpp:2969]
Hoge_Win64_Shipping!FRDGBuilder::Execute() [E:\UE532\Engine\Source\Runtime\RenderCore\Private\RenderGraphBuilder.cpp:1817]
Hoge_Win64_Shipping!RenderViewFamilies_RenderThread() [E:\UE532\Engine\Source\Runtime\Renderer\Private\SceneRendering.cpp:4578]
Hoge_Win64_Shipping!TGraphTask<TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamilies'::`44'::FDrawSceneCommandName,`FRendererModule::BeginRenderingViewFamilies'::`44'::<lambda_3> > >::ExecuteTask() [E:\UE532\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1265]
Hoge_Win64_Shipping!FNamedTaskThread::ProcessTasksUntilQuit() [E:\UE532\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:648]
Hoge_Win64_Shipping!RenderingThreadMain() [E:\UE532\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:412]
Hoge_Win64_Shipping!FRenderingThread::Run() [E:\UE532\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:537]
Hoge_Win64_Shipping!FRunnableThreadWin::Run() [E:\UE532\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:149]