How to expose all GPUs to Kubernetes without the command "--gpus all" in docker 19.03?

2/19/2020

I want to install Kubernetes and docker 19.03 with NVIDIA GPU supporting. Before docker 19.03, the default rumtime of docker needs to be assigned to nvidia. Now the method is not supported, the recommend method is to insert "--gpus all" in command line. Is there any way to make "--gpus all" as the default setting of docker? It is also acceptable to change the command of Kubernetes for invoking docker, but I have not found the solution. BTW, I don't want to use NVIDIA's k8s-device-plugin because I want to control GPUs by myself. I just need all GPUs are exposed to PODs.

-- Lennox Wu
docker
kubernetes
nvidia-docker

1 Answer

2/27/2020

According to NVIDIA's documents, we need to install Nvidia docker 2.0 even if it is not a recommended method. After the installing, you can set the Nvidia runtime as the default. Kubernetes cannot support the new command "--gpus all" currently.

-- Lennox Wu
Source: StackOverflow