Closed jjziets closed 2 years ago
Several misunderstandings:
-depth 16
to the TurboVNC Server. Many modern applications require a 24-bit color depth. VirtualGL also requires a 24-bit color depth. (24-bit is the default color depth in the TurboVNC Server.)VGL_DISPLAY
should never point to the same X display as DISPLAY
. VGL_DISPLAY
should point to the 3D X server, which is a dedicated shared X server that is attached to a GPU.In a Docker environment, the most straightforward approach is to run the 3D X server and TurboVNC Server outside of the container and to run VirtualGL, the 3D application, and the window manager inside of the container. This example demonstrates how to accomplish that: https://github.com/dcommander/virtualgl_docker_examples/tree/vgl_glxspheres-glxbackend Note, however, that the nVidia Container Toolkit is required in order to access the GPU from inside of the Docker container.
With the example above, you should replace bash
with the window manager startup script (openbox-session
, for instance) and then pass the run
script to the TurboVNC Server using the -xstartup
argument or $xstartup
configuration file directive.
It is possible to run the TurboVNC Server inside of the container as well, but because of the need to map the RFB listening port from the container to the host, that configuration is problematic in a multi-user environment. It should work OK if you are the only user, however. (Just map Port 5901 from the host to the container in that case.)
Hi Ok thanks, in short in this case, vast.ai, where I don't have access to the host and can not pass a xserver to the docker container it is not possible to setup a game-like application from inside the server?
Also the container gets given a range of ports that is exposed to the host. I can't change that from within.
can I tell TruboVNC to use another port? I don't; see a port option like x11vnc has.
Yes, you can pass -rfbport {port}
to /opt/TurboVNC/bin/vncserver
to specify a listening port. Unfortunately, setting up VirtualGL correctly requires root access on the host. (The vglserver_config
script is executed as root in order to configure continuous access to the GPU via either the 3D X server or DRI devices.) If you are lucky, then your user account may already be able to access the DRI devices, but on a shared system, there is no guarantee that your user account will continue to have access to those devices unless vglserver_config
is run. Also, the only way (of which I am aware) that a GPU can be accessed from a Docker container is by way of the nVidia Container Toolkit, which provides a special build of Docker with some nVidia-specific glueware. If your host doesn't already have that installed and you have no way to install it, then you're sunk.
I have been trying to play a game(SuperTuxKart) on vastai. Yea it's for fun but so one learns. I'm effectively renting a supercomputer and want to try use it to play a 3d game. But this is turning out to e a lot more of a challenge than I thought.
using Image: [tensorflow/tensorflow ] Image CUDA version: 11.2
I installed x11vnc virtualgl_3.0.1_amd64.deb turbovnc_3.0_amd64.deb SuperTuxKart-1.3-linux-64bit apt-get install xorg openbox
but when I try to run the x11vnc it with that display it does not work
I can use Xvfb for the virtual display. but I then not getting any 3D hardware accel
but this sucks big time