Docker Daemon API upgrade to v1.4

Viewed 3210

I'm unable to use the below command to use nvidia gpus inside the container :

docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

"--gpus" requires API version 1.40, but the Docker daemon API version is 1.39

It requires API version 1.4 :

Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.39
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:45:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.9
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.11.13
  Git commit:       039a7df
  Built:            Wed Sep  4 16:19:38 2019
  OS/Arch:          linux/amd64
  Experimental:     false ```

I'm unable to find a way to upgrade the daemon api .

Please help.

2 Answers

I had the exact issue. For me updating docker-ce worked.

$ apt search docker-ce                                                                                                    
 Sorting... Done
 Full Text Search... Done
 docker-ce/xenial 5:19.03.12~3-0~ubuntu-xenial amd64 [upgradable from: 5:18.09.6~3-0~ubuntu-xenial] Docker: the open-source application container engine

 docker-ce-cli/xenial,now 5:19.03.12~3-0~ubuntu-xenial amd64 [installed,automatic] Docker CLI: the open-source application container engine

$ apt install docker-ce
$ docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

As you can see, I had docker client docker-ce-cli (v19.03) installed but the docker server installed was v18.09.

If there's no possibility to update the docker (if you're have no root rights on this very machine). And assuming nvidia-docker installed, try the following signature:

nvidia-docker run --rm \
  ...
  -e NVIDIA_VISIBLE_DEVICES=0,1 \
  ...

That way you'll call nvidia-docker runtime and restrict visible GPUs with 0,1 (you choose which ones to have visible)

Related