-
Notifications
You must be signed in to change notification settings - Fork 380
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
Check if nvidia driver install can be automated --gpu #41
Comments
This is interesting, and I'd like to find a solution. I'm glad that it worked with option An easy solution (at least easy for me :D) would be an option like A more advanced solution would be to autodetect the host nvidia version and to install it automatically in container.
The difficult point is to support multiple possible systems in container, each with its own package manager and different package names. I would like to support images of debian, ubuntu, arch, centos, fedora, alpine, void, maybe more. Also the system in image may not have a matching nvidia driver version at all in its repository. And the driver installation would take some time on every start of a container. There is a project https://github.com/NVIDIA/nvidia-docker that adresses this and somehow uses the libraries from host. It looks complicated. I stopped considering it when I saw it changes A perky approach could be to share all nvidia library files from host with container. Maybe |
I have this problem at my home laptop because I had some glitches with official driver from OS repository and I had to install a custom built one, and it's not available inside docker container. |
A try to simply share nvidia files from host (quite a lot, though):
I hope it covers all needed files; maybe some of them are not needed. |
glxgears works. I just found out that IDE and 3D examples work when I remove The only downsidea are awkward window size and inadequate mouse capture. I will try without |
It works without nvidia share
|
The difference should be the shown frame rate. With
Can you please run with
x11docker found With a window manager (you can specify one with option |
My OS is Solus with Budgie window manager
Without Without
With
I think nvidia shares has no effect. The output of
|
Thank you! Normally glxgears shows a framerate about 60 FPS only if GPU access is successful. A framerate like The output of
and the same with
If GPU access fails, the output will contain
On success it will show something with
oh, ok. Budgie is a fork of gnome and inherits some of its fatal bugs. |
This doesn't work on my home laptop
https://pastebin.com/raw/rKBxfU5E After installing https://pastebin.com/raw/TSwQceCC I don't have the
It also fails with I don't want to switch from custom built driver to the official one from repositories because on my laptop it doesn't work well. Though IDE is working fine started by this script. In this comment everything will be about my home laptop, tomorrow I will be at the other PC again (from previous comment).
I get empty output from this
Only a window that opens and closes very fast like a blink. Even with Here is a debug that may help:
I can install it alongside budgie and it will not affect anything? I like budgie and don't want to switch. I will try to compile the driver as advised here and check if glxgears will run after that. |
After following the build process from that comment and installing the built driver I get the same failures described in previous comment. |
I have changed the code a bit, I hope this will run:
Yes, that is no problem. |
It fails Here is the output of #! /bin/bash
for Line in $(find /etc/nvidia /etc/alternatives /etc/modprobe.d \
/usr/lib /usr/share/glvnd /usr/bin | grep nvidia) \
$(find /usr/lib /etc/alternatives | grep libgl | grep -v nvidia) ; do
Nvidiashare="--volume=$Line:$Line:ro
$Nvidiashare"
done
Nvidiashare=$(echo "$Nvidiashare" | sort | uniq | grep -v '^$')
x11docker --verbose --stdout --stderr --gpu \
-- $Nvidiashare \
x11docker/lxde glxinfo |
I installed
https://pastebin.com/raw/HPBNvsCT I did
I get a black window and output in console
The black window is not responding to close button click, I stopped it with Ctrl+C in terminal. Here is the output of
|
I think the driver is glitchy. Better to continue the investigation at my other computer where the official driver from repository is installed. |
Maybe it misses some nvidia files from host, maybe even files without "nvidia" in its name. |
I will have a look at https://github.com/NVIDIA/nvidia-docker again, maybe I can find a useful hint. |
I've read some parts of nvidia-docker wiki and conclude that the approach to share host files will fail or work only in special cases, but not as a general solution. It's rather worth to investigate whether x11docker could support I will check if those images could support other GPUs and open source drivers as well. On a first try it seems to be possible, I've installed Do you want to give it a try, installing |
I admit I am aggrieved about NVIDIA corporation. Since many years NVIDIA corp. refuses to publish an API for the GPU hardware that could be used by open source projects like nouveau (see also wikipedia:nouveau). The Personally I recommend not to buy NVIDIA hardware at all. If we manage to get x11docker running with Personally I only use automated builds where I can immediatly check the Dockerfile. I don't trust in closed builds. All open source drivers harmonize well. Installing It costs a lot of extra effort to support closed source NVIDIA drivers. At the same time we are pinned down to use their closed builds of docker images. That is [censored]. My personal recommendation: If someone already has NVIDIA hardware: Try if it works well with free |
I can't find in their docs how to install it on Solus. Finding somewhere in their repositories the binaries and copying them on my system and messing manually with docker configuration - I will not do that.
This is advanced for me. So you will post a solution soon? |
If you install the free Be careful with replacing it as |
Thank you! |
x11docker option Additionally, x11docker |
For your OpenGL image from your initial post in case you stay with the proprietary driver:
Using this new image instead of the original avoids the need to execute For a deployable solution I can create an option With All this can be done automatically with a script on host and would allow to create a deployable image that also supports closed source nvidia drivers. |
I will take this into consideration while playing with LearnOpenGL examples until I will finish the tutorials. If I will come up with a stable solution I will pull request them. One solution that came in my mind now is to make the In order for script to list all the available versions of driver it can
|
You don't need to do anything special if an AMD or Intel GPU is on host, or if
That is a good idea and avoids the overhead of installing the driver on each start of x11docker! I found a download site for lots of nvidia drivers: http://www.nvidia.de/Download/index.aspx I tried to install an arbitrary driver in a docker container. A successfull example:
I hope that all nvidia installers understand the same options. |
I reopen this issue as it is still in progress. Could you please do a test?
Does OpenGL work in your IDE with this setup? |
It works. I will test at my home laptop later (with 387 driver). Hm, it seems they are deleting old driver versions from their download server. I tried to change in link the version but I get error page |
A script to detect a minor version for major version
It is quite slow, but it succeeds with:
Maybe there is faster command than Without |
The previous two versions were randomly found in google "nvidia 387". Now I checked the issue reported at Solus dev tracker and in one of comments I posted a screenshot where the installed version is I will test on my home laptop and let you know. |
I've uploaded an update to master branch that supports automatical installation of NVIDIA drivers in container. The terminal output should be self-explanatory. Please try out. |
On my home laptop:
|
Also now IDE is closing unexpectedly without any console error message (maybe tini is killing it). |
These are two bugs. I fixed one that prevented installing the nvidia driver. The other one with Let me think a bit, I'll find a solution. If you like to, you can check with e.g. |
Automatic driver installation works now, thanks. |
The IDE still works. I will use it a while and let you know if I got any unexpected close. Seems like this issue can be finally closed? |
But you still have a tini issue? The IDE runs nonetheless? |
IDE works fine. I still get tini warning
|
Great! As the I am a bit confused about this nvidia installer output:
But as long as nothing is obviously missing and everything works, I will not care about this. You posted a logfile for a failing openbox start. In that case
I did not believe it this morning, but it seems to be a yes :-) |
The This does not help in edge cases like |
Note that I changed the location for installer I checked some different base images and had a lot of hassle with images based on This is worth another rant at NVIDIA corporation. They restrict access for their customers to the hardware they paid for and tie them down to systems based on |
I found a browseable repository for nvidia drivers: Not listed on the main page: repository for openSUSE: Not useful here, yet another finding: repository for Windows: There may be further hidden repositories not listed on the main page. Though, I did not find any installers for |
Official LearnOpenGL examples project has just accepted using x11docker for building the examples
JoeyDeVries/LearnOpenGL#107
As you can see after starting IDE in docker you have to
docker exec
in temp container to install video drivers. It's not possible to hardcode video driver inDockerfile
because it will be used on different systems and distros.It would be nice if after container start the video driver will be installed automagically on any distro. We have to know if it's nvidia/amd and the major driver version (e.g. 390).
This task looks too complicated for me that's why I am consulting you.
If there is nothing you can do just close this issue.
The text was updated successfully, but these errors were encountered: