Nvidia-docker: Unable to install nvidia-docker2 based on docker 18.06.0-ce

Created on 9 Nov 2018  Â·  6Comments  Â·  Source: NVIDIA/nvidia-docker

_The template below is mostly useful for bug reports and support questions. Feel free to remove anything which doesn't apply to you and add more information where it makes sense._

_Also, before reporting a new issue, please make sure that:_


1. Issue or feature description

I want to install nvidia-docker2 based on docker 18.06.0-ce. however, it's failed.

2. Steps to reproduce the issue

$ sudo apt-get install -y nvidia-docker2
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 (= 5:18.09.0~3-0~ubuntu-xenial) but 18.06.0~ce~3-0~ubuntu is to be installed or
                           docker-ee (= 5:18.09.0~3-0~ubuntu-xenial) but it is not installable
E: Unable to correct problems, you have held broken packages.

3. Information to attach (optional if deemed irrelevant)

  • [ ] Kernel version from uname -a

Linux dacent 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

  • [ ] Any relevant kernel output lines from dmesg
  • [ ] Driver information from nvidia-smi -a
==============NVSMI LOG==============

Timestamp                           : Fri Nov  9 03:21:14 2018
Driver Version                      : 390.87

Attached GPUs                       : 2
GPU 00000000:02:00.0
    Product Name                    : Tesla P100-PCIE-16GB
    Product Brand                   : Tesla
    Display Mode                    : Enabled
    Display Active                  : Disabled
    Persistence Mode                : Disabled
    Accounting Mode                 : Disabled
    Accounting Mode Buffer Size     : 4000
  • [ ] Docker version from docker version
Client:
 Version:           18.06.0-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        0ffa825
 Built:             Wed Jul 18 19:11:02 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.0-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       0ffa825
  Built:            Wed Jul 18 19:09:05 2018
  OS/Arch:          linux/amd64
  Experimental:     false


  • [ ] NVIDIA packages version from dpkg -l '*nvidia*' _or_ rpm -qa '*nvidia*'
||/ Name                                Version                Architecture           Description
+++-===================================-======================-======================-============================================================================
ii  libnvidia-container-tools           1.0.0-1                amd64                  NVIDIA container runtime library (command-line tools)
ii  libnvidia-container1:amd64          1.0.0-1                amd64                  NVIDIA container runtime library
ii  nvidia-387                          390.87-0ubuntu0~gpu16. amd64                  Transitional package for nvidia-390
ii  nvidia-390                          390.87-0ubuntu0~gpu16. amd64                  NVIDIA binary driver - version 390.87
un  nvidia-driver-binary                <none>                 <none>                 (no description available)
un  nvidia-libopencl1-390               <none>                 <none>                 (no description available)
un  nvidia-libopencl1-dev               <none>                 <none>                 (no description available)
un  nvidia-opencl-icd                   <none>                 <none>                 (no description available)
ii  nvidia-opencl-icd-390               390.87-0ubuntu0~gpu16. amd64                  NVIDIA OpenCL ICD
un  nvidia-persistenced                 <none>                 <none>                 (no description available)
un  nvidia-prime                        <none>                 <none>                 (no description available)
un  nvidia-settings                     <none>                 <none>                 (no description available)
un  nvidia-smi                          <none>                 <none>                 (no description available)
  • [ ] NVIDIA container library version from nvidia-container-cli -V
version: 1.0.0
build date: 2018-09-20T20:18+00:00
build revision: 881c88e2e5bb682c9bb14e68bd165cfb64563bb1
build compiler: gcc-5 5.4.0 20160609
build platform: x86_64
build flags: -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -DNDEBUG -std=gnu11 -O2 -g -fdata-sections -ffunction-sections -fstack-protector -fno-strict-aliasing -fvisibility=hidd
en -Wall -Wextra -Wcast-align -Wpointer-arith -Wmissing-prototypes -Wnonnull -Wwrite-strings -Wlogical-op -Wformat=2 -Wmissing-format-attribute -Winit-self -Wshadow -Wstrict-prototypes -Wunreachable-code -Wconversion -Wsign-conversion -Wno-unknown-warning-option -Wno-format-extra-args -Wno-gnu-alignof-expression -Wl,-zrelro -Wl,-znow -Wl,-zdefs -Wl,--gc-sections
  • [ ] NVIDIA container library logs (see troubleshooting)
  • [ ] Docker command, image and tag used

    • [ ] apt-cache policy docker-ce
$ sudo apt-cache policy docker-ce
docker-ce:
  Installed: 18.06.0~ce~3-0~ubuntu
  Candidate: 18.06.0~ce~3-0~ubuntu
  Version table:
 *** 18.06.0~ce~3-0~ubuntu 100
        100 /var/lib/dpkg/status

Most helpful comment

For those who come here with same problem, I will leave some prescriptions for this problem

$ sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu
$ sudo apt-get install nvidia-docker2=2.0.3+docker18.03.1-1 nvidia-container-runtime=2.0.0+docker18.03.1-1
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
 # Let's test
$  sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

All 6 comments

Ok, if I want to install nvidia-docker based on old version of docker. I should follow with How do I install 2.0 if I'm not using the latest Docker version? in wiki.

For those who come here with same problem, I will leave some prescriptions for this problem

$ sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu
$ sudo apt-get install nvidia-docker2=2.0.3+docker18.03.1-1 nvidia-container-runtime=2.0.0+docker18.03.1-1
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
 # Let's test
$  sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

Hi @terasakisatoshi , thanks for this. Your installation instructions worked!

This will happen if either you have incompatible version of docker installed or docker not installed at all.
In either case, install docker PROPERLY as mentioned in the link ( https://docs.docker.com/install/linux/docker-ce/ubuntu/ )

If output of command 'apt-cache madison docker-ce' is blank then solve it by step 4 (Adding repository) of same link

I've had this issue with both too new and too old versions of Docker. This is the solution I came up with to install exactly the right version:

DOCKER_CE_VERSION=`apt-cache show nvidia-docker2 | grep -Po "(?<=docker-ce \(= )([^)]*)" | head -n 1`
apt-get -yq install nvidia-docker2 docker-ce=${DOCKER_CE_VERSION}

For those who come here with same problem, I will leave some prescriptions for this problem

$ sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu
$ sudo apt-get install nvidia-docker2=2.0.3+docker18.03.1-1 nvidia-container-runtime=2.0.0+docker18.03.1-1
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
 # Let's test
$  sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

By typing this text: "sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu" It gave me an error: " Version '18.03.1~ce-0~ubuntu' for 'docker-ce' was not found".

Was this page helpful?
0 / 5 - 0 ratings