Creating project using UE4 Editor fails on Docker Container

I have a docker container that I VNC into (I have installed TigerVNC and Ubuntu Gnome desktop env on the container). The Ubuntu is 20.04. I have built UE4 version 4.27 from source by doing setup.sh and GenerateProjectFiles.sh and then make. This all was successful. I can also start the UE4Editor from ~/UnrealEngine/Engine/Binaries/Linux. But once I click “create Project”, around 98% in the process I get a crash as shown in the log
Any ideas? I think there is some issue with vulkan drivers. But I am not sure how to resolve this. I have installed vulkan-utils.

My docker run command is : sudo docker run --name=ubuntu-gnome2 --privileged -e DISPLAY=0.0 -d --rm --tmpfs /run --tmpfs /run/lock --tmpfs /tmp --cap-add SYS_BOOT --cap-add SYS_ADMIN -v /tmp/.X11-unix:/tmp/.X11-unix -v /sys/fs/cgroup:/sys/fs/cgroup --gpus ‘all,“capabilities=graphics,utility,display,video,compute”’ -p 5901:5901 -p 6901:6901 -e ubuntu2004desktop-ue427_2

Here is the detailed error log from terminal:

LogInit: Display: Loading text-based GConfig....
LogPlatformFile: Not using cached read wrapper
LogInit: Display: Loading text-based GConfig....
[2023.06.13-19.12.20:553][  0]LogShaderCompilers: Display: Worker (1/5): shaders left to compile 25
[2023.06.13-19.12.20:553][  0]LogShaderCompilers: Display: Worker (2/5): shaders left to compile 19
[2023.06.13-19.12.20:553][  0]LogShaderCompilers: Display: Worker (3/5): shaders left to compile 13
[2023.06.13-19.12.20:553][  0]LogShaderCompilers: Display: Worker (4/5): shaders left to compile 7
[2023.06.13-19.12.20:553][  0]LogShaderCompilers: Display: Worker (5/5): shaders left to compile 1
[2023.06.13-19.12.20:553][  0]LogShaderCompilers: Display: Started 25 'Local' shader compile jobs with 'Low' priority
[2023.06.13-19.12.20:636][  0]LogRenderer: Reallocating scene render targets to support 256x256 Format 10 NumSamples 1 (Frame:1).
Assertion failed: bSuccess [File:/home/matlab/UnrealEngine/Engine/Source/Runtime/VulkanRHI/Private/VulkanCommandBuffer.cpp] [Line: 474] 

Signal 11 caught.
Malloc Size=65538 LargeMemoryPoolOffset=65554 
CommonUnixCrashHandler: Signal=11
[2023.06.13-19.12.30:802][  0]LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to write memory at address 0x0000000000000003

[2023.06.13-19.12.30:802][  0]LogCore: Assertion failed: bSuccess [File:/home/matlab/UnrealEngine/Engine/Source/Runtime/VulkanRHI/Private/VulkanCommandBuffer.cpp] [Line: 474] 



