This repository was archived by the owner on Jan 22, 2024. It is now read-only.
This repository was archived by the owner on Jan 22, 2024. It is now read-only.
OpenGL Support #11
Closed
Description
As mentioned by @3XX0 in #7 , OpenGL is not supported with the current framework, yet there is an ongoing discussion internally in Nvidia to enable it. This issues serves as a means for users to track progress or propose recommendations. May want to ask @jfrazelle for some ideas, I know she's experimented a good deal in OpenGL support for docker containers.
Activity
jessfraz commentedon Nov 19, 2015
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
flx42 commentedon Nov 20, 2015
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.
ruffsl commentedon Dec 2, 2015
@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.
3XX0 commentedon Dec 2, 2015
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.
3XX0 commentedon Jun 24, 2016
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.
silgon commentedon Jul 30, 2016
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.
The folders
$HOME/.ros
and$HOME/.gazebo
are needed by the simulator (you can create empty foldersmkdir $HOME/.ros $HOME/.gazebo
). If you want to try the code, please change the352
and352.63
to your version of nvidia drivers before running the code (verify the declaration of theDOCKER_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 operatinglibgl
. 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.Kaixhin commentedon Sep 12, 2016
If anyone is looking here for solutions then I have a supposedly working setup documented here (tested quickly with
glxgears
andgazebo
). Still haven't found an OpenGL over VNC solution for remote access though...3XX0 commentedon Sep 12, 2016
Checkout the opengl branch, we have OpenGL over VNC there through VirtualGL.
Kaixhin commentedon Sep 13, 2016
@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.3XX0 commentedon Sep 13, 2016
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
andVGL_DISPLAY
.See here and there to see how it works (just imagine containers on top of that).
1 remaining item
bbarker commentedon Oct 4, 2017
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:Link to my dockerfile repo - mainly of interest are
idea.sh
andDockerfile
(and large parts of them are NOT of interest also! :) ).Brm-Bremen commentedon Oct 27, 2017
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
flx42 commentedon Jan 11, 2018
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
phil294 commentedon Mar 18, 2018
The images are not available as described.
docker pull nvidia/opengl:glvnd-runtime
is not found, only the:base
image.flx42 commentedon Mar 18, 2018
It's
1.0-glvnd-runtime
.