Preventing Nanite pop-in issues in 2D rendering use cases

Hi Sam, I have copied the relevant parts of the UDN ticket regarding the crash below:

We have an Engine crash in theNaniteStreamingManagerwhen we load some large models of our vehicles.

Unfortunately the logs do not provide much information, but we can easily replicate the problem in the Editor

appError called: Assertion failed: AllocatedPagesSize <= ( 1u << 31 ) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Rendering\NaniteStreamingManager.cpp] [Line: 1442]

The answer in the ticket was this one:

The limit you are hitting here is that the Nanite page pool is limited to 2GB. This is the API limitation in D3D12 for buffer sizes, which is hard to get around.

The page pool contains all the Nanite geometry data. We don’t currently have support for splitting the data over multiple buffer.

In this pool there are two types of pages. Streaming pages that are loaded/unloaded based on what is visible in the scene and root pages that are always loaded. By default each unique mesh in the scene has one root page, which guarantees that no matter what the streaming state is we always have something to draw for every mesh.

Streaming pages are 128KB each and root pages are 32KB each. What is happening here is that the sum of the two get over this hard limit of 2GB.

The memory dedicated to streaming pages is fixed and controllable with r.Nanite.Streaming.StreamingPoolSize. It defaults to 512MB.

Root pages allocated based on how many unique meshes are in the scene. So if the streaming pool size is at the default 512MB. That probably means you have more than 1536MB / 32KB = 49152 unique meshes in the scene.

I think the only real mitigation here is trying to reduce the number of unique meshes somehow, or reducing r.Nanite.Streaming.StreamingPoolSize, especially if it is larger than the default.

Ah, and one more thing. On each mesh there is a Residency setting that defaults to minimal (32KB), but can be adjusted higher. If you are nowhere near these high object counts, then maybe some of your objects use a higher residency than what is required.

Thanks much,

Jan