Description

In the Android Vulkan Mobile preview mode, when multiple GPU niagara systems are visible and the user moves the camera around the level it can cause a crash, potentially caused by a race condition on the rendering thread.
The user has provided more details in the UDN case along with an example project.

Steps to Reproduce

Steps to Reproduce (from the licensee):
1. Unzip and launch the attached Repro Project (in the linked UDN case). It should open directly on the NiagaraCrash level. Don't move the viewport camera around in the level since it is perfectly situated to repro the bug
2. Enable the Android Vulkan Mobile preview platform if it is not already active. This can be done via the Settings (top-right corner in the level editor window) -> Preview Platform -> Android Vulkan Mobile.
3. If you didn't crash already select one of the particle systems in the level via the viewport to trigger the crash (selecting stuff via the Outliner tab won't trigger the crash).
Alternatively you could hold down right-click in the Viewport and move the mouse around to change the rotation of the viewport camera (while keeping the niagara GPU instances visible on screen) to trigger the crash.
If you launched the project via the Epic Games launcher, the editor crashes. If you launched the project from Visual Studio you will break on the RangeCheck in the attached callstack a few times in the Repro Project, but in a bigger project with multiple GPU niagara instances in the level you would hit that breakpoint hundreds of times.

Callstack

[Inline Frame] UnrealEditor-Niagara.dll!TArray<TUniquePtr<FNiagaraGPUInstanceCountManager::FIndirectArgsPoolEntry,TDefaultDelete<FNiagaraGPUInstanceCountManager::FIndirectArgsPoolEntry>>,TSizedDefaultAllocator<32>>::RangeCheck(int) Line 758 C++
[Inline Frame] UnrealEditor-Niagara.dll!TArray<TUniquePtr<FNiagaraGPUInstanceCountManager::FIndirectArgsPoolEntry,TDefaultDelete<FNiagaraGPUInstanceCountManager::FIndirectArgsPoolEntry>>,TSizedDefaultAllocator<32>>::operator[](int Index) Line 830 C++
UnrealEditor-Niagara.dll!FNiagaraGPUInstanceCountManager::AddDrawIndirect(FRHICommandListBase & RHICmdList, unsigned int InstanceCountBufferOffset, unsigned int NumIndicesPerInstance, unsigned int StartIndexLocation, bool bIsInstancedStereoEnabled, bool bCulled, ENiagaraGpuComputeTickStage::Type ReadyTickStage) Line 391 C++
UnrealEditor-Niagara.dll!FNiagaraRendererSprites::CreateMeshBatchForView(FRHICommandListBase & RHICmdList, FNiagaraRendererSprites::FParticleSpriteRenderData & ParticleSpriteRenderData, FMeshBatch & MeshBatch, const FSceneView & View, const FNiagaraSceneProxy & SceneProxy, FNiagaraSpriteVertexFactory & VertexFactory, unsigned int NumInstances, unsigned int GPUCountBufferOffset, bool bDoGPUCulling) Line 881 C++
UnrealEditor-Niagara.dll!FNiagaraRendererSprites::GetDynamicMeshElements(const TArray<FSceneView const *,TSizedDefaultAllocator<32>> & Views, const FSceneViewFamily & ViewFamily, unsigned int VisibilityMap, FMeshElementCollector & Collector, const FNiagaraSceneProxy * SceneProxy) Line 1066 C++
UnrealEditor-Niagara.dll!FNiagaraSystemRenderData::GetDynamicMeshElements(const TArray<FSceneView const *,TSizedDefaultAllocator<32>> & Views, const FSceneViewFamily & ViewFamily, unsigned int VisibilityMap, FMeshElementCollector & Collector, const FNiagaraSceneProxy & SceneProxy) Line 230 C++
UnrealEditor-Niagara.dll!FNiagaraSceneProxy::GetDynamicMeshElements(const TArray<FSceneView const *,TSizedDefaultAllocator<32>> & Views, const FSceneViewFamily & ViewFamily, unsigned int VisibilityMap, FMeshElementCollector & Collector) Line 500 C++
UnrealEditor-Renderer.dll!FDynamicMeshElementContext::GatherDynamicMeshElementsForPrimitive(FPrimitiveSceneInfo * Primitive, unsigned char ViewMask) Line 3858 C++
UnrealEditor-Renderer.dll!??R<lambda_1>@?1??LaunchRenderThreadTask@FDynamicMeshElementContext@@QEAA?AV?$TRefCountPtr@VFGraphEvent@@@@$$QEAUFDynamicPrimitiveIndexList@@@Z@QEBA@XZ() Line 3809 C++
[Inline Frame] UnrealEditor-Renderer.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<1>,void __cdecl(void)>::operator()() Line 555 C++
[Inline Frame] UnrealEditor-Renderer.dll!TFunctionGraphTaskImpl<void __cdecl(void),0>::DoTaskImpl(TUniqueFunction<void __cdecl(void)> & Function, ENamedThreads::Type) Line 1733 C++
[Inline Frame] UnrealEditor-Renderer.dll!TFunctionGraphTaskImpl<void __cdecl(void),0>::DoTask(ENamedThreads::Type) Line 1726 C++
UnrealEditor-Renderer.dll!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),0>>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread, bool bDeleteOnCompletion) Line 1235 C++
[Inline Frame] UnrealEditor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & CurrentThread, ENamedThreads::Type) Line 840 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 760 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 651 C++
[Inline Frame] UnrealEditor-Core.dll!FTaskGraphCompatibilityImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) Line 2068 C++
UnrealEditor-Core.dll!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete(const TArray<TRefCountPtr<FGraphEvent>,TSizedInlineAllocator<4,32,TSizedDefaultAllocator<32>>> & Tasks, ENamedThreads::Type CurrentThreadIfKnown) Line 2122 C++
[Inline Frame] UnrealEditor-Renderer.dll!FTaskGraphInterface::WaitUntilTaskCompletes(TRefCountPtr<FGraphEvent> &&) Line 410 C++
UnrealEditor-Renderer.dll!FGraphEvent::Wait(ENamedThreads::Type CurrentThreadIfKnown) Line 974 C++
UnrealEditor-Renderer.dll!FVisibilityTaskData::ProcessRenderThreadTasks() Line 4566 C++
UnrealEditor-Renderer.dll!FMobileSceneRenderer::InitViews(FRDGBuilder & GraphBuilder, FSceneTexturesConfig & SceneTexturesConfig, FInstanceCullingManager & InstanceCullingManager, FVirtualTextureUpdater * VirtualTextureUpdater, FMobileSceneRenderer::FInitViewTaskDatas & TaskDatas) Line 490 C++
UnrealEditor-Renderer.dll!FMobileSceneRenderer::Render(FRDGBuilder & GraphBuilder) Line 1035 C++
UnrealEditor-Renderer.dll!RenderViewFamilies_RenderThread(FRHICommandListImmediate & RHICmdList, const TArray<FSceneRenderer *,TSizedDefaultAllocator<32>> & SceneRenderers) Line 4832 C++
UnrealEditor-Renderer.dll!??R<lambda_3>@?FJ@??BeginRenderingViewFamilies@FRendererModule@@UEAAXPEAVFCanvas@@V?$TArrayView@PEAVFSceneViewFamily@@H@@@Z@QEBA@AEAVFRHICommandListImmediate@@@Z(FRHICommandListImmediate & RHICmdList) Line 5121 C++
[Inline Frame] UnrealEditor-RenderCore.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<1>,void __cdecl(FRHICommandListImmediate &)>::operator()(FRHICommandListImmediate &) Line 555 C++
UnrealEditor-RenderCore.dll!??R<lambda_1>@?4??EnqueueAndLaunch@FRenderThreadCommandPipe@@AEAAXPEB_WAEAIUTStatId@@$$QEAV?$TUniqueFunction@$$A6AXAEAVFRHICommandListImmediate@@@Z@@@Z@QEBA@XZ() Line 1751 C++
[Inline Frame] UnrealEditor-RenderCore.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<1>,void __cdecl(void)>::operator()() Line 555 C++
[Inline Frame] UnrealEditor-RenderCore.dll!TFunctionGraphTaskImpl<void __cdecl(void),1>::DoTaskImpl(TUniqueFunction<void __cdecl(void)> & Function, ENamedThreads::Type) Line 1733 C++
[Inline Frame] UnrealEditor-RenderCore.dll!TFunctionGraphTaskImpl<void __cdecl(void),1>::DoTask(ENamedThreads::Type) Line 1726 C++
UnrealEditor-RenderCore.dll!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),1>>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread, bool bDeleteOnCompletion) Line 1235 C++
[Inline Frame] UnrealEditor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & CurrentThread, ENamedThreads::Type) Line 840 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 760 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 651 C++
UnrealEditor-RenderCore.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 413 C++
UnrealEditor-RenderCore.dll!FRenderingThread::Run() Line 566 C++
UnrealEditor-Core.dll!FRunnableThreadWin::Run() Line 149 C++
UnrealEditor-Core.dll!FRunnableThreadWin::GuardedRun() Line 71 C++

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-230511 in the post.

0
Login to Vote

Fixed
ComponentUE - Niagara
Affects Versions5.4.4
Target Fix5.6
Fix Commit38218883
CreatedNov 14, 2024
ResolvedNov 21, 2024
UpdatedNov 21, 2024
View Jira Issue