-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--gpu option questions / nvidia #127
Comments
For options If the dependencies are not fulfilled, x11docker falls back to Or do you have an NVIDIA card with proprietary driver? In that case x11docker will use |
Thanks for the quick reply @mviereck. I'm running OpenSUSE Leap 15, which uses Wayland and Xwayland natively. I have xpra, weston, Xwayland and xdotool all installed, and yes, I am using the NVIDIA proprietary driver. Based on your comment, I'm curious how my host system is working with the NVIDIA proprietary driver if it doesn't support Wayland. Or is it operating at the Xwayland layer? But, it appears the answer to my question is that x11docker is coded to fallback to hostdisplay if the NVIDIA proprietary drivers are in play, correct? I've just got nvidia-docker working and was hoping to be able to make it more secure. If it's not possible, that's fine too. Just another tool in the toolbox. Thanks for any insight you can provide. And thanks for developing x11docker. It's a nice way of securing Docker making sense of the huge amount of options available! |
Yes. I am a bit surprised that you can use Wayland with a proprietary NVIDIA driver. I've heard they would work on it, but did not realized that there has been some progress. I've uploaded a change in master branch that does not fall back to
If Wayland does not work, Gnome falls back to Xorg. Xwayland only runs within Wayland.
I am not sure if it will work ootb with x11docker. But we can figure it out. Option
:) Thank you. |
Thank you for making the change. No joy though. I get the following mostly:
Came across this docker-vmd. Haven't tried it yet. Know anything about it? |
Sorry, I don't know anything special about it. Looking into the Dockerfile, it has a hard coded NVIDIA driver version. x11docker can be more flexible.
Did you understand and apply the instructions in terminal output and wiki? It is a bit special. You can either provide a matching driver installer on host or install a matching driver yourself in image. If you tried with nvidia-docker image, than the errors might be related to a quite special setup within the image. I once had a closer look at it and its wiki but found it quite confusing. I did not investigate further. x11docker doesn't need its special setup and can provide/run nvidia drivers in simple, non-special images. Please show me Edit:
|
I understood the instructions. It was my original understanding that one of the goals of the nvidia-docker project was to not have to install as much in the container. But upon further investigation it's clear that I don't have a good understanding of what is actually provided inside the container by the runtime. I've pushed some interesting results to pastebin. First, I'm running CUDA v10, so I needed to modify the command. Here's what I ran: Interestingly, I removed the --gpu parameter, and the smi command succeeded. Here's what I ran: Fri Feb 15 12:29:30 2019 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 410.93 Driver Version: 410.93 CUDA Version: 10.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Quadro M620 On | 00000000:01:00.0 On | N/A | | N/A 49C P0 N/A / N/A | 1781MiB / 1968MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| +-----------------------------------------------------------------------------+And here's the [x11docker.log](https://pastebin.com/aqqVitzm). With regard to your comments about Wayland, I now believe I misinterpreted some things I came across previously. OpenSUSE DOES support Wayland, but to your point, not in my configuration. There are Wayland configs for both Gnome and KDE, but not with NVIDIA. Thank you for the correction. I'm going to try a couple other things with respect to the proper NVIDIA driver, and I'll let you know how it goes. |
Thanks for checking that out. I've changed master branch accordingly, x11docker will fall back to
It failed because
That is surprising. x11docker uses
That is quite appreciated! It is good to have some feedback about the NVIDIA support of x11docker as I cannot test it myself. |
I can confirm that both of the following work properly now:
Now, on to glxgears. If you haven't read this, it explains pretty nicely. Using the following Dockerfile I created a cuda:glxgears image:
This worked properly using the following:
For --gpu it used hostdisplay, while without --gpu it used xpra. Here's the x11docker.log for --gpu, and here's x11docker.log without. For other tests I was doing I put my NVIDIA driver in ~/.local/share/x11docker, and for the --gpu test (hostdisplay) when the terminal output said it was installing the driver is about the same time when the gears window opened. As an aside, on a previous test I left x11docker to install the driver (for about an hour) and it never finished. I'm thinking I was telling it to run a graphical app that it couldn't run, so the container stopped while x11docker was trying to do the driver install -- maybe?? I also did a bit of investigation about the difference between NVIDIA images. For my first test for glxgears I tried using nvidia/cuda, but that didn't work. What worked was when I switched to nvidia/cudagl. Per the blog I linked above, the images use different environment variables: nvidia/cuda:
nvidia/cudagl:
So the "graphics" element in the NVIDIA_DRIVER_CAPABILITIES variable makes the difference. I thought I'd try using an NVIDIA-provided Dockerfile to build an image with the driver. I used this as a starting point. How does it compare to how you install the driver? |
This is interesting: Driver-containers-(Beta) I think the Dockerfile I used in my previous post was an incorrect usage. This is for running the driver system-wide inside a container. But there may still be value in its process for x11docker?? |
There has been a bug. I did some fixes for the automated driver install, it should work now.
Your glxgears test without
There the driver is installed into the image. x11docker installs it in the running container.
The installer also needs
I'll look later into this. |
Output of
|
Output of
|
Thank you for the test! Without Your test with |
I thought of the possibility to have NVIDIA driver in one image and proving it to containers. There might be possibilities for a setup with Basically there a two ways that make sense.
On automated install x11docker checks I've updated the wiki for x11docker with NVIDIA with some findings of this thread, especially about Are any questions left? Does everything work as expected now? Release 5.4.2 contains fixes for the issues in this ticket. If everything is ok, we can close this ticket. |
A script to create an NVIDIA base image matching the driver on host:
|
It appears that NVIDIA is trying to get this concept past EXPERIMENTAL. We can let them do the leg work for this and validate it first.
With x11docker by itself, you're correct. But with --gpu and --runtime=nvidia the driver install isn't necessary at all if using the nvidia/cudagl base (or the equivalent packages; Dockerfiles found here). They seem to have a way of enabling OpenGL without a version matched driver. Would you mind disabling the fallback to hostdisplay again so I can test one more time? I think when I tested before I was using the wrong base image (nvidia/cuda instead of nvidia/cudagl).
I believe you are correct that the NVIDIA driver install also installs nvidia-settings.
I'd like to validate these, and hence the request to disable hostdisplay fallback. On a separate but related topic, I'm writing a 3-blog series on graphical desktop Docker containers. One of them very focused on x11docker. Would you be interested in proofing them before I release them? |
I'd be so interested on those blog posts, either before or after publishing them. I've been helping test x11docker on Win10 (see mviereck/x11docker#commenter:1138-4EB). Recently, I commented with @mviereck that some friendly introduction for new users would be great. You can find some notes here. |
IIRC nvidia-docker somehow uses driver files from host and provides them to the container. However, the nvidia-docker images work only (iirc) with nvidia cards and fail on computers with e.g. an AMD or Intel GPU. I could re-check that.
I don't want to change it in master branch again because some users use it regulary or for the first time.
A quite simple check: Run
Yes, I like to look at it. It's a honour for me to see x11docker in a blog post.
Meanwhile I could circumvent the dependencies on I currently run some tests with old driver versions, maybe some things still have to be fixed. Edit: Does x11docker skip installation of nvidia driver if you run a cuda image with |
You're correct that nvidia-docker only works with nvidia cards. The way I look at it, if someone is using the --runtime=nvidia Docker option they should have an idea of what they're doing -- and there's a very good chance they're using CUDA. What do you think of issuing a warning and NOT installing the nvidia driver (assuming it exists in the .local dir) and --runtime=nvidia is provided? In my case, where I have both runtimes, when I use --runtime=nvidia I'm accounting for the components to make it work in the image and don't want the driver installed.
Perfect. I commented out the Return=1 to play with it. So far, I'm still only able to use OpenGL via the nvidia runtime with --hostdisplay and --xorg. I'm curious why it doesn't work in --xpra-xwayland. I'll preface the following by saying I know very little about these technologies as I haven't been able to spend much time on either. But in looking at x11docker.log it seems to me that hardware accelerated OpenGL IS available and could be used, but for some reason it's falling back to software. Thoughts? As part of this process I began comparing the Docker inspect output for the following two configurations:
Both produce hardware accelerated containers in which I'm able to use glxgears, and I didn't let the driver get installed in either. Would you have any interest in comparing? Just curious.
I'm getting this set up so I can share. Not sure how best to private message the info to you when available.
No, x11docker does not skip installation. Based on the test that I just ran to answer your edit, nvidia-settings does not exist natively in the nvidia/cudagl image, and does get installed if I let x11docker install the driver. |
I've included a check for
Basically it is just the missing Wayland support by NVIDIA. You can check with
Your first example cannot have hardware acceleration from what I can see. It does not even have access to the GPU. Better check with
Tell me when you are ready, I'll somehow give you an email adress. |
Sorry, meant:
|
Ok, that probably works. |
I found the difference in what is being passed through via Docker to do the same job to be interesting. |
That is interesting, but I don't see a possible use case, so I would not spend time for investigating myself. The free MESA drivers are just compatible between host and container in all versions and across all systems. If they would be as complicated as NVIDIA, I would not provide GPU support in x11docker at all.
It should work now on your system. You can provide the installer file in |
Sure. Let me know if you would like anything else. x11docker --verbose --hostdisplay --gpu -- --runtime=nvidia -- cuda:glxgears xterm jordahl@7796bd01c3cd:~$ glxinfo | grep -i opengl 410.93 is the driver version on my host. |
x11docker cannot check the output of Probably x11docker should just stay with the current check for |
Latest release 5.4.4 contains adjustments and fixes related to this thread. The wiki entry about NVIDIA driver with docker got some updates. I think we can close this ticket now. |
If you can provide your email address I will send you links to the blogs.
|
Please have a look at your previous post. |
Got it! Will let you know when the blogs are ready.
|
Not sure if this will work... @1138-4eb, if you'd like to proof my blog
posts I'll need your email address somehow.
|
For anyone following this, first blog post is at
https://www.cbtechinc.com/desktop-docker-1-linux-graphical-containers/.
|
Per https://github.com/mviereck/x11docker/wiki/X-server-and-Wayland-Options, there are a number of X server options that can take the --gpu parameter, yet when I add it to any of them they all fallback to hostdisplay. What's the real deal? Between the x11docker-gui and the page linked above, the X servers I should be able to use --gpu for are the following (excluding wayland options for this):
Please advise.
The text was updated successfully, but these errors were encountered: