Update Nvidia docker 2.0 to GPU-enabled Docker 19.03

2019/7/31

With the release of Docker 2019 on July 7, 25, Nvidia GPUs are now supported natively.It seems that Nvidia Docker 19.03 will be abolished in the future.

Just recently, I just installed Nvidia docker 2It was, but I will update to Docker 19.03 immediately.

Environment
Ubuntu LTS 18.04

procedure

Official procedure (Upgrading with nvidia-docker2) To update.

$ sudo apt-get update $ sudo apt-get --only-upgrade install docker-ce nvidia-docker2 $ sudo systemctl restart docker # Operation check $ docker run --gpus all nvidia / cuda: 9.0-base nvidia-smi

I got an error.

unknown flag: –gpus
See'docker run –help'.

# Try updating everything $ sudo apt-get install docker-ce docker-ce-cli containerd.io

containerd.io is already the latest version (1.2.6-3).
docker-ce is already the latest version (5: 19.03.1 ~ 3-0 ~ ubuntu-bionic).
The following packages will be upgraded: docker-ce-cli
Upgrades: 1, New installations: 0, Deletions: 0, Pending: 73.
I need to get a 42.5 MB archive.
An additional 114 MB of disk space will be consumed after this operation.
Do you want to continue? [Y / n]

Was it due to unupdated docker-ce-cli?

# Check operation again $ docker run --gpus all nvidia / cuda: 9.0-base nvidia-smi
+ ------------------------------------------------- ---------------------------- + | NVIDIA-SMI 430.26 Driver Version: 430.26 CUDA Version: 10.2 | | ------ ------------------------- + ---------------------- +- --------------------- + | 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 1080 Off | 00000000: 01: 00.0 On | N / A | | 62% 29C P8 14W / 215W | 336MiB / 8116MiB | 0% Default | + ----------------------- -------- + ---------------------- + ------------------ ---- + + -------------------------------------------- --------------------------------- + | Processes: GPU Memory | | GPU PID Type Process name Usage | | = ================================================== ========================== | + ---------------------- -------------------------------------------------- ----- +

It worked for the time being.