Comments (15)
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.
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.
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.
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.
@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.
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.
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.
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.
Checkout the opengl branch, we have OpenGL over VNC there through VirtualGL.
from nvidia-docker.
@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.
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.
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.
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.
The images are not available as described. docker pull nvidia/opengl:glvnd-runtime
is not found, only the :base
image.
from nvidia-docker.
It's 1.0-glvnd-runtime
.
from nvidia-docker.
Related Issues (20)
- Support Debian 12 HOT 15
- docker.io/nvidia/cuda:11.2-cudnn8.1-ubuntu18.04: not found HOT 1
- installed
- Unable to get container to use nvidia graphics resources. System : Ubuntu22.04 HOT 2
- Manifest unknown error HOT 4
- How to change the jupyter lab host in Pytorch:23.07 image HOT 2
- Can't download cuda on Ubuntu 20.04 HOT 8
- DEEPLINK.GOOGLE.COM
- containerd-config.patch cannot be applied HOT 5
- My wallet, I'd like to receive bnb beacon chain token if possible
- Fails with CUDA driver version is insufficient for CUDA runtime version HOT 1
- No nvidia gpu, docker: Error response from daemon: failed to create shim task: OCI runtime create failed HOT 1
- Failed to acquire license from license server HOT 5
- config.toml created by nvidia-ctk doesn't work properly HOT 10
- can not pull cuda:11.8.0-cudnn8-devel-centos7 HOT 1
- where are the old images? HOT 3
- version
- Unable to find image 'nvidia/cuda:11.0-base' locally when testing nvidia-docker2 setup HOT 1
- Docker run gives : "WSL Environment Detected but no adopters were found" HOT 1
- Splitting up /var/lib/apt/lists/partial/developer.download.nvidia.com_compute_cuda_repos_ubuntu2204_x86%5f64_InRelease into data and signature failed Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvidia-docker.