Download

Crash when enabling Nanite (Linux)

Hi,

I’m trying to use UE5 on Linux (Ubuntu 21.04) with very little success. Whenever I select enable Nanite the editor crashes as soon as it starts to build the mesh:

Assertion failed: ChildIndex < ( 1 << 6 ) [File:Runtime/Engine/Public/Rendering/NaniteResources.h] [Line: 260]

libUnrealEditor-NaniteBuilder.so!Nanite::FHierarchyFixup::FHierarchyFixup(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Engine/Public/Rendering/NaniteResources.h:260]
libUnrealEditor-NaniteBuilder.so!Nanite::WritePages(Nanite::FResources&, TArray<Nanite::FPage, TSizedDefaultAllocator<32> >&, TArray<Nanite::FClusterGroup, TSizedDefaultAllocator<32> > const&, TArray<Nanite::FClusterGroupPart, TSizedDefaultAllocator<32> > const&, TArray<Nanite::FCluster, TSizedDefaultAllocator<32> > const&, TArray<Nanite::FEncodingInfo, TSizedDefaultAllocator<32> > const&, unsigned int)::$_15::operator()(int) const [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Developer/NaniteBuilder/Private/NaniteEncode.cpp:1801]
libUnrealEditor-Core.so!ParallelForImpl::TParallelForData<TFunctionRef<void (int)> >::Process(int, TSharedRef<ParallelForImpl::TParallelForData<TFunctionRef<void (int)> >, (ESPMode)1>&, ENamedThreads::Type, bool) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Public/Async/ParallelFor.h:196]
libUnrealEditor-Core.so!ParallelForImpl::TParallelForTask<TFunctionRef<void (int)> >::DoTask(ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Public/Async/ParallelFor.h:136]
libUnrealEditor-Core.so!TGraphTask<ParallelForImpl::TParallelForTask<TFunctionRef<void (int)> > >::ExecuteTask(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32> >&, ENamedThreads::Type, bool) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Public/Async/TaskGraphInterfaces.h:960]
libUnrealEditor-Core.so!FTaskGraphCompatibilityImplementation::QueueTask(FBaseGraphTask*, bool, ENamedThreads::Type, ENamedThreads::Type)::'lambda'()::operator()() const [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Private/Async/TaskGraph.cpp:1906]
libUnrealEditor-Core.so!LowLevelTasks::TTaskDelegate<48u, bool>::TTaskDelegateImpl<void LowLevelTasks::FTask::Init<FTaskGraphCompatibilityImplementation::QueueTask(FBaseGraphTask*, bool, ENamedThreads::Type, ENamedThreads::Type)::'lambda'()>(char16_t const*, LowLevelTasks::ETaskPriority, FTaskGraphCompatibilityImplementation::QueueTask(FBaseGraphTask*, bool, ENamedThreads::Type, ENamedThreads::Type)::'lambda'()&&, bool)::'lambda0'(), false>::CallAndMove(LowLevelTasks::TTaskDelegate<48u, bool>&, void*, unsigned int) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Public/Async/Fundamental/TaskDelegate.h:156]
libUnrealEditor-Core.so!bool LowLevelTasks::FScheduler::TryExecuteTaskFrom<&(LowLevelTasks::TLocalQueueRegistry<1024u>::TLocalQueue::DequeueGlobal(bool)), false>(LowLevelTasks::TLocalQueueRegistry<1024u>::TLocalQueue*, LowLevelTasks::TLocalQueueRegistry<1024u>::FOutOfWork&, bool) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Private/Async/Fundamental/Scheduler.cpp:219]
libUnrealEditor-Core.so!LowLevelTasks::FScheduler::WorkerMain(LowLevelTasks::FScheduler::FSleepEvent*, LowLevelTasks::TLocalQueueRegistry<1024u>::TLocalQueue*, unsigned int, bool) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Private/Async/Fundamental/Scheduler.cpp:254]
libUnrealEditor-Core.so!UE4Function_Private::TFunctionRefCaller<LowLevelTasks::FScheduler::CreateWorker(LowLevelTasks::TLocalQueueRegistry<1024u>::TLocalQueue*, EThreadPriority, bool, bool)::$_0, void ()>::Call(void*) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Public/Templates/Function.h:548]
libUnrealEditor-Core.so!FThreadImpl::Run() [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Private/HAL/Thread.cpp:63]
libUnrealEditor-Core.so!FRunnableThreadPThread::Run() [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.cpp:25]
libUnrealEditor-Core.so!FRunnableThreadPThread::_ThreadProc(void*) [/home/adam/UE/UnrealEngine_5_0/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.h:185]
libpthread.so.0!UnknownFunction(0x944f)
libc.so.6!clone(+0x42)

Any way to fix this?

I haven’t tried UE5 on linux yet but

“Nanite is currently supported on PlayStation 5, Xbox Series S|X, and PCs with graphics cards meeting these specifications, using the latest drivers with DirectX 11 or 12”

Source :

At least for now it seems that DX is the requirement, so it means that OpenGL or Vulkan is not yet supported.
So it could not work on Linux at this time

It’s confirmed on the following thread:

To see how nanite work, was going through the nanite source code I found (if not mistaken) that it need 64bit rasterisation api exposed by drivers.
Now its up to gpu companies to provide linux drivers (+vulkan-windows branch) which is on par with windows for feature, api and performace (windows vs linux exposed by tellusim-Gravitymark)

PS: Using a console command and editing a few loc in rendergraph, I was able to get nanite running on linux badly. Lol, in that effort I accidently created UE5 version of cyberpunk braindance effect :grin:

2 Likes

Still progress, albeit segway.
Neat.

1 Like

with nfb nvidia driver 49x and unreal development branch nanite is working well on linux vulkan. But had to modify the engine source a bit to get that branch compiled.
Thanks to unreal team and nvidia for fixing this!