Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Install nvidia-docker v2 in Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
BrummieJim
l33t
l33t


Joined: 22 Jul 2005
Posts: 683

PostPosted: Mon Jun 11, 2018 12:05 pm    Post subject: Install nvidia-docker v2 in Gentoo Reply with quote

Hi,
I'm trying to get nvidia-docker working in Genoo, but having problems and it looks unsupported, https://nvidia.github.io/nvidia-docker/ . I'm running x86_64 btw. There's a makefile, but nothing to support a non-deb or rpm OS.

I found an older version in a layman respository, but this won't install; https://gpo.zugaina.org/app-admin/nvidia-docker

Code:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.37/version: dial unix /var/run/docker.sock: connect: permission denied
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post
    http://%2Fvar%2Frun%2Fdocker.sock/v1.37/build?buildargs=%7B%22CR_EMAIL
    %22%3A%22digits%40nvidia.com%22%2C%22CR_NAME%22%3A%22NVIDIA+CORPORATION
    %22%2C%22PKG_ARCH%22%3A%22amd64%22%2C%22PKG_NAME%22%3A%22
    nvidia-docker%22%2C%22PKG_REV%22%3A%221%22%2C%22PKG_VERS
    %22%3A%221.0.1%22%2C%22USER_ID%22%3A%22250%22%7D&cachefrom=
    %5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=
    &cpusetmems=&cpushares=0&dockerfile=Dockerfile.build&labels=
    %7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=
    463d2bff47b9781290c03b752532cdad18af37eb57889f55582086d72e229b1f&
    shmsize=0&t=nvidia-docker%3Abuild&target=&ulimits=null: dial unix /var/run/docker.sock: connect: permission denied
ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: permission denied
make: *** [Makefile:47: build] Error 1


I did the standard fix for this problem (adding root to the docker group) but to no-avail.

Question is, has anyone else got this working, and if so, how?
Thanks,
James

Replaced 'quote' tags with 'code' tags, and wrapped a long line to make the forum layout behave.Chiitoo
Back to top
View user's profile Send private message
casimiro
n00b
n00b


Joined: 15 Jun 2018
Posts: 1

PostPosted: Fri Jun 15, 2018 3:59 pm    Post subject: Reply with quote

You can solve this problem by adding the user portage to the group docker. Thus the portage will be able to use the docker client.

However, even after doing that I wasn't able to install nvidia-docker once the docker buld failed on step 11/22.

If you manage to emerge it, please share your magick. =)
Back to top
View user's profile Send private message
lromor
n00b
n00b


Joined: 11 Sep 2018
Posts: 1

PostPosted: Tue Sep 11, 2018 10:57 am    Post subject: Reply with quote

Quote:
However, even after doing that I wasn't able to install nvidia-docker once the docker buld failed on step 11/22.

If you manage to emerge it, please share your magick. =)


Hi, I managed to do that but it required a bit of manual compilation and patches.


First of all, nvidia-docker. You can simply copy paste the ebuild to use a newer version and nvidia-docker will be installed.
For example, in your local portage repo add inside app-admin/nvidia-docker/nvidia-docker-2.0.3.ebuild (which is the latest version that I found in their repo. You don't have to compile it as nvidia-docker it's essentially just bash wrapper.


The main problem though is that it's missing many other dependencies such as:

https://github.com/NVIDIA/libnvidia-container

and docker runtime that will call a hook that will init the libnvidia driver:
https://github.com/NVIDIA/nvidia-container-runtime

Especially this last part is a bit annoying because they are currently facing an issue with distributions that require to be part of the video group in order to access /dev/nvidia*

Fortunately they have a patch for the hook that let's you change the uid of the process spawned by the driver.

Depending on how many people are interested in this, I might write some ebuilds to port it on gentoo.
Back to top
View user's profile Send private message
wanwannodao
n00b
n00b


Joined: 01 Nov 2018
Posts: 1

PostPosted: Thu Nov 01, 2018 2:23 pm    Post subject: Reply with quote

Can you please explain in more detail how you managed this ??

I need nvidia-docker ! and have been stuck in the same issue... Thanks!
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Mon Dec 03, 2018 9:28 am    Post subject: Reply with quote

Being at same situation, having ebuild for nvidia-docker v1 only, so going to try to write dummy ebuilds for runtime as well (is some dependency). If I got something blocking me, i will compile from source...
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Mon Dec 03, 2018 2:05 pm    Post subject: Reply with quote

Ok, I created some basic ebuild for container library at:
https://github.com/archenroot/gentoo-overlay/tree/master/dev-libs/nvidia-container

But I think this itself is not enough for full runtime, I need to wait for some response from upstream....

If you are interested in help, please look at:
https://github.com/NVIDIA/libnvidia-container/issues/42
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Mon Dec 03, 2018 3:09 pm    Post subject: Reply with quote

I am in the middle of decision to create a build for:
https://looking-glass.hostfission.com/

And passtrough GPU into VM(with either deb or rpm based distro) :-) to make things working haha
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
42n4
n00b
n00b


Joined: 10 Feb 2015
Posts: 9

PostPosted: Thu Mar 14, 2019 7:53 am    Post subject: Reply with quote

Have you succeded in making nvidia docker and dependencies ebuilds?
For me it is not enough to run nvidia-docker in lxd vga passthrough https://stgraber.org/2017/03/21/cuda-in-lxd/ (lxd-3.10, lxc-3.0.3, lxc-templates-3.0.3 - remember about /etc/subgid /etc/subuid the same contents: "root:1000000:65536"; systemctl start lxcfs; systemctl start lxd; )
Code:
lxc config device add yourcontainer gpu gpu

How to find nvidia 418.39 binary, which is official in ubuntu 16/18.04 and in lxd containers?
In Gentoo we have 418.43 and no way to find 39, but it is connected with cuda-demo-suite.
Gentoo should have available these ubuntu nvidia releases https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa/+packages just to be compatible in lxd vga passthrough.
Now 418.43 is available, but not for 16.04 and not for cuda-demo-suite, I will check http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/, maybe some nvidia drivers dependencies will be compatible with these Gentoo ones, but to obtain previous binary nvidia drivers packages is almost impossible. In nvidia official archive there is only 418.43, not 418.39...
Next time I will backup any nvidia....run just for convenience. In ubuntu the newest nvidia drivers are in staging ppa https://launchpad.net/~mamarley/+archive/ubuntu/staging
After they become official, Gentoo will have another fresh 418.xx, which will be incompatible with ubuntu drivers. These binary dependencies in lxd/lxc containers drives me crazy :evil:
_________________
gentoo gcc 8.3.0 lto graphite, arm rpi3 7.4.0,
http://bit.ly/gen2ls
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Tue Apr 23, 2019 12:21 pm    Post subject: Reply with quote

No, I am going to review the status as I still kind of need it as frameworks I work with are having diversity like hell in versions of dependencies...

Or I can do PCI passtrough of CUDA gpu into Qemu VM and go with Ubuntu...

Did you succeed?
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Fri May 31, 2019 8:57 pm    Post subject: Reply with quote

Someone any progress here?
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
lordserenity
n00b
n00b


Joined: 26 Sep 2019
Posts: 1

PostPosted: Thu Sep 26, 2019 2:22 pm    Post subject: Reply with quote

https://github.com/gronastech/nvidia-docker-overlay
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Sun Oct 13, 2019 8:49 am    Post subject: Reply with quote

Yeah, superior, thx, its registered in zugaina as well already, nice work.
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
vowstar
n00b
n00b


Joined: 24 Dec 2019
Posts: 2

PostPosted: Fri Jun 12, 2020 5:26 pm    Post subject: Re: Install nvidia-docker v2 in Gentoo Reply with quote

BrummieJim wrote:
Hi,

Question is, has anyone else got this working, and if so, how?

Replaced 'quote' tags with 'code' tags, and wrapped a long line to make the forum layout behave.Chiitoo


I fixed the nvidia-container-toolkit (aka. nvidia-docker2 ) issue under gentoo and got this working.

https://github.com/vowstar/vowstar-overlay

Assume you have add yourself in docker group

OpenRC
Code:

sudo layman --add=vowstar
sudo emerge -av nvidia-container-toolkit
sudo rc-service docker restart
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi


systemd
Code:

sudo layman --add=vowstar
sudo emerge -av nvidia-container-toolkit
sudo systemctl restart docker
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi


Result

Code:

$ docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
Fri Jun 12 17:23:54 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  Off  | 00000000:0A:00.0  On |                  N/A |
|  0%   51C    P0    62W / 300W |   1413MiB / 11016MiB |      8%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

$ uname -a
Linux ryzen 5.6.17-gentoo #1 SMP PREEMPT Mon Jun 8 11:35:26 CST 2020 x86_64 AMD Ryzen 9 3900X 12-Core Processor AuthenticAMD GNU/Linux
Back to top
View user's profile Send private message
SigHunter
n00b
n00b


Joined: 24 Mar 2010
Posts: 41
Location: Nürnberg, Germany

PostPosted: Mon Sep 13, 2021 12:15 pm    Post subject: Re: Install nvidia-docker v2 in Gentoo Reply with quote

vowstar wrote:
BrummieJim wrote:
Hi,

Question is, has anyone else got this working, and if so, how?

Replaced 'quote' tags with 'code' tags, and wrapped a long line to make the forum layout behave.Chiitoo


I fixed the nvidia-container-toolkit (aka. nvidia-docker2 ) issue under gentoo and got this working.

https://github.com/vowstar/vowstar-overlay

Assume you have add yourself in docker group

OpenRC
Code:

sudo layman --add=vowstar
sudo emerge -av nvidia-container-toolkit
sudo rc-service docker restart
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi


systemd
Code:

sudo layman --add=vowstar
sudo emerge -av nvidia-container-toolkit
sudo systemctl restart docker
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi


Result

Code:

$ docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
Fri Jun 12 17:23:54 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  Off  | 00000000:0A:00.0  On |                  N/A |
|  0%   51C    P0    62W / 300W |   1413MiB / 11016MiB |      8%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

$ uname -a
Linux ryzen 5.6.17-gentoo #1 SMP PREEMPT Mon Jun 8 11:35:26 CST 2020 x86_64 AMD Ryzen 9 3900X 12-Core Processor AuthenticAMD GNU/Linux


Thank you VERY MUCH for your overlay vowstar, I finally got NVENC/NVDEC working with it (for jellyfin, eselect repository enable vowstar)
Back to top
View user's profile Send private message
beizhuchun
n00b
n00b


Joined: 11 Apr 2013
Posts: 29

PostPosted: Fri May 12, 2023 4:02 pm    Post subject: Re: Install nvidia-docker v2 in Gentoo Reply with quote

Hi, vowstar, nvidia-container-toolkit-1.12.1 is not worked for me, can you update it to nvidia-container-toolkit-1.13.1.ebuild?
vowstar wrote:


I fixed the nvidia-container-toolkit (aka. nvidia-docker2 ) issue under gentoo and got this working.

https://github.com/vowstar/vowstar-overlay

Assume you have add yourself in docker group

OpenRC
Code:

sudo layman --add=vowstar
sudo emerge -av nvidia-container-toolkit
sudo rc-service docker restart
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi


systemd
Code:

sudo layman --add=vowstar
sudo emerge -av nvidia-container-toolkit
sudo systemctl restart docker
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi


Result

Code:

$ docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
Fri Jun 12 17:23:54 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  Off  | 00000000:0A:00.0  On |                  N/A |
|  0%   51C    P0    62W / 300W |   1413MiB / 11016MiB |      8%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

$ uname -a
Linux ryzen 5.6.17-gentoo #1 SMP PREEMPT Mon Jun 8 11:35:26 CST 2020 x86_64 AMD Ryzen 9 3900X 12-Core Processor AuthenticAMD GNU/Linux
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum