gpu-operator icon indicating copy to clipboard operation
gpu-operator copied to clipboard

[Bug]: Driver auto-upgrade fails on nodes running GPU pods owned by a DaemonSet

Open CloneOfAlex opened this issue 1 month ago • 2 comments

Describe the bug gpuPodSpecFilter (cmd/gpu-operator/main.go) counts every Running/Pending pod that requests nvidia.com/gpu* or holds a GPU ResourceClaim, including pods owned by a DaemonSet.

The pod manager in k8s-operator-libs builds its drain helper with IgnoreAllDaemonSets: true (vendor/github.com/NVIDIA/k8s-operator-libs/pkg/upgrade/pod_manager.go:152), so those pods are excluded from GetPodsForDeletion. The check numPodsCanDelete != numPodsToDelete (line 194) then fails ("Cannot delete all required pods") and the node moves to drain or upgrade-failed. Drain ignores DaemonSet pods too, so it cannot clear them either.

Result: any GPU-consuming DaemonSet (inference agents, custom exporters, etc.) blocks driver auto-upgrade on every node where it runs. Related to, but different from, #2570 (consumers without a GPU resource request).

To Reproduce Found by code review; not yet reproduced on a cluster. Expected repro:

  1. Deploy a DaemonSet whose pods request nvidia.com/gpu: 1.
  2. Enable driver.upgradePolicy.autoUpgrade with podDeletion and change the driver version.
  3. The node logs "Cannot delete all required pods" and ends in upgrade-failed.

Expected behavior Either DaemonSet-owned GPU pods are deleted explicitly (the DaemonSet recreates them after the driver restarts), or they are excluded from the count with a clear event.

Environment (please provide the following information):

  • GPU Operator Version: main @ f806d6b (code inspection)

CloneOfAlex avatar Oct 13 '26 17:10 CloneOfAlex

@CloneOfAlex we already introduced https://github.com/NVIDIA/gpu-operator/pull/2607 as a way for third party management of Daemonset GPU management pods that request GPUs via the Nvidia runtime class or the NRI CDI annotation (if using NRI plugin), the driver manager should be able to handle these upgrades. We have seen that this is the most used case where Daemonsets request for GPUs, so I am going to close this issue. Please feel free to reopen if you disagree or there are other cases that you want addressed

kvalliyurnatt avatar Oct 21 '26 18:10 kvalliyurnatt

Thanks @kvalliyurnatt. #2607 covers the case I'd expect to be most common (management/client DaemonSets using the NVIDIA runtime class or CDI injection, labeled with nvidia.com/gpu.deploy.client), and I'm fine leaving this closed.

One narrower case I'd like to confirm before letting it go: a DaemonSet whose pods request nvidia.com/gpu through the device plugin. Those pods still match gpuPodSpecFilter (they have the extended resource), but the pod manager's drain helper uses IgnoreAllDaemonSets: true, so GetPodsForDeletion leaves them out and numPodsCanDelete != numPodsToDelete sends the node to drain/upgrade-failed (k8s-operator-libs/pkg/upgrade/pod_manager.go:152,194). Adding the gpu.deploy.client nodeSelector doesn't change that count. Is the expectation that such DaemonSets shouldn't request nvidia.com/gpu at all, or would you take a small change that skips DaemonSet-owned pods in gpuPodSpecFilter? If it's the former, I'm happy to send a docs note instead.

CloneOfAlex avatar Nov 05 '26 23:11 CloneOfAlex