Nvidia-docker: Support for Ubuntu 19.04

Created on 3 May 2019  路  7Comments  路  Source: NVIDIA/nvidia-docker

Hi Guys, I'm trying to install nvidia-docker2 on Ubuntu 19.04.

I've tried editing the makefile, but still running into issues.

Is support for 19.04 planned?

This is what I've attempted, but unfortunately it didn't work. Any ideas?

19.03.0-ubuntu19.04: ARCH := amd64
19.03.0-ubuntu19.04:
    $(DOCKER) build --build-arg VERSION_ID="19.04" \
                        --build-arg RUNTIME_VERSION="$(RUNTIME_VERSION)+docker19.03.0-1" \
                        --build-arg DOCKER_VERSION="docker-ce (= 5:19.03.0~1.3.beta3-0~ubuntu-disco) | docker-ee (= 5:19.03.0~1.3.beta3-0~ubuntu-disco)" \
                        --build-arg PKG_VERS="$(VERSION)+docker19.03.0" \
                        --build-arg PKG_REV="$(PKG_REV)" \
                        -t "nvidia/nvidia-docker2/ubuntu:19.04-docker19.03.0" -f Dockerfile.ubuntu .
    $(MKDIR) -p $(DIST_DIR)/ubuntu19.04/$(ARCH)
    $(DOCKER) run  --cidfile [email protected] "nvidia/nvidia-docker2/ubuntu:19.04-docker19.03.0"
    $(DOCKER) cp $$(cat [email protected]):/dist/. $(DIST_DIR)/ubuntu19.04/$(ARCH)
    $(DOCKER) rm $$(cat [email protected]) && rm [email protected]

Output from docker info

Client:
 Debug Mode: false
 Plugins:
  app: Docker Application (Docker Inc., v0.8.0-beta1)

Server:
 Containers: 6
  Running: 0
  Paused: 0
  Stopped: 6
 Images: 1114
 Server Version: 19.03.0-beta3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
 runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.0.0-13-generic
 Operating System: Ubuntu 19.04
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.53GiB
 Name: deon-XPS-15-9550
 ID: 04bdbc24-8f21-4b75-af03-90dda517e2a9
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: deonblaauw
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Output from nvidia-docker -v

Docker version 19.03.0-beta3, build c55e026

Output from nvidia-smi

| NVIDIA-SMI 418.56       Driver Version: 418.56       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 960M    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   40C    P0    N/A /  N/A |    365MiB /  2004MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1736      G   /usr/lib/xorg/Xorg                           132MiB |
|    0      2146      G   /usr/bin/gnome-shell                         133MiB |
|    0      2903      G   ...-token=DE54CCCA708D1852BF6EC2E1FAD7C513    49MiB |
|    0     10463      G   ...quest-channel-token=6029542267302983540    45MiB |
+-----------------------------------------------------------------------------+

This the output when running make ubuntu19.04

docker build --build-arg VERSION_ID="19.04" \
                    --build-arg RUNTIME_VERSION="2.0.0+docker19.03.0-1" \
                    --build-arg DOCKER_VERSION="docker-ce (= 5:19.03.0~1.3.beta3-0~ubuntu-disco) | docker-ee (= 5:19.03.0~1.3.beta3-0~ubuntu-disco)" \
                        --build-arg PKG_VERS="2.0.3+docker19.03.0" \
                        --build-arg PKG_REV="1" \
                        -t "nvidia/nvidia-docker2/ubuntu:19.04-docker19.03.0" -f Dockerfile.ubuntu .
Sending build context to Docker daemon  84.48kB
Step 1/21 : ARG VERSION_ID
Step 2/21 : FROM ubuntu:${VERSION_ID}
 ---> f723e3b6f1bd
Step 3/21 : RUN apt-get update && apt-get install -y --no-install-recommends         dh-make         fakeroot         build-essential         devscripts         lsb-release &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> da76dabc7726
Step 4/21 : ARG PKG_VERS
 ---> Using cache
 ---> 13a6f4a3c10e
Step 5/21 : ARG PKG_REV
 ---> Using cache
 ---> ebf3e01447dc
Step 6/21 : ARG RUNTIME_VERSION
 ---> Using cache
 ---> af03a54c61bb
Step 7/21 : ARG DOCKER_VERSION
 ---> Using cache
 ---> 0e1066b491ec
Step 8/21 : ENV DEBFULLNAME "NVIDIA CORPORATION"
 ---> Using cache
 ---> 590fd39c511b
Step 9/21 : ENV DEBEMAIL "[email protected]"
 ---> Using cache
 ---> 6969479ca1a7
Step 10/21 : ENV REVISION "$PKG_VERS-$PKG_REV"
 ---> Using cache
 ---> 483b0cc16649
Step 11/21 : ENV RUNTIME_VERSION $RUNTIME_VERSION
 ---> Using cache
 ---> c3a22a79ee49
Step 12/21 : ENV DOCKER_VERSION $DOCKER_VERSION
 ---> Using cache
 ---> 48fb4305370e
Step 13/21 : ENV SECTION ""
 ---> Using cache
 ---> b874f936ad63
Step 14/21 : ENV DIST_DIR=/tmp/nvidia-docker2-$PKG_VERS
 ---> Using cache
 ---> 087785fe6b9c
Step 15/21 : RUN mkdir -p $DIST_DIR /dist
 ---> Using cache
 ---> f1a361aafe0e
Step 16/21 : COPY nvidia-docker $DIST_DIR/nvidia-docker
 ---> Using cache
 ---> 149daf53a123
Step 17/21 : COPY daemon.json $DIST_DIR/daemon.json
 ---> Using cache
 ---> 8b22a48f70f9
Step 18/21 : WORKDIR $DIST_DIR
 ---> Using cache
 ---> de7c54a38da0
Step 19/21 : COPY debian ./debian
 ---> Using cache
 ---> 9cb8b4cca14e
Step 20/21 : RUN sed -i "s;@VERSION@;${REVISION#*+};" debian/changelog &&     if [ "$REVISION" != "$(dpkg-parsechangelog --show-field=Version)" ]; then exit 1; fi
 ---> Using cache
 ---> 850405a68a3e
Step 21/21 : CMD export DISTRIB="$(lsb_release -cs)" &&     debuild --preserve-env --dpkg-buildpackage-hook='sh debian/prepare' -i -us -uc -b &&     mv /tmp/*.deb /dist
 ---> Using cache
 ---> 513793f743d4
Successfully built 513793f743d4
Successfully tagged nvidia/nvidia-docker2/ubuntu:19.04-docker19.03.0
mkdir -p /home/deon/Github/nvidia-docker/dist/ubuntu19.04/amd64
docker run  --cidfile 19.03.0-ubuntu19.04.cid "nvidia/nvidia-docker2/ubuntu:19.04-docker19.03.0"
 dpkg-buildpackage -us -uc -ui --hook-init=sh debian/prepare -i -b
dpkg-buildpackage: info: source package nvidia-docker2
dpkg-buildpackage: info: source version 2.0.3+docker19.03.0-1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by NVIDIA CORPORATION <[email protected]>
 sh debian/prepare
dpkg-buildpackage: info: host architecture amd64
dpkg-buildpackage: info: running hook init
 dpkg-source -i --before-build .
 debian/rules clean
dh clean
   dh_clean
 debian/rules build
dh build
   dh_update_autotools_config
 debian/rules binary
dh binary
   dh_testroot
   dh_prep
   dh_install
   dh_installdocs
   dh_installchangelogs
   dh_lintian
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_missing
   dh_installdeb
   dh_gencontrol
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'nvidia-docker2' in '../nvidia-docker2_2.0.3+docker19.03.0-1_all.deb'.
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../nvidia-docker2_2.0.3+docker19.03.0-1_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source -i --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)
docker cp $(cat 19.03.0-ubuntu19.04.cid):/dist/. /home/deon/Github/nvidia-docker/dist/ubuntu19.04/amd64
docker rm $(cat 19.03.0-ubuntu19.04.cid) && rm 19.03.0-ubuntu19.04.cid
74615ae55bc27c53de8ff6e087c80bbdd012347f822f58fcccc1da2ee6e56291

This is the output when installing using the command sudo dpkg -i nvidia-docker2_2.0.3+docker19.03.0-1_all.deb

(Reading database ... 166790 files and directories currently installed.)
Preparing to unpack nvidia-docker2_2.0.3+docker19.03.0-1_all.deb ...
Unpacking nvidia-docker2 (2.0.3+docker19.03.0-1) over (2.0.3+docker18.09.2-1) ...
dpkg: dependency problems prevent configuration of nvidia-docker2:
 nvidia-docker2 depends on nvidia-container-runtime (= 2.0.0+docker19.03.0-1); however:
  Package nvidia-container-runtime is not installed.

dpkg: error processing package nvidia-docker2 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 nvidia-docker2

Most helpful comment

Hello!

Use the following instructions, it installs the 18.04 debs, which are equivalent on 19.04

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution="ubuntu18.04"
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

# 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
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

If you wanted to install through dpkg, you would also have to install the nvidia-container-runtime package provided by the following repo: https://github.com/NVIDIA/nvidia-container-runtime

All 7 comments

+1

Hello!

Use the following instructions, it installs the 18.04 debs, which are equivalent on 19.04

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution="ubuntu18.04"
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

# 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
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

If you wanted to install through dpkg, you would also have to install the nvidia-container-runtime package provided by the following repo: https://github.com/NVIDIA/nvidia-container-runtime

This doesn't seem to work without having issues with dependencies.

$ 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.6~3-0~ubuntu-bionic) but 5:18.09.3~3-0~ubuntu-cosmic is to be installed or
                           docker-ee (= 5:18.09.6~3-0~ubuntu-bionic) but it is not installable

So this is what I had to do:

sudo apt-get install nvidia-container-runtime
apt download nvidia-docker2
sudo dpkg --ignore-depends=docker-ce -i nvidia-docker2_2.0.3+docker18.09.6-3_all.deb

See our FAQ on installing with older versions of docker: https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0)#older-versions-of-docker

In your case you would have had to do:

sudo apt-get install -y nvidia-docker2=2.0.3+docker18.09.3-1 nvidia-container-runtime=2.0.0+docker18.09.3-1

Hi. Was going to open a new issue. Will 19.04 of Ubuntu (specifically Pop!_OS) be supported soon?

is it supported now or someone install it successfully

+1 , still not supported at the moment

Was this page helpful?
0 / 5 - 0 ratings