selkies-project / docker-nvidia-egl-desktop

KDE Plasma Desktop container designed for Kubernetes, supporting OpenGL EGL and GLX, Vulkan, and Wine/Proton for NVIDIA GPUs through WebRTC and HTML5, providing an open-source remote cloud/HPC graphics or game streaming platform.
https://github.com/selkies-project/docker-nvidia-egl-desktop/pkgs/container/nvidia-egl-desktop
Mozilla Public License 2.0
239 stars 49 forks source link

Unity 3d-Rendering app does not recognize the display/desktop in Docker env #29

Closed mrnix closed 1 year ago

mrnix commented 1 year ago

I'm trying to run a headless render app (Unity3d) inside docker container. Tried vglrun tool as well, but it doesn't work. The app logs ending with Desktop is 0 x 0 @ 0 Hz.

  1. It does work on the normal ubuntu-desktop (not dockerized).
  2. Works with emulation tool xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' ./app.x86_64, but it doesn't use GPU

Do you have any suggestions? Thanks

mrnix commented 1 year ago

After some changes in the app code, getting something new

Error getting num native displays: Video subsystem has not been initialized
Desktop is 0 x 0 @ 32765 Hz
error: XDG_RUNTIME_DIR not set in the environment.
ehfd commented 1 year ago

I have to test Unity3d itself. To use vglrun, try https://github.com/selkies-project/docker-nvidia-egl-desktop.

ehfd commented 1 year ago

Something's happening recently. Perhaps an untested driver version?

ehfd commented 1 year ago

@mrnix First, is this NVIDIA 535?

ehfd commented 1 year ago

@mrnix First, is this NVIDIA 535?

I need the answer to go further.

mrnix commented 1 year ago

HI @ehfd Managed it to work just by setting the correct environment vars, and running Xvfb to emulate a screen:

export NVIDIA_DRIVER_CAPABILITIES=all;
export NVIDIA_VISIBLE_DEVICES=all;
export XDG_CURRENT_DESKTOP=KDE;
export VGL_REFRESHRATE=60
export VGL_ISACTIVE=1
export VGL_DISPLAY=egl
export VGL_WM=1
export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu:/usr/local/nvidia/lib:/usr/local/nvidia/lib64";
export DISPLAY=:0
export DPI=96;
export CDEPTH=24;
Xvfb "${DISPLAY}" -ac -screen "0" "1920x1080x${CDEPTH}" -dpi "${DPI}" +extension "RANDR" +extension "GLX" +iglx +extension "MIT-SHM" +render -nolisten "tcp" -noreset -shmem &
vglrun glxinfo | grep "version"
vglrun glxgears
ehfd commented 1 year ago

Ah. This is basically our EGL desktop, so I'll transfer this issue to its repository before closing.