Nvidia-docker: Bad interpreter error with nvidia-docker2

Created on 13 Dec 2018  ·  3Comments  ·  Source: NVIDIA/nvidia-docker

I am currently attempting to install and test nvidia-docker on a Fedora 29 system, and I have followed the suggested install process for Fedora by using the following commands:

curl -s -L https://nvidia.github.io/nvidia-docker/centos7/nvidia-docker.repo | \
  sudo tee /etc/yum.repos.d/nvidia-docker.repo
sudo dnf install nvidia-docker2
sudo pkill -SIGHUP dockerd

However, I have come across the following error output when running the nvidia-docker command after install:

/usr/bin/nvidia-docker: /usr/bin/docker: /bin/sh: bad interpreter: Permission denied
/usr/bin/nvidia-docker: line 34: /usr/bin/docker: Success

Most helpful comment

I have the same problem as you when I use following command:
docker --runtime=nvidia run --rm ufoym/deepo nvidia-smi
Then my elder brother LvJC told me to use the following commands instead of that one:
docker run --runtime=nvidia --rm ufoym/deepo nvidia-smi
and it works!

All 3 comments

I have the same problem as you when I use following command:
docker --runtime=nvidia run --rm ufoym/deepo nvidia-smi
Then my elder brother LvJC told me to use the following commands instead of that one:
docker run --runtime=nvidia --rm ufoym/deepo nvidia-smi
and it works!

Actually, upon further investigation, I noticed that I cannot restart docker properly after reloading the daemon (after the nvidia-docker2 install). I used the following commands:

sudo systemctl daemon-reload
sudo systemctl restart docker

After the restart docker command, I get the following error output:

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

And when taking a look at the docker.service status, I see the following:

systemd[1]: Starting Docker Application Container Engine...
dockerd-current[15237]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: runtimes: (from flag: [oci], from file: map[nvidia:map[path:/usr/bin/nvidia-container-runtime runtimeArgs:[]]])
systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: docker.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Docker Application Container Engine.

```

Hello!

Looks like you figured out the issue here. You need to make sure that the options specified in your systemd file aren't repeated in your /etc/docker/daemon.json file (prefer the config file).

If you have any other question feel free to reopen!
Thanks!

Was this page helpful?
0 / 5 - 0 ratings