Skip to main content

Install drivers for GPU node groups in a Managed Kubernetes cluster

Last update:

You can create Managed Kubernetes clusters on a cloud server with GPU without pre-installed drivers. To install the driver yourself, use the NVIDIA® GPU Operator.

  1. Connect to the cluster.

  2. Install the Helm package manager, version 3.7.0 or higher.

  3. Add the nvidia repository to Helm:

    helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
  4. Update the nvidia repository in Helm:

    helm repo update
  5. Install the NVIDIA GPU Operator and specify the required GPU driver version:

    helm install \
    --namespace gpu-operator \
    --create-namespace \
    --set driver.version=<driver_version> \
    gpu-operator nvidia/gpu-operator

    Specify <driver_version> — the NVIDIA® driver version. You can check it in the NVIDIA GPU Driver row in the GPU Operator Component Matrix table in the NVIDIA® documentation.

  6. To verify that the NVIDIA GPU Operator and GPU driver are installed correctly, run a GPU application. For example, the CUDA VectorAdd application for vector addition:

    cat << EOF | kubectl create -f -
    apiVersion: v1
    kind: Pod
    metadata:
    name: cuda-vectoradd
    spec:
    restartPolicy: OnFailure
    containers:
    - name: cuda-vectoradd
    image: "nvidia/samples:vectoradd-cuda11.2.1"
    resources:
    limits:
    nvidia.com/gpu: 1
    EOF
  7. Check that the CUDA VectorAdd application has completed successfully — the pod status should be Completed:

    kubectl get pods

    In the response, the cuda-vectoradd pod will have the status Completed:

    NAME READY STATUS RESTARTS AGE
    cuda-vectoradd 0/1 Completed 0 51s