-
Notifications
You must be signed in to change notification settings - Fork 2k
nvidia-docker 1 can run OpenGL applications; nvidia-docker 2 can't #534
Comments
OpenGL is not supported at the moment and there is no plan to support GLX is the near future (same as 1.0). OpenGL+EGL however is on the roadmap and will be supported. We will update #11 once we publish it. If you are a NGC subscriber and need GLX for your workflow, I suggest you fill out a feature request. |
It might be helpful to note this at the beginning of the README for Nvidia-docker2. Even though it's totally fair that it's not implemented yet, it would be good to know, since this is critical for a lot of users (especially the ROS community and those following the ROS communiy's work in using the host's xserver). |
I am facing the same problem. It would be helpful to know that such an error can come up with NVidia-Docker2 so we don;t update. |
Same problem. We are relying on OpemGL apps run in container. That's the only issue stopping us from switching to nvidia-docker 2. |
same problem here trying to use ROS in docker. Will revert to nvidia-docker 1. |
Please try our new OpenGL beta images based on libglvnd: https://hub.docker.com/r/nvidia/opengl/ |
Hi @flx42 the OpenGL beta images appear to solve the problem for me in my initial tests. Will this functionality get rolled into the CUDA docker images? |
@oursland We will have a CUDA + OpenGL official image soon (probably called |
@flx42 I found the newly released cudagl images here: https://gitlab.com/nvidia/cudagl That is awesome! However, it is unclear to me how to customize them so that I can work with CUDA 8, as I do not have access to CUDA 9 at this time. The descriptions say something like Would something like that even be possible? Thank you! |
Hello @AndreiBarsan, we won't publish images with OpenGL and CUDA 8.0. If you need this use case, you can either do Instead, you should do |
@flx42 Thank you very much for the quick response and the tips. I will try that! |
For the sake of anyone else that come here looking, I've created a ros-indigo-desktop-full-nvidia example at https://hub.docker.com/r/lindwaltz/ros-indigo-desktop-full-nvidia/ that adds the necessary libraries on top of the osrf image (opengl, libglvnd, cuda8). Should be easy to reproduce for other ros flavors. |
Thanks @lindwaltz ! @ruffsl Do you think we could get ROS images based on our recently released (finally!) OpenGL images: |
your images work really great! i used them to wrap DaVinci Resolve in Docker containers (see: https://gitlab.com/mash-graz/resolve) and the result works surprisingly well! i only have to remark one significant issue: your opengl and cudagl are using a GLVND installation, but CentOS, which represents the base of one of your images, doesn't support GLVND utill now! that's a real unpleasant source of all kinds of nasty GLX related troubles. even the most simple tools additionally installed from CentOSs main repository, like a |
Thanks for the feedback @mash-graz! |
Thanks! I used your images as a starting point and it worked for us as well. Also some observation - as long as you keep the old /usr/local/nvidia/lib , /usr/local/nvidia/lib64 in the LD_LIBRARY_PATH, the image seems to work fine also when starting via nvidia-docker 1 (not sure if keeping the old entries is even needed). |
An additional question here. I am able to run
Is it possible to achieve that or there are some inherent limitations? |
@ruffsl probably has an image for this already. |
@kuz I'm not sure how your launched your container there, but I posted a minimal example GLX-Gears with nvidia-docker here: #136 (comment) With respect to gazebo, we have some examples of using gazebo with nvidia-docker1 at osrf/car_demo , and I have a WIP PR for updating it to use nvidia-docker2 here: osrf/car_demo#40 This is really old and dated, but here is a rabbit hole about getting gazebo server running in docker on a headless server with AWS: https://github.com/ruffsl/gazebo_docker_demos/tree/master/aws |
thx @ruffsl. anyone know if there are cudagl images for critically, i dont see libglvnd0 for arm64 https://launchpad.net/ubuntu/xenial/arm64?text=libglvnd0 i have tried building it to no avail: #136 (comment) |
@ruffsl, yep, I've seen those examples before, but they rely on X-server running on the host machine, I am trying to create a self-contained image where gazebo utilizes server's GPUs and there is a web interface to VNC with LXDE, so that a remote user can just access VNC via browser, and see the whole LXDE in front of his eyes, where he can run Is it even possible? |
To answer my own question: yes, it is possible, see https://github.com/willkessler/nvidia-docker-novnc |
Hi, My code (when running on local PC) will pop up Is there any to solve this? tsly |
Any plans for cudagl with cudnn support? |
Has anyone managed to get ROS working with nvidia-docker? Would be great if you could share steps. @NVIDIA Will there also be a stretch example? |
@machinekoder , yep. our uni lab uses ROS and nvidia-docker extensively so we can quickly onboard new students joining, share common ML development environments, and isolate simulation cluster resources. See this ROS wiki for more details: Note that it's a lot easier with Ubuntu 18.04 and up. Related: |
@machinekoder: We use the follow simple trick to add opengl support for nvidia-docker2 to any docker image. Create this
Then build it:
Now run it e.g. with:
One catch is that this patched image will only work with Nvidia, so not anymore with Intel Graphics acceleration... |
@koenlek I created a fork of the opengl repo for Debian Stretch and add your usage instructions: https://github.com/machinekoder/nvidia-opengl-docker Works like a charm! |
I realize things have changed since then, but I’m still a bit confused about some of the capabilities, terminology and implementation of GPU-based containers in particular with respect to EGL. The most popular one seems to be this one, nvidia-docker. So a few questions:
Also, if there is a better/more appropriate place to post this question, I'd appreciate the head's up! |
I've tried two docker image, both of them show the error message.
The error message like below:
If I just type the command Is there any suggestion for me to try? |
@hcv1027 At least for CUDA 9.x, I had success with the following setup: https://github.com/Seanmatthews/ros-docker-gazebo |
When using nvidia-docker 1, I can run applications that use OpenGL in a guest and they will display in the host environment. When trying to the same application in a similarly-configured container with nvidia-docker 2, I always get this error:
Running
nvidia-smi
works on the host as well as in containers using either version of nvidia-docker and always produces appropriate output.I've attached a couple of Dockerfiles and scripts that demonstrate the issue.
run-nvidia-docker-1.sh
usesDockerfile.1
to pullnvidia/cuda:8.0-devel-ubuntu16.04
, installsmesa-utils
, and then usesnvidia-docker
to launch a container that maps all of the necessary volumes and then runsglxgears
. When I have nvidia-docker 1 installed, it works andglxgears
displays as expected. When I completely remove nvidia-docker 1, install 2, purge all existing Docker images and volumes, and try again, I get the above error.run-nvidia-docker-2.sh
is similar, but it uses the stockubuntu:16.04
image and adds--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -e NVIDIA_DRIVER_CAPABILITIES=all
parameters, so I would expect it to work with nvidia-docker 2. It also produces the same error as above.Test files: x11-test.tar.gz
Host computer specs:
OS: Ubuntu Linux 16.04
CPU: Intel(R) Xeon(R) CPU E5-1650 v3
Output from
nvidia-smi
(which works on the host and also in containers using either version ofnvidia-docker
):The text was updated successfully, but these errors were encountered: