Giter Club home page Giter Club logo

Comments (15)

flx42 avatar flx42 commented on May 18, 2024 6

We now have beta images for OpenGL on DockerHub:
https://hub.docker.com/r/nvidia/opengl/
As noted in the description, we don't officially support rendering to X11. It's of course possible to make it work as many of you know, but we won't be able to help you until we officially support this use case.

Those images are based on libglvnd for the OpenGL API calls dispatch.
https://github.com/NVIDIA/libglvnd

Dockerfiles are here:
https://gitlab.com/nvidia/opengl

from nvidia-docker.

3XX0 avatar 3XX0 commented on May 18, 2024 1

Actually, @jfrazelle I would love your insights on this one moby/moby#23917
We could probably add some GLX/X11 magic in there as well.

from nvidia-docker.

jessfraz avatar jessfraz commented on May 18, 2024

I would love to help I used to have a Mac w Linux but don't anymore so I'm unsure how much help I can be with testing but I can give ideas has to how to have libs installed in a container and devices to mount

from nvidia-docker.

flx42 avatar flx42 commented on May 18, 2024

Thank you, @jfrazelle!
We definitely have the right people here to help us understand the different components of the graphics stack, but we will probably need some help in understanding how it can fit with Docker.

We haven't started working on this, I will update this issue when we do.

from nvidia-docker.

ruffsl avatar ruffsl commented on May 18, 2024

@flx42 or @3XX0 , could you elaborate on the reasons behind this OpenGL issue. What details are currently missing or not supported that prevents even an traditional apt-get installed application within the container from using OpenGL. I admit I'm a bit unaware of inner workings of the graphics stack here, and am still curious.

from nvidia-docker.

3XX0 avatar 3XX0 commented on May 18, 2024

We have a basic plan on how things should work but quite frankly it's not a priority for us internally at the moment and it might take some time to implement.

Dealing with OpenGL is tedious and doing it cleanly with proper buildtime/runtime separation is tricky. You have to take into account things like direct/indirect rendering, GLX/EGL, GL extensions and dispatching. Also our drivers change quickly and it's hard to keep up with their underlying OpenGL implementation.
If you are curious, https://github.com/NVIDIA/libglvnd provides some more information on how those things could be solved.

from nvidia-docker.

silgon avatar silgon commented on May 18, 2024

Hello guys. I got a problem related to this issue today. I have the nvidia installed in my computer, more specifically the version 352.63. Below you'll find my workaround, maybe it could be useful for you.

# variable with all the needed values for libgl and to be accessed through LD_LIBRARY_PATH
DOCKER_VISUAL_NVIDIA="-e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/nvidia0 --device /dev/nvidiactl -v /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0:/external_libs/libXau.so.6.0.0 -v /usr/lib/x86_64-linux-gnu/libXdmcp.so.6:/external_libs/libXdmcp.so.6 -v /usr/lib/x86_64-linux-gnu/libXext.so.6:/external_libs/libXext.so.6 -v /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0:/external_libs/libXdmcp.so.6.0.0 -v /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0:/external_libs/libX11.so.6.3.0 -v /usr/lib/x86_64-linux-gnu/libxcb.so.1:/external_libs/libxcb.so.1 -v /usr/lib/nvidia-352/libGL.so.352.63:/external_libs/libGL.so.352.63 -v /usr/lib/nvidia-352/libnvidia-glcore.so.352.63:/external_libs/libnvidia-glcore.so.352.63 -v /usr/lib/nvidia-352/libGL.so.1:/external_libs/libGL.so.1 -v /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0:/external_libs/libXext.so.6.4.0 -v /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0:/external_libs/libxcb.so.1.1.0 -v /usr/lib/x86_64-linux-gnu/libX11.so.6:/external_libs/libX11.so.6 -v /usr/lib/x86_64-linux-gnu/libXau.so.6:/external_libs/libXau.so.6 -v /usr/lib/nvidia-352/tls/libnvidia-tls.so.352.63:/external_libs/libnvidia-tls.so.352.63 --env=LD_LIBRARY_PATH=/external_libs"
# run the program
docker run --rm $DOCKER_VISUAL_NVIDIA -e QT_X11_NO_MITSHM=1 -v $HOME/.ros:$HOME/.ros:rw -v $HOME/.gazebo:$HOME/.gazebo:rw osrf/ros:kinetic-desktop-full roslaunch gazebo_ros empty_world.launch

The folders $HOME/.ros and $HOME/.gazebo are needed by the simulator (you can create empty folders mkdir $HOME/.ros $HOME/.gazebo). If you want to try the code, please change the 352 and 352.63 to your version of nvidia drivers before running the code (verify the declaration of the DOCKER_VISUAL_NVIDIA variable), it should work. I spent half a day trying to get this to work because I didn't know it was a problem with nvidia operating libgl. This example is based on this website and it uses a container of the open source robotics foundation. @ruffsl may be intereseted, or maybe he already have another workaround.

from nvidia-docker.

Kaixhin avatar Kaixhin commented on May 18, 2024

If anyone is looking here for solutions then I have a supposedly working setup documented here (tested quickly with glxgears and gazebo). Still haven't found an OpenGL over VNC solution for remote access though...

from nvidia-docker.

3XX0 avatar 3XX0 commented on May 18, 2024

Checkout the opengl branch, we have OpenGL over VNC there through VirtualGL.

from nvidia-docker.

Kaixhin avatar Kaixhin commented on May 18, 2024

@3XX0 Thanks for the tip - any pointers on how to set up a VNC server in a Docker container once VirtualGL has been installed? I haven't had any luck adapting the containers I've used before - seems more complex than just adding vglrun beforehand.

from nvidia-docker.

3XX0 avatar 3XX0 commented on May 18, 2024

It all depends on what you are trying to do. Generally I would recommend putting the VNC server on your host alongside the X server (at least that's how I did it). You can point the VirtualGL containers at whatever you like using DISPLAY, VGL_CLIENT and VGL_DISPLAY.

See here and there to see how it works (just imagine containers on top of that).

from nvidia-docker.

bbarker avatar bbarker commented on May 18, 2024

I seem to have OpenGL acc working using docker run --privileged - not ideal, but ok for some cases where isolation and security aren't a huge concern.

My full docker run command:

CMD="${DOCKER} run --detach=true \                                                                                                                                                                                                                                                                                                                                           
                --privileged \                                                                                                                                                                                                                                                                                                                                               
                --group-add ${DOCKER_GROUP_ID} \                                                                                                                                                                                                                                                                                                                             
                --env HOME=${HOME_DIR} \                                                                                                                                                                                                                                                                                                                                     
                --env DISPLAY \                                                                                                                                                                                                                                                                                                                                              
                --interactive \                                                                                                                                                                                                                                                                                                                                              
                --name DevContainer \                                                                                                                                                                                                                                                                                                                                        
                --net=host \                                                                                                                                                                                                                                                                                                                                                 
                --rm \                                                                                                                                                                                                                                                                                                                                                       
                --tty \                                                                                                                                                                                                                                                                                                                                                      
                --user=${USER_ID}:${GROUP_ID} \                                                                                                                                                                                                                                                                                                                              
                --volume $HOME_DIR_HOST:${HOME_DIR} \                                                                                                                                                                                                                                                                                                                        
                --volume $WORK_DIR:${WORK_DIR} \                                                                                                                                                                                                                                                                                                                             
                --volume /tmp/.X11-unix:/tmp/.X11-unix \                                                                                                                                                                                                                                                                                                                     
                --volume /var/run/docker.sock:/var/run/docker.sock \                                                                                                                                                                                                                                                                                                         
                ${IDEA_IMAGE}"

Link to my dockerfile repo - mainly of interest are idea.sh and Dockerfile (and large parts of them are NOT of interest also! :) ).

from nvidia-docker.

Brm-Bremen avatar Brm-Bremen commented on May 18, 2024

Hey,

we need to run a Webbrowser inside of a Nvidia-docker container.
Therefore GL is needed (or it is going to be very slow).

The Solution with VirtualGL looks like it could work but I was not yet able to get GL-support inside of the docker-container.

The newest Nvidia-driver is installed on the host-system . A "invalid-smi" tells me the docker-container has also recognized the GPU and has the newest driver installed.
Inside of the container I installed the mate-desktop-environment, virtualGL and Turbovnc. I can connect to the container via VNC and use it, but GL is missing. Typing "vglrun glxgears" returns:
Xlib: Extension "GLX" is mission on display ":0". Error: couldn't´t get a RGB, Double-buffered visual
"vglrun glxinfo" does kind of tell the same story besides printing the same message ~10 times.

After finding your opengl-branch I build my setup on top of it, but I still can´t get it to work.

Do I need to setup VirtualGl somehow?
Do I maybe need to install Xvfb? (I read about that somewhere but I didn't´t understand why it was necessary and how it would be used.)

I hope you can help me with this.

Best Regards
Joscha Knobloch

from nvidia-docker.

phil294 avatar phil294 commented on May 18, 2024

The images are not available as described. docker pull nvidia/opengl:glvnd-runtime is not found, only the :base image.

from nvidia-docker.

flx42 avatar flx42 commented on May 18, 2024

It's 1.0-glvnd-runtime.

from nvidia-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.