0x00007fb67ced21ae libUE4Editor-Core.so!FGenericPlatformMisc::RaiseException(unsigned int) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMisc.cpp:472]
0x00007fb67d15349b libUE4Editor-Core.so!FOutputDevice::LogfImpl(char16_t const*, ...) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/Misc/OutputDevice.cpp:61]
0x00007fb67d0d0576 libUE4Editor-Core.so!AssertFailedImplV(char const*, char const*, int, char16_t const*, __va_list_tag*) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/Misc/AssertionMacros.cpp:104]
0x00007fb67d0d040b libUE4Editor-Core.so!FDebug::CheckVerifyFailedImpl(char const*, char const*, int, char16_t const*, ...) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/Misc/AssertionMacros.cpp:458]
0x00007fb5f91d3207 libUE4Editor-VulkanRHI.so!FVulkanCommandBufferManager::WaitForCmdBuffer(FVulkanCmdBuffer*, float) [/home/matlab/UnrealEngine/Engine/Source/Runtime/VulkanRHI/Private/VulkanCommandBuffer.cpp:474]
0x00007fb5f9242d7c libUE4Editor-VulkanRHI.so!FVulkanDynamicRHI::RHIReadSurfaceData(FRHITexture*, FIntRect, TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags) [/home/matlab/UnrealEngine/Engine/Source/Runtime/VulkanRHI/Private/VulkanRenderTarget.cpp:334]
0x00007fb67ae83395 libUE4Editor-Engine.so!FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::$_0::operator()(FRHICommandListImmediate&) const [/home/matlab/UnrealEngine/Engine/Source/Runtime/Engine/Private/UnrealClient.cpp:77]
0x00007fb67ae83a1a libUE4Editor-Engine.so!TEnqueueUniqueRenderCommandType<FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::ReadSurfaceCommandName, FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::$_0>::DoTask(ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) [/home/matlab/UnrealEngine/Engine/Source/Runtime/RenderCore/Public/RenderingThread.h:183]
0x00007fb67ae83d92 libUE4Editor-Engine.so!TGraphTask<TEnqueueUniqueRenderCommandType<FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::ReadSurfaceCommandName, FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::$_0> >::ExecuteTask(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32> >&, ENamedThreads::Type) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Public/Async/TaskGraphInterfaces.h:886]
0x00007fb67cea494b libUE4Editor-Core.so!FNamedTaskThread::ProcessTasksNamedThread(int, bool) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/Async/TaskGraph.cpp:710]
0x00007fb67cea2e2e libUE4Editor-Core.so!FNamedTaskThread::ProcessTasksUntilQuit(int) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/Async/TaskGraph.cpp:601]
0x00007fb677680655 libUE4Editor-RenderCore.so!RenderingThreadMain(FEvent*) [/home/matlab/UnrealEngine/Engine/Source/Runtime/RenderCore/Private/RenderingThread.cpp:372]
0x00007fb6776c0462 libUE4Editor-RenderCore.so!FRenderingThread::Run() [/home/matlab/UnrealEngine/Engine/Source/Runtime/RenderCore/Private/RenderingThread.cpp:526]
0x00007fb67cf79137 libUE4Editor-Core.so!FRunnableThreadPThread::Run() [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.cpp:25]
0x00007fb67cf35a33 libUE4Editor-Core.so!FRunnableThreadPThread::_ThreadProc(void*) [/home/matlab/UnrealEngine/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.h:185]
0x00007fb67d8e4609 libpthread.so.0!UnknownFunction(0x8608)
0x00007fb673f21133 libc.so.6!clone(+0x42)

Also, I see this:

vulkaninfo output:

WARNING: [Loader Message] Code 0 : loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7)
WARNING: [Loader Message] Code 0 : loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_lvp.so supports Vulkan 1.1, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7)
WARNING: [Loader Message] Code 0 : loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_intel.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7)
WARNING: [Loader Message] Code 0 : Layer VK_LAYER_MESA_device_select uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues.
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  1 (X_CreateWindow)
  Serial number of failed request:  7
  Current serial number in output stream:  8

I can run vkcube

Answering my own question:
After a lot of searching, I figured out that in the docker run command I had to add --runtime=nvidia. Sheesh

So final docker run command is:

sudo docker run --runtime=nvidia --name=ubuntu-gnome --privileged -e DISPLAY=0.0 -d --rm --tmpfs /run --tmpfs /run/lock --tmpfs /tmp --cap-add SYS_BOOT --cap-add SYS_ADMIN -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/.X11-unix:/tmp/.X11-unix -v /sys/fs/cgroup:/sys/fs/cgroup -v /etc/vulkan/icd.d/nvidia_icd.json:/etc/vulkan/icd.d/nvidia_icd.json --gpus 'all,"capabilities=graphics,utility,display,video,compute"' -p 5901:5901 -p 6901:6901 ubuntu2004desktop-ue427_2

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.