Closed schra closed 5 years ago
Thank you for your suggestion! I was not aware of this new docker option.
Would it be possible to extend the --gpu option to check if the --gpus option works and then use it or otherwise fallback to the current solution?
In general it would be possible. There is one quite annoying point: Option --gpus
works for NVIDIA hardware only. It looks like an ugly and unethical vendor-lock-in.
--gpus
option is tied to NVIDIA hardware onlyThe new --gpus
option is tied to NVIDIA docker images only.
I've asked at docker: https://github.com/docker/cli/issues/1200#issuecomment-523484204
So far the new option is worth less than the previous --runtime=nvidia
solution.
With my AMD GPU docker fails with:
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
To be a serious option, docker must support other vendors, too.
I'm btw not really sure why nvidia-smi isn't found when using x11docker's --gpu option, but somehow it's missing:
It seems the command nvidia-smi
is missing in nvidia/cuda:9.0-base
but added by the --gpus all
option to the container system:
$ docker run --rm nvidia/cuda:9.0-base nvidia-smi
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"nvidia-smi\": executable file not found in $PATH": unknown.
To compare with x11docker use image nvidia/cuda
instead:
x11docker --gpu --runtime=nvidia -- nvidia/cuda nvidia-smi
I have opened a new ticket at docker to discuss general GPU support by --gpus
: https://github.com/docker/cli/issues/2063
I don't see progress in the ticket mentioned above.
As long as --gpus
adds no value to the current solutions, x11docker won't use it.
Current solutions for closed source NVIDIA driver with x11docker are described in the wiki: https://github.com/mviereck/x11docker/wiki/NVIDIA-driver-support-for-docker-container
Docker 19.03 introduced the
--gpus
option (docker/cli#1714), whichx11docker
could make use of. Currently you have to pass the--gpus
option manually:Would it be possible to extend the
--gpu
option to check if the--gpus
option works and then use it or otherwise fallback to the current solution?I'm btw not really sure why
nvidia-smi
isn't found when using x11docker's--gpu
option, but somehow it's missing:Also see https://github.com/NVIDIA/nvidia-docker#quickstart