I'm new to Docker
and have a limited experience working with Linux
.
Trying to ramp up GIT
project (a machine learning project hosted on Github). The project uses GPU (Nvidia) and relies on Docker
and nvidia-docker2
and is coded in Python (3.5)
.
Following the README.md I successfully proceed until I get an error when installing nvidia-docker2
. (The first part of the readme.me up to and including the installation of nvidia-docker2
is in the link above).
To elaborate a bit, the README.md file has a step by step intallation guide on how to run the project it starts with the installation of nvidia drivers and other libraries which I'm able to install and verify they are working. But when it comes to installation of nvidia-docker2
:
sudo apt-get install -y nvidia-docker2
I get the following error:
The following packages have unmet dependencies:
nvidia-docker2 : Depends: docker-ce (= 18.03.1~ce~3-0~ubuntu) but
18.05.0~ce~3-0~ubuntu is to be installed or
docker-ee (= 18.03.1~ee~3-0~ubuntu) but it is not
Any help comments are welcome! Please see some additional elaborations below, and at the end of the post, I describe some of my attempts to solve this issue.
Thanks!
Some elaborations:
I reach the part where I have to install docker and it goes well, (quoting from the README.md) I run:
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
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
sudo docker run hello-world
sudo usermod -a -G docker $USER
It works fine and I can verify:
sudo apt-get install -y nvidia-docker2
So when I check
sudo docker version
I get the lates docker for bionic ubuntu that I have.
Client:
Version: 18.05.0-ce
API version: 1.37
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:16:13 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.05.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:14:23 2018
OS/Arch: linux/amd64
Experimental: false
I can then check that docker is set up and can run:
sudo docker run hello-world
so I get:
Hello from Docker!
[...]
However, when I proceed to the next block of instructions on README.md, where I have to install nvidia-docker2
I get an error:
I run
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
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 finally:
sudo apt-get install -y nvidia-docker2
the error appears:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nvidia-docker2 : Depends: docker-ce (= 18.03.1~ce~3-0~ubuntu) but 18.05.0~ce~3-0~ubuntu is to be installed or
docker-ee (= 18.03.1~ee~3-0~ubuntu) but it is not installable
E: Unable to correct problems, you have held broken packages.
What I tried to do to solve the issue:
- I've googled my issue and found this ticket on nvidia-github. The ticket is closed but (probably due to lacking expirience with linux) I can get what they are really saying there -- Is
nvidia-docker2
is not yet supported on Ubuntu18.04 at all? - On the same ticket , the last post by rockper suggests to install
docker.io
instead ofdocker-ce
, which should solvenvidia-docekr2
issue. I follow his suggestion, i.e. installdocker.io
(an I also edit the/etc/apt/sources.list
as rockper recommened). Then I can verify that I've successfully installeddocker.io
, i.e:
.
sudo docker version
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.10.1
Git commit: 7390fc6
Built: Wed Apr 18 01:23:11 2018
OS/Arch: linux/amd64
Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.10.1
Git commit: 7390fc6
Built: Wed Feb 28 17:46:05 2018
OS/Arch: linux/amd64
Experimental: false
Which is the latest docker.io
package on ubuntu. But I still get an error (though a bit different report)
sudo apt-get install -y nvidia-docker2
The following packages have unmet dependencies:
nvidia-docker2 : Depends: docker-ce (= 18.03.1~ce~3-0~ubuntu) but it is not
going to be installed or
docker-ee (= 18.03.1~ee~3-0~ubuntu) but it is not installable
E: Unable to correct problems, you have held broken packages.