← Back to Pull requests

Skip GPU claim-holders that wait for a missing DRA kubelet-plugin #291

Closed
unknown closed this pull request without merging on Oct 28, 2026 22:24 UTC
View on GitHub
unknown unknown commented on Oct 15, 2026 20:51 UTC
Author

When an upgrade restarts the driver pod while no DRA kubelet-plugin pod is Ready, GPU Operator pods that hold GPU claims cannot finish terminating. The kubelet needs the kubelet-plugin to unprepare their claims, and a new kubelet-plugin pod starts only after the driver is ready. The driver-manager waited for these pods until it timed out, so the driver pod never became ready. Stop waiting for a GPU Operator pod when its containers have stopped, it holds a GPU claim, and no kubelet-plugin pod is Ready. The kubelet unprepares the claims after the kubelet-plugin starts again, unless gpu.deploy.dra-driver is false, which gets its own warning. When the GPU Operator upgrade policy is off, the driver-manager evicts GPU pods itself. That step also leaves these pods out, because it cannot delete DaemonSet pods and fails when it counts them. In the full path, also wait for ComputeDomain IMEX daemon pods before the kubelet-plugin is drained: they use all GPUs through a CDI spec without a GPU claim, and the driver unload fails while they run. A terminating daemon pod whose containers have stopped is not waited for. User pods that hold GPU claims still stop the driver unload.

When the deadlock occurs

All of these must be true:

1. The node uses the DRA stack (GPUCluster) with the driver container. Only the driver container creates /run/nvidia/validations/.driver-ctr-ready.
2. GPU Operator pods on the node hold GPU claims: nvidia-dra-validator, nvidia-dcgm-exporter-dra and nvidia-dcgm-dra.
3. The driver pod restarts. The new driver-manager pauses the nvidia.com/gpu.deploy.* labels and waits for the GPU Operator pods to terminate.
4. No kubelet-plugin pod is Ready, and none can become Ready. The preStop hook of the old driver container deleted .driver-ctr-ready, and the driver-validation init container of a new kubelet-plugin pod waits for that file.

The claim-holders wait for the kubelet-plugin, the kubelet-plugin waits for the driver, and the driver waits for the claim-holders. Without this change, the driver-manager logs Failed to wait for nvidia-operator-validator to shutdown after 5 minutes, and the init container starts again with the same result.

