Skip to content

[Feature Request] Make nvidia-operator-validator add a validation successful label or taint on the node #475

Description

@chiragjn

1. Quick Debug Checklist

  • Are you running on an Ubuntu 18.04 node?
  • Are you running Kubernetes v1.13+?
  • Are you running Docker (>= 18.06) or CRIO (>= 1.13+)?
  • Do you have i2c_core and ipmi_msghandler loaded on the nodes?
  • Did you apply the CRD (kubectl describe clusterpolicies --all-namespaces)

1. Issue or feature description

My workload pattern and issue is pretty much similar to #261 except my workloads pods have GPU resource limits mentioned. On scheduling a pod, a fresh GPU instance is provisioned and gpu-operator starts working however the validations (mainly the plugin one) cannot be run because my workloads pods have GPU resource limits mentioned and would steal it away.

Things still work anyway because device plugin DaemonSet is running by that point. Any way I can make the validation steps run before my pod is scheduled?
One way I can think of is to give validation pods system-node-critical priority or they can add some taint/label to the node indicating the node was successfully validated so I can adjust affinities in my workload spec to keep it from scheduling first

2. Steps to reproduce the issue

  1. Add a GPU node to the cluster (I am using AWS Karpenter on EKS for this)
  2. Immediately schedule a pod with affinity for that node and "nvidia.com/gpu" resource limit

3. Information to attach (optional if deemed irrelevant)

$ kubectl get pods -n gpu-operator
NAME                                                             READY   STATUS                     RESTARTS   AGE
cj-gpu-operator-node-feature-discovery-master-6b95978f7c-ldttm   1/1     Running                    0          5h3m
cj-gpu-operator-node-feature-discovery-worker-wbf45              1/1     Running                    0          3m31s
gpu-feature-discovery-zvq8k                                      1/1     Running                    0          2m4s
gpu-operator-6f64c86bc-jmdqm                                     1/1     Running                    0          5h3m
nvidia-container-toolkit-daemonset-tndwn                         1/1     Running                    0          2m4s
nvidia-cuda-validator-gd77h                                      0/1     Completed                  0          98s
nvidia-dcgm-exporter-5t9kh                                       1/1     Running                    0          2m4s
nvidia-device-plugin-daemonset-qkkcv                             1/1     Running                    0          2m4s
nvidia-device-plugin-validator-jqt5j                             0/1     UnexpectedAdmissionError   0          87s
nvidia-operator-validator-qtbpl                                  0/1     Init:3/4                   0          2m4s

$ kubectl describe pod nvidia-device-plugin-validator-jqt5j -n gpu-operator
Name:           nvidia-device-plugin-validator-jqt5j
Namespace:      gpu-operator
Priority:       0
Node:           ip-10-2-46-0.eu-west-1.compute.internal/
Start Time:     Tue, 17 Jan 2023 23:55:19 +0530
Labels:         app=nvidia-device-plugin-validator
Annotations:    kubernetes.io/psp: eks.privileged
Status:         Failed
Reason:         UnexpectedAdmissionError
Message:        Pod Allocate failed due to requested number of devices unavailable for nvidia.com/gpu. Requested: 1, Available: 0, which is unexpected

$ kubectl logs nvidia-operator-validator-qtbpl -n gpu-operator -c plugin-validation
time="2023-01-17T18:25:14Z" level=info msg="GPU resources are not yet discovered by the node, retry: 1"
time="2023-01-17T18:25:19Z" level=info msg="pod nvidia-device-plugin-validator-jqt5j is curently in Pending phase"
time="2023-01-17T18:25:24Z" level=info msg="pod nvidia-device-plugin-validator-jqt5j is curently in Failed phase"
time="2023-01-17T18:28:29Z" level=info msg="pod nvidia-device-plugin-validator-jqt5j is curently in Failed phase"

Pod that gets scheduled first

apiVersion: v1
kind: Pod
metadata:
  name: cuda-vectoradd
spec:
  restartPolicy: OnFailure
  tolerations:
    - key: nvidia.com/gpu
      operator: Exists
      effect: NoSchedule
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
          - matchExpressions:
              - key: "karpenter.k8s.aws/instance-family"
                operator: "In"
                values:
                  - "g4dn"
      preferredDuringSchedulingIgnoredDuringExecution:
        - weight: 100
          preference:
            matchExpressions:
              - key: "nvidia.com/gpu.present"
                operator: "In"
                values:
                  - "true"
              - key: "nvidia.com/gpu.deploy.container-toolkit"
                operator: "In"
                values:
                  - "true"
              - key: "nvidia.com/gpu.deploy.device-plugin"
                operator: "In"
                values:
                  - "true"
              - key: "nvidia.com/gpu.deploy.driver"
                operator: "Exists"
              - key: "nvidia.com/gpu.deploy.operator-validator"
                operator: "In"
                values:
                  - "true"
    - name: cuda-vectoradd
      image: "nvidia/samples:vectoradd-cuda11.2.1"
      command:
        - "tail"
        - "-f"
        - "/dev/null"
      resources:
        limits:
          cpu: "0.5"
          memory: 1Gi
          nvidia.com/gpu: 1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureissue/PR that proposes a new feature or functionalitylifecycle/frozen

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions