Nanite Landscape crash when building it

Hello,

I’ve experienced a nanite crash under 5.3.1, happening 100% of the time :

  • Turn on Nanite on the landscape
  • Click on build data or rebuild data
Assertion failed: Pair != nullptr [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Map.h] [Line: 671]

UnrealEditor_Landscape!ALandscapeProxy::ExportToRawMeshDataCopyNew() [D:\build\++UE5\Sync\Engine\Source\Runtime\Landscape\Private\LandscapeEdit.cpp:4187]
UnrealEditor_Landscape!ALandscapeProxy::ExportToRawMeshDataCopy() [D:\build\++UE5\Sync\Engine\Source\Runtime\Landscape\Private\LandscapeEdit.cpp:3853]
UnrealEditor_Landscape!`ULandscapeNaniteComponent::InitializeForLandscapeAsync'::`2'::<lambda_1>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Landscape\Private\LandscapeNaniteComponent.cpp:209]
UnrealEditor_Landscape!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),0> >::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1265]
UnrealEditor_Core!`LowLevelTasks::FTask::Init<`FTaskGraphCompatibilityImplementation::QueueTask'::`5'::<lambda_1> >'::`11'::<lambda_1>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\Task.h:499]
UnrealEditor_Core!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48>::TTaskDelegateImpl<`LowLevelTasks::FTask::Init<`FTaskGraphCompatibilityImplementation::QueueTask'::`5'::<lambda_1> >'::`11'::<lambda_1>,0>::CallAndMove() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\TaskDelegate.h:171]
UnrealEditor_Core!LowLevelTasks::FTask::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\Task.h:627]
UnrealEditor_Core!LowLevelTasks::FScheduler::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:172]
UnrealEditor_Core!LowLevelTasks::FScheduler::TryExecuteTaskFrom<LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue,&LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue::DequeueGlobal,0>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:350]
UnrealEditor_Core!LowLevelTasks::FScheduler::WorkerMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:378]
UnrealEditor_Core!UE::Core::Private::Function::TFunctionRefCaller<`LowLevelTasks::FScheduler::CreateWorker'::`2'::<lambda_1>,void __cdecl(void)>::Call() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Templates\Function.h:480]
UnrealEditor_Core!FThreadImpl::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\Thread.cpp:69]
UnrealEditor_Core!FRunnableThreadWin::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:149]

I’ve tried many thing to fix it :

  • Removing Materials
  • Transfering the landscape heightmap/material to a whole new landscape (this is working until i’m re-importing weight paint)
  • turning off many option.
2 Likes

Hello Aherys,

I was unable to reproduce this in 5.3.1

  1. Created a new ‘Basic’ level
  2. Open Landscape tool and created a landscape with default settings
  3. Enabled ‘Enable Nanite’ on the Landscape
  4. Tried ‘Build Data’ and ‘Rebuild Data’ after sculpting in both Landscape Mode and Selection Mode.

It sounds like weight-painting is required for this crash?

Please consider expanding upon the repro steps and submitting a bug report.

Hello Astrotronic,

Yes, weight painting is required for this.
I’ve attached a bunch of heightmap :












When those heightmap are set on the landscape, then build with nanite, this where the crash occure.

I have the same problem. Enable Nanite, click Build Data and it says "Building Nanite Landscape Mesh (0 of 256). Sits at 0% for about 5 minutes and then UE 5.3.1 just shuts down back to desktop.

Yep, exactly same issue (it’s just not 256 mesh for me, but 4)

How big is the landscape? 8K landscapes are known to pretty much be a guaranteed crash, but haven’t had issues with smaller ones.

2km square, 1009x1009 resolution.

And the crash doesn’t really look like any kind of memory/vram limitation, it’s just a tpair misscatching.

Weird, converting less than 8k landscapes works perfectly fine for me and a lot of others it seems. Maybe validate your engine install or try in a new project? I assume you have tried another landscape to see if it’s specific to that actor?

No, it’s not coming from the the engine, and yes, a new project will work : it’s as mentionned coming from the weight paint.

Same issue. Crash 5.3.1 when activate Nanite on Landscape and save or build.

Unfortunately, 5.3.2 didn’t fix the issue.

1 Like

Not sure, but seem to be the visibility mask and flagged to be resolved for 5.4 :

1 Like

I am getting the same crash.

You can use the cvar (console command) : landscape.nanite.marchingsquarevisibility=false.
Epic changed the algorithm to export Landscapes to raw meshes, but the new algorithm is unstable. This cvar will rollback to the previous algorithm.
There is a fix on Epic’s main branch (they also removed the old algorithm and the cvar), but it isn’t really trivial to integrate. But it is very likely to be fixed properly for 5.4.

6 Likes

That godtiers dude.

1 Like

It does work, you just need around 200 gb of “ram” for a 8k map, and with ram i don’t mean you actually need to have it as real ram, a big enough pagefile also works (google how to increase your windows pagefile size), it took me around 90 minutes, where my computer is totally unresponsive for the first 30 minutes, cause it is filling up the ram/pagefile, in the next 30 minutes the progress bar start to move slowly and you can use your computer a bit, this is where it takes the info it stored in the ram/pagefile and use it, then you also have to save the project to disk and that is another 30 minutes… Don’t know why they made that way, it’s very stupid to not take it in chunks and try to store it all in memory at once, but if you have the harddrive space (don’t have to be your default drive or a fast one) and the patience, it can be done… Just increase your pagefile (and if use a pagefile on another drive than the default one, set the one on the default one to a fixed size also, cause it uses that one first and if your system disk is small, it is going to fill it completely, and that will also make your system less responsive), go do something else while it works and only build nanite when your are done with your landscape :smiley: Ohh and also, it does not clear up your memory and pagefile properly after it is done, so you also have to restart the computer after to get it fully back

unfortunately crash remains with unreal 5.4 beta… 8k terrain. No materials… just used a height map form real world data to create some terrain without even sculpting anything. Trying to make it a nanite mesh and then build data for freezes the computer for a while and then crashes.

I tried enabling 200 additional gb of ram on a 2nd hard drive paging file… Didnt work… after a long time at 0% with an unuseable computer… it crashes unreal…

alright i got it working. The solution is to convert the scene into a world partition scene. This will break up the landscape into 1 landscape with multiple areas split up per world partition grid. Then you unload them all… load them in by sections and build… do several at a time… they save the others so they dont have to be rebuild as you gradually reveal more nad more. And build more and more.