adamrehn/ue4-docker

Issue with custom UE 4.27 docker GUI error

soumics opened this issue · 1 comments

Hi,

Thank you for your support for Unreal Engine Docker. I have written a custom docker for building UE4.27 (Linux + WSL2) as follows:

FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu20.04

ENV DEBIAN_FRONTEND noninteractive

ARG UNREAL_USER=unreal

RUN apt-get update &&
apt-get install -y
build-essential
sudo
wget
libopenal-dev
libfreetype6-dev
libglfw3-dev
xdg-user-dirs
unzip

RUN useradd -ms /bin/bash $UNREAL_USER

WORKDIR /home/$UNREAL_USER

USER $UNREAL_USER

COPY UnrealEngine-4.27.tar.gz .
RUN tar -xzf UnrealEngine-4.27.tar.gz &&
rm UnrealEngine-4.27.tar.gz &&
cd UnrealEngine-4.27 &&
./Setup.sh &&
./GenerateProjectFiles.sh &&
make

WORKDIR /home/$UNREAL_USER/UnrealEngine-4.27

CMD ["./Engine/Binaries/Linux/UE4Editor"]

The Dockerfile builds but it does not open the UE4Editor in the GUI (in Xlaunch in Windows). I have received the following error:

[2023.05.19-23.41.04:787][ 0]LogInit: Initializing SDL.
error: XDG_RUNTIME_DIR not set in the environment.
[2023.05.19-23.41.04:789][ 0]LogInit: Warning: Could not initialize SDL: No available video device
[2023.05.19-23.41.04:790][ 0]LogInit: - Physical RAM available (not considering process quota): 32 GB (31934 MB, 32700736 KB, 33485553664 bytes)
[2023.05.19-23.41.04:790][ 0]LogInit: - VirtualMemoryAllocator pools will grow at scale 1.4
[2023.05.19-23.41.04:790][ 0]LogInit: - MemoryRangeDecommit() will be a no-op (re-run with -vmapoolevict to change)
[2023.05.19-23.41.04:804][ 0]LogInit: Physics initialised using underlying interface: PhysX
[2023.05.19-23.41.04:819][ 0]LogInit: Using OS detected language (en-US-POSIX).
[2023.05.19-23.41.04:819][ 0]LogInit: Using OS detected locale (en-US-POSIX).
[2023.05.19-23.41.04:820][ 0]LogTextLocalizationManager: No specific localization for 'en-US-POSIX' exists, so the 'en' localization will be used.
[2023.05.19-23.41.04:949][ 0]LogInit: Initializing SDL.
error: XDG_RUNTIME_DIR not set in the environment.
[2023.05.19-23.41.04:951][ 0]LogInit: Warning: Could not initialize SDL: No available video device
[2023.05.19-23.41.04:951][ 0]LogInit: Warning: FLinuxSplashState::InitSplashResources() : InitSDL() failed, there will be no splash.
[2023.05.19-23.41.04:951][ 0]LogInit: Initializing SDL.
error: XDG_RUNTIME_DIR not set in the environment.
[2023.05.19-23.41.04:953][ 0]LogInit: Warning: Could not initialize SDL: No available video device
[2023.05.19-23.41.04:953][ 0]LogInit: Error: FLinuxApplication::CreateLinuxApplication() : InitSDL() failed, cannot create application instance.
[2023.05.19-23.41.04:953][ 0]LogCore: FUnixPlatformMisc::RequestExit(bForce=true, ReturnCode=1)
[2023.05.19-23.41.04:953][ 0]LogCore: FUnixPlatformMisc::RequestExit(1)

Please help me and correct me!

There are multiple reasons why this is failing:

  • Unlike the Dockerfiles provided by ue4-docker, this custom Dockerfile does not install the required X11 and Vulkan runtime libraries, or configure the necessary NVIDIA driver capability environment variables, to facilitate interactive use of the Unreal Editor as described by the Linux Sandboxed Editor page of the Unreal Containers community hub documentation.

  • As discussed in this issue thread from the ue4-runtime repository, WSL2 does not currently expose the required Vulkan capabilities to run the Unreal Engine. So even when using the images provided by ue4-docker itself, the Editor will fail to run interactively under WSL2.

I'm going to close this issue, since custom Dockerfile code is outside the scope of ue4-docker's issue tracker.