How to pass Docker CLI `--gpus` Options in Kubernetes or enable GPU support without installing `nvidia-docker2` (Docker 19.03)
GPU's are scheduled via device plugins in Kubernetes.
The official NVIDIA GPU device plugin has the following requirements:
- Kubernetes nodes have to be pre-installed with NVIDIA drivers.
- Kubernetes nodes have to be pre-installed with nvidia-docker 2.0
- nvidia-container-runtime must be configured as the default runtime for docker instead of runc.
- NVIDIA drivers ~= 361.93
Once the nodes are setup GPU's become another resource in your spec like cpu
or memory
.
spec: containers: - name: gpu-thing image: whatever resources: limits: nvidia.com/gpu: 1