Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Can not install nvidia-docker2 with docker 17.12.0-ce installed #607

Closed
lsy643 opened this issue Jan 18, 2018 · 8 comments
Closed

Can not install nvidia-docker2 with docker 17.12.0-ce installed #607

lsy643 opened this issue Jan 18, 2018 · 8 comments

Comments

@lsy643
Copy link

lsy643 commented Jan 18, 2018

1. Issue or feature description

When I install the nvidia-docker2 in my Ubuntu 16.04 server, the os reports:
The following packages have unmet dependencies: nvidia-docker2 : Depends: docker-ce (= 17.12.0~ce-0~ubuntu) but it is not installable or docker-ee (= 17.12.0~ee-0~ubuntu) but it is not installable E: Unable to correct problems, you have held broken packages.

I have searched related issues, and I think I have not installed the correct docker version. The nvidia-docker2 requires 17.12.0-1, but I can not find it. The most related version I can find is 17.12.0-ce.

2. Information to attach (optional if deemed irrelevant)

@flx42
Copy link
Member

flx42 commented Jan 19, 2018

What's dpkg -l | grep docker?

@lsy643
Copy link
Author

lsy643 commented Jan 19, 2018

I have upgrade the docker with following commands, and it worked for me.

  1. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  2. sudo apt-key fingerprint 0EBFCD88
  3. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
  4. sudo apt-get update
  5. sudo apt-get install docker-ce
  6. sudo service docker restart

@boriskovalev
Copy link

@lsy643
3.sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
command not work

@boriskovalev
Copy link

@flx42
I'm working by

Make sure you have installed the NVIDIA driver and a supported version of Docker for your distribution (see prerequisites).

If you have a custom /etc/docker/daemon.json, the nvidia-docker2 package might override it.

Xenial x86_64

If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers

docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker

Add the package repositories

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey |
sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list |
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

Install nvidia-docker2 and reload the Docker daemon configuration

sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

Test nvidia-smi with the latest official CUDA image

I'm trying to test nvidia-docker 2.0 (we start containers via the Docker API and we cannot use 1.0), but I am getting this error:
$ sudo docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
docker: Error response from daemon: Unknown runtime specified nvidia.
See 'docker run --help'.

dpkg -l | grep docker

ii docker-ce 17.12.0ce-0ubuntu amd64 Docker: the open-source application container engine
ii nvidia-container-runtime 1.1.1+docker17.12.0-1 amd64 NVIDIA container runtime
ii nvidia-docker2 2.0.2+docker17.12.0-1 all nvidia-docker CLI wrapper

The content of my /etc/docker/daemon.json

{
"bip": "172.16.22.1/24",
"fixed-cidr": "172.16.22.0/24",
"mtu": 1500,
"dns": ["8.8.8.8","8.8.4.4"]
}

How to solve the issue?
Thanks

@flx42
Copy link
Member

flx42 commented Jan 22, 2018

@flx42 flx42 closed this as completed Jan 22, 2018
@editaxz
Copy link

editaxz commented Jun 24, 2018

@boriskovalev , this working for me:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce=17.12.0ce-0ubuntu
sudo service docker restart

Thanks.

@juanluisrosaramos
Copy link

sudo apt-get install docker-ce=18.03.1ce-0ubuntu
Did it for me

@juanluisrosaramos
Copy link

sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants