I couldn’t use nvidia GPUs on docker build command. This issue only occurs on docker==23.0.1 but not on docker==20.10.10. I’d like to use latest docker so any idea or advice would be applicated.
$ docker --version
Docker version 23.0.1, build a5ee5b1
$ cat /etc/docker/daemon.json
{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}
}
$ docker run --rm --entrypoint "" nvcr.io/nvidia/pytorch:22.08-py3 nvidia-smi --query-gpu=name --format=csv
name
NVIDIA GeForce RTX 2080 Ti
Dockerfile
FROM nvcr.io/nvidia/pytorch:22.08-py3
RUN nvcc -V
RUN python -c "import torch; print(torch.cuda.is_available())"
RUN nvidia-smi
$ docker build -t test .
#4 [1/4] FROM nvcr.io/nvidia/pytorch:22.08-py3
#4 CACHED
#5 [2/4] RUN nvcc -V
#5 0.316 nvcc: NVIDIA (R) Cuda compiler driver
#5 0.316 Copyright (c) 2005-2022 NVIDIA Corporation
#5 0.316 Built on Wed_Jun__8_16:49:14_PDT_2022
#5 0.316 Cuda compilation tools, release 11.7, V11.7.99
#5 0.316 Build cuda_11.7.r11.7/compiler.31442593_0
#5 DONE 0.3s
#6 [3/4] RUN python -c "import torch; print(torch.cuda.is_available())"
#6 0.993 False
#6 DONE 1.1s
#7 [4/4] RUN nvidia-smi
#7 0.482 /bin/bash: nvidia-smi: command not found
#7 ERROR: process "/bin/sh -c nvidia-smi" did not complete successfully: exit code: 127
------
> [4/4] RUN nvidia-smi:
#7 0.482 /bin/bash: nvidia-smi: command not found
------
Dockerfile:4
--------------------
2 | RUN nvcc -V
3 | RUN python -c "import torch; print(torch.cuda.is_available())"
4 | >>> RUN nvidia-smi
5 |
--------------------
ERROR: failed to solve: process "/bin/sh -c nvidia-smi" did not complete successfully: exit code: 127