Reputation: 41
I'm trying to install NVIDIA docker. I used these lines:
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
and then:
$ sudo apt-get install nvidia-docker
Now trying to check if it installed correctly by typing:
nvidia-docker run --rm nvidia/cuda nvidia-smi
This error appears:
nvidia-docker | 2018/11/06 13:09:24 Error: 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.38/version: dial unix /var/run/docker.sock: connect: permission denied
Later I tried:
sudo nvidia-docker run --rm nvidia/cuda nvidia-smi
This error appears:
Using default tag: latest latest: Pulling from nvidia/cuda 473ede7ed136: Pull complete c46b5fa4d940: Pull complete 93ae3df89c92: Pull complete 6b1eed27cade: Pull complete d31e9163d0a5: Pull complete 8668af631f88: Pull complete 0d99f8ab6ae2: Pull complete 74440c29d798: Pull complete Digest: sha256:a6b5fd418d1cd0bc6d8a60c1c4ba33670508487039b828904f8494ec29e6b450 Status: Downloaded newer image for nvidia/cuda:latest docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"nvidia-smi\": executable file not found in $PATH": unknown.
I install Linux with Ubuntu. Can someone help me, please?
Upvotes: 4
Views: 14485
Reputation: 339
Just for reference adding this note.
The latest tag is deprecated, and this error is expects:
Look under Deprecated: "latest" tag on https://hub.docker.com/r/nvidia/cuda
Upvotes: 1
Reputation: 117
Start by setting the GPG and remote repo for the package
$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ sudo tee /etc/apt/sources.list.d/nvidia-docker.list
Then update the apt lists
$ sudo apt-get update
Now you install nvidia-docker (2) and reload the Docker daemon configurations
$ sudo apt-get install -y nvidia-docker2
$ sudo pkill -SIGHUP dockerd
Nvidia GPUs first require drivers to be installed. Here is how you make sure they are installed
$ sudo apt-get remove nvidia -384 ; sudo apt-get install nvidia-384
Now, the only thing left to do is test your environment and to make sure everything is installed correctly. Just simply launch the nvidia-smi (system management interface) application.
$ docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
The output will be similar to this:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.77 Driver Version: 390.77 | |-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla K80 Off | 00000000:00:1E.0 Off | 0 | | N/A 39C P0 83W / 149W | 0MiB / 11441MiB | 98%
Default | +-------------------------------+----------------------+----------------------+
Reference: https://cnvrg.io/how-to-setup-docker-and-nvidia-docker-2-0-on-ubuntu-18-04/
Upvotes: 0
Reputation: 123
You have two errors which are quite self explicites.
First of all, it seems your login user is not allowed to connect to docker daemon. This is quite a standard issue, you just need to add your user login to docker group, It should solve this issue. You will need to logout/login again for this change to become active.
Second, this is also quite a standard linux issue, your shell has a environment variable called PATH , containing all folders where it will be looking for a command binary, when this command doesn't contain full path to the binary.
For exemple, when you typed curl to download docker-nvidia, your shell find it in /usr/bin/
folder, because this folder is declared into the PATH variable.
Same applies for containers you download and different users on your local system. You can investigate this specific error message and find this issue on github: https://github.com/NVIDIA/nvidia-docker/issues/388
Upvotes: 2