Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.15.0 added nodeSelector "nvidia.com/mps.capable": "true"? #1085

Open
markusl opened this issue Dec 4, 2024 · 3 comments
Open

v0.15.0 added nodeSelector "nvidia.com/mps.capable": "true"? #1085

markusl opened this issue Dec 4, 2024 · 3 comments

Comments

@markusl
Copy link

markusl commented Dec 4, 2024

Hi!

I have successfully used v0.14.0 with AWS EKS to correctly identify GPU's of AL2 instances. However, with newer versions (starting from v0.15.0), it seems that the daemonset unexpectedly requires "MPS capable" nodes only:

       "nodeSelector": {
          "nvidia.com/mps.capable": "true"
        },

However, in previous versions, the affinity configuration looks like this:

        "affinity": {
          "nodeAffinity": {
            "requiredDuringSchedulingIgnoredDuringExecution": {
              "nodeSelectorTerms": [
                {
                  "matchExpressions": [
                    {
                      "key": "feature.node.kubernetes.io/pci-10de.present",
                      "operator": "In",
                      "values": [
                        "true"
                      ]
                    }
                  ]
                },
                {
                  "matchExpressions": [
                    {
                      "key": "feature.node.kubernetes.io/cpu-model.vendor_id",
                      "operator": "In",
                      "values": [
                        "NVIDIA"
                      ]
                    }
                  ]
                },
                {
                  "matchExpressions": [
                    {
                      "key": "nvidia.com/gpu.present",
                      "operator": "In",
                      "values": [
                        "true"
                      ]
                    }
                  ]
                }
              ]
            }
          }
        },

This allows us to apply the label 'nvidia.com/gpu.present': 'true' to force-run the daemon on instances created by AWS ASG and allows us to scale from zero.

Could you please document the recommended way to run the daemonset on the required nodes when using AWS EKS and Cluster Autoscaler, which scales GPU instances from zero?

Best regards,
Markus

@elezar
Copy link
Member

elezar commented Dec 4, 2024

@markusl the

       "nodeSelector": {
          "nvidia.com/mps.capable": "true"
        },

should only be defined for the MPS control deamon daemonset and is only applicable if MPS is used to apply space partitioning to existing GPUs.

See:

# We only deploy this pod if the following sharing label is applied.
nvidia.com/mps.capable: "true"

@markusl
Copy link
Author

markusl commented Dec 4, 2024

Thanks for the quick answer! I am using AWS CDK for the deployment, which pulls the Helm chart automatically to the cluster

    cluster.addHelmChart('nvidia-device-plugin', {
      chart: 'nvidia-device-plugin',
      repository: 'https://nvidia.github.io/k8s-device-plugin',
      namespace: 'kube-system',
      version: '0.17.0', // <- causes nodeSelector with "nvidia.com/mps.capable": "true" to appear
    });

This has changed between 0.14.0 and 0.15.0 as far as I can tell. Is there something specific that I need to configure to avoid the nodeselector from appearing?

@chipzoller
Copy link
Contributor

chipzoller commented Dec 18, 2024

The device plugin DaemonSet does not have any affinity for the MPS label, only the MPS control DaemonSet has such an affinity.

Here's the current affinity setting as of 0.17.0 of the device plugin's DaemonSet:

$ k -n nvidia-device-plugin get ds nvdp-nvidia-device-plugin -o yaml | yq .spec.template.spec.affinity
nodeAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
      - matchExpressions:
          - key: feature.node.kubernetes.io/pci-10de.present
            operator: In
            values:
              - "true"
      - matchExpressions:
          - key: feature.node.kubernetes.io/cpu-model.vendor_id
            operator: In
            values:
              - NVIDIA
      - matchExpressions:
          - key: nvidia.com/gpu.present
            operator: In
            values:
              - "true"

Xref to the default values in which nodeSelector is empty here. Xref to device plugin's Helm template here showing where these are used. And xref to the MPS control daemon's template here where it explicitly shows a static label of nvidia.com/mps.capable: "true" being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants