UE5.3 Issue with ParticleAttributeReader and particle subsetting in SimulationStages

Hey folks, I just recently started making myself familiar with gpu work via Niagara when I stumbled upon an error I wasn’t able to find a lot of information about.

LogNiagara: Error: Particle read DI reading self 'NiagaraSystem.Emitter' on stage 'StageName' is unsafe, please disable partial writes on the stage.

LogNiagara: Warning: [AssetLog] NiagaraSystem.uasset: Simulation stage 'StageName' is incompatible with particle state iteration due to killing particles or disabling particle updates. -

What I found out by analyzing the logs, looking a bit into source code and testing various combinations within the niagara system is that there seems to be a clash between subsetting particles in a simulation stage with “Particle Iteration State Enabled” and using a Particle Attribute Reader in the same emitter (does not have to be the same simulation stage tho).

I assume it has to do with the parallel processing nature of the gpu and reading/writing to the same buffer however I was not able to get a satisfying explanation yet of why this error is thrown.
Would love to get some insight from gpu experts or people who know how this particle subsetting works from a technical POV and why this process might cause errors down the road. Maybe there are ways to circumvent this error, maybe epic is working on a solution already but it could also be that this is just how gpus work and nothing we/epic could do about it.

Thanks, if you need more input for how you could reproduce this error let me know :slight_smile:

I have the same issue. I’m trying to use particle<>particle interactions but only on a subset of the particles, for performance reasons. I get the same error

I encountered the same issue in UE5.6.

In my case, adding a Scratch Pad Module to the Simulation Stage that was causing the issue eliminated the error. Disabling this module does not cause the issue to occur, but deleting it causes the issue to reappear.

image

Alternatively, setting the Execute Behavior to “Not on Simulation Reset” may also resolve the issue. In this case, no additional modules are required.

I am not sure why this behavior occurs, but I hope this information is helpful to those who need to address this issue.