These events cause the deadlock:

  • A GPU Operator upgrade that changes the kubelet-plugin DaemonSet and the driver DaemonSet, for example v26.7.0 to v26.7.2. The kubelet-plugin DaemonSet uses maxUnavailable: 100%, so the DaemonSet controller replaces its pod at once. The deadlock occurs if the upgrade controller restarts the driver pod before the new kubelet-plugin pod passes its init container.

  • The kubelet-plugin pod is deleted, or is not Ready, when the driver pod restarts.

  • The nvidia.com/gpu.deploy.dra-driver label is set to false, and then the driver pod restarts. No kubelet-plugin pod starts until the label is true again.
  • When the deadlock does not occur

  • Only the driver DaemonSet changes, for example a new driver version or a change to driver.manager.env. The running kubelet-plugin pod already passed its init container, so it stays Ready. It unprepares the claims, and the driver-manager drains it after the claim-holders.

  • Only the kubelet-plugin DaemonSet changes. The driver pod does not restart, and .driver-ctr-ready still exists, so the new kubelet-plugin pod becomes Ready.

  • Both DaemonSets change, but the new kubelet-plugin pod becomes Ready before the driver pod restarts.

  • The node does not have the nvidia.com/gpu.deploy.dra-driver label (ClusterPolicy nodes). This change does nothing on these nodes.
  • What this change does

    waitForPodsToTerminate stops waiting for a pod when all of these are true:

    1. The node has the nvidia.com/gpu.deploy.dra-driver label.
    2. The pod is Terminating and is not in a terminal phase.
    3. No init, regular, or ephemeral container of the pod is Running.
    4. The pod holds a ResourceClaim allocated by gpu.nvidia.com.
    5. No kubelet-plugin pod on the node is Ready.

    The driver-manager logs a warning for each pod that it stops waiting for, and records the pod UID. If the gpu.deploy.dra-driver label is false, the warning says that the pod stays in Terminating until the label is true. Two later steps leave out the recorded pods:

  • The check for GPU claim-holders before the driver-manager drains the kubelet-plugin.

  • The GPU pod eviction that the driver-manager does when the upgrade policy is off. The drain helper does not delete DaemonSet pods, so if the driver-manager counts these pods, the eviction fails.
  • The skip applies to the same-driver path and to the full path (module unload and reload). After the new driver is ready, the driver-manager restores the labels. The new kubelet-plugin pod becomes Ready, the kubelet unprepares the old claims, and the old pods finish terminating. Then the DaemonSets create new pods.

    ComputeDomain IMEX daemons

    In the full path, the driver-manager also waits for ComputeDomain IMEX daemon pods. It waits after the GPU claim-holder check and before it drains the kubelet-plugin. An IMEX daemon pod uses all GPUs through a CDI spec and holds no GPU claim, so the GPU claim checks do not find it. The daemon pod stops only after the kubelet unprepares the channel claim of its ComputeDomain workload, which can be after the eviction. If the driver-manager unloads the driver while the daemon runs, the unload fails, and the driver-manager starts again.

  • The driver-manager finds a daemon pod by its ResourceClaim: the claim is allocated by compute-domain.nvidia.com and has a ComputeDomainDaemonConfig in its allocation config.

  • It does not wait for a terminating daemon pod whose containers have stopped. That pod no longer uses the driver. Only a running kubelet-plugin can unprepare its claim, so a wait for the pod to be gone would never end when no kubelet-plugin is Ready. The kubelet unprepares the claim after the kubelet-plugin starts again. This unprepare does no driver work.

  • It waits up to 5 minutes, the same as the other waits. After a timeout, it restores the labels and fails, the same as the GPU claim-holder check.

  • The eviction does not select daemon pods. They are DaemonSet pods, and the drain helper does not delete DaemonSet pods.
  • This change does not affect:

  • User pods that hold GPU claims. They still stop the driver unload.

  • ComputeDomain channel claims. The driver-manager does not count them, as before. A ComputeDomain workload also holds a GPU claim, so the GPU claim checks find it.
  • Known gap: user pods that hold GPU claims

    If no kubelet-plugin pod is Ready, for any reason, when the driver pod restarts, the eviction of user pods with GPU claims cannot finish. The kubelet needs the kubelet-plugin to unprepare their claims before it can remove the pods.

    This change does not help when a user pod holds a GPU claim. The same dependency cycle then stops the driver-manager, and the node needs manual action. All of these must be true:

    1. The driver pod restarts, and the GPU Operator upgrade controller did not restart it. For example, an administrator deletes the driver pod while the upgrade policy is off. A restart of only the driver container does not run the driver-manager again.
    2. The driver-manager takes the full path, because the driver changes or FORCE_REINSTALL is true. The same-driver path does not evict user pods.
    3. A user pod with a GPU claim runs on the node.
    4. No kubelet-plugin pod is Ready at that time.

    The user pod stops, but it stays in Terminating, because the kubelet needs the kubelet-plugin to unprepare its claims. What the driver-manager does next depends on the upgrade policy:

  • Upgrade policy off: the driver-manager evicts the user pod and waits for it to be deleted. DRAIN_TIMEOUT_SECONDS is 0 by default, so the wait has no time limit.

  • Upgrade policy on: the driver-manager does not evict, so the GPU claim-holder check fails, and the init container starts again. If an administrator stops the workload, the pod stays in Terminating, and the check still fails.

  • For a ComputeDomain workload, the IMEX daemon pod also continues to run. Only the unprepare of the workload's channel claim removes the ComputeDomain node label, and the daemon pod stops only after that.
  • The upgrade controller does not cause this gap. It restarts the driver pod only after the GPU pods are gone, and that needs a Ready kubelet-plugin. If the pods do not go away, the node goes to upgrade-failed, and the driver continues to run.

    The gap existed before this change. Without this change, the driver-manager stops earlier, at the wait for the GPU Operator pods.

    What fixes it

  • Rollout. A GPU Operator upgrade changes the kubelet-plugin DaemonSet, and an administrator deletes the driver pod before the new kubelet-plugin pod is Ready (about 45 seconds in our tests). A surge rollout of the kubelet-plugin fixes this: kubernetes-sigs/dra-driver-nvidia-gpu#1571, plus a GPU Operator change that sets maxSurge on the kubelet-plugin DaemonSet. The old kubelet-plugin pod stays Ready until the new pod is available, so the kubelet can unprepare the claims while the driver restarts.

  • Other causes. The kubelet-plugin pod was deleted, it crashed, or nvidia.com/gpu.deploy.dra-driver is false. No fix is planned. A driver restart while a workload uses the GPUs and no kubelet-plugin can unprepare its claims is a destructive action, and some manual recovery cannot be avoided:

  • 1. Force-delete the stuck user pod.
    2. For a ComputeDomain workload, remove the resource.nvidia.com/computeDomain label from the node. The IMEX daemon pod then stops.

    After the driver is ready, the kubelet-plugin starts, and the kubelet unprepares the remaining claims.

    What does not fix it

  • This change. It stops waiting only for GPU Operator pods. The same skip for user pods does not help a ComputeDomain workload: its channel claim stays prepared, so the IMEX daemon pod continues to run, and the driver-manager cannot unload the driver. It was also not checked whether an unprepare after a driver reload works for every claim type, for example MIG or MPS.

  • A drain timeout (DRAIN_TIMEOUT_SECONDS). The eviction fails after the timeout, and the init container starts again with the same result.

  • The upgrade policy. It protects only the driver restarts that the upgrade controller does itself.

  • A surge rollout, for causes other than a rollout.
  • Testing

    | # | Trigger | autoUpgrade | Driver-manager path | Result |
    |---|---|---|---|---|
    | 1 | helm upgrade from v26.7.0 to v26.7.2 | true | same driver | Deadlock |
    | 2 | Delete the driver pod, then the kubelet-plugin pod | true | same driver | Deadlock |
    | 3 | Case 2 with FORCE_REINSTALL=true | true | full reinstall | Deadlock |
    | 4 | helm upgrade that only sets FORCE_REINSTALL=true | true | full reinstall | No deadlock. Only the driver DaemonSet changed. The kubelet-plugin pod stayed Ready and unprepared the claims, so the driver-manager did not skip a pod. |
    | 5 | helm upgrade from v26.7.0 to v26.7.2 with FORCE_REINSTALL=true, then delete the driver pod a few minutes later | false | full reinstall | No deadlock. The new kubelet-plugin pod was Ready, so the driver-manager did not skip a pod. The eviction logged No GPU pods to delete. Exiting. |
    | 6 | Set gpu.deploy.dra-driver=false, then delete the driver pod, with FORCE_REINSTALL=true | false | full reinstall | No deadlock. The driver-manager skipped the same two pods, the eviction logged No GPU pods to delete. Exiting., the modules unloaded, and the init container finished on its first run. After the label was set to true, the kubelet-plugin pod started, the old pods and their claims were removed, and new pods started. |

    The ComputeDomain IMEX daemon wait has unit tests only. It was not tested on hardware, because that needs a node that can run ComputeDomains.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: cdesiniotis Review duration: 18813m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #291"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.7% · Safe to merge
    29.7%