Skip to content

Invalidate status files before rescheduling operands - #263

Open
rajathagasthya wants to merge 1 commit into
mainfrom
invalidate-status-files-before-reschedule
Open

rajathagasthya wants to merge 1 commit into
mainfrom
invalidate-status-files-before-reschedule

Conversation

@rajathagasthya

@rajathagasthya rajathagasthya commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

The operator-validator and driver containers remove the readiness files under /run/nvidia/validations in their preStop hooks. Those hooks do not run when the containers are removed outside the kubelet, for example when a CRI-O minor version upgrade wipes every pod sandbox on the node. The files survive on the host tmpfs. When k8s-driver-manager then re-enables the operand labels, the operand pods are recreated together with the driver pod, before the driver is installed. A stale toolkit-ready lets an operand init container pass while the kernel module is unloaded, so the nvidia runtime creates the main container without the driver libraries. The MIG manager then fails NVML initialization with ERROR_LIBRARY_NOT_FOUND and leaves the node at mig.config.state=failed until the pod is deleted.

Remove the files right after the GPU operator components have been evicted. The validators are confirmed deleted at that point, so nothing recreates the files until they are rescheduled against the replacement driver. The paths that do not evict, because no driver is loaded or because eviction itself failed, leave the files alone: a validator that is still running would not rewrite them.

The set removed is what the two preStop hooks remove: the *-ready files written by the validators, plus the driver's .driver-ctr-ready and .driver-daemons-status. Other hidden markers, such as cc-manager's .cc-manager-ctr-ready, are left in place because k8s-driver-manager does not restart their owners. workload-type is not a readiness marker and is also left in place.

In a normal driver rollout, both preStop hooks have already run and the removal is a no-op. On the fast path that skips the module unload, removing .driver-ctr-ready means the validator waits for the new driver container's startup probe to rewrite it, which is the ordering a normal rollout already has.

Removal failures are logged and ignored in order to not abort driver rollout.

Related: NVIDIA/gpu-operator#2874 (PR NVIDIA/gpu-operator#2881)

The operator-validator and driver containers remove the readiness files
under /run/nvidia/validations in their preStop hooks. Those hooks do not
run when the containers are removed outside the kubelet, for example
when a CRI-O minor version upgrade wipes every pod sandbox on the node.
The files survive on the host tmpfs. When k8s-driver-manager then
re-enables the operand labels, the operand pods are recreated together
with the driver pod, before the driver is installed. A stale
toolkit-ready lets an operand init container pass while the kernel
module is unloaded, so the nvidia runtime creates the main container
without the driver libraries. The MIG manager then fails NVML
initialization with ERROR_LIBRARY_NOT_FOUND and leaves the node at
mig.config.state=failed until the pod is deleted.

Remove the files right after the GPU operator components have been
evicted. The validators are confirmed deleted at that point, so nothing
recreates the files until they are rescheduled against the replacement
driver. The paths that do not evict, because no driver is loaded or
because eviction itself failed, leave the files alone: a validator that
is still running would not rewrite them.

The set removed is what the two preStop hooks remove: the *-ready files
written by the validators, plus the driver's .driver-ctr-ready and
.driver-daemons-status. Other hidden markers, such as cc-manager's
.cc-manager-ctr-ready, are left in place because k8s-driver-manager
does not restart their owners. The sandbox validator waits on that
marker before writing cc-manager-ready, and cc-manager can share a node
with the vfio-manager DaemonSet, which also runs this init container.
workload-type is not a readiness marker and is also left in place.

In a normal driver rollout both preStop hooks have already run and the
removal is a no-op. On the fast path that skips the module unload,
removing .driver-ctr-ready means the validator waits for the new driver
container's startup probe to rewrite it, which is the ordering a normal
rollout already has.

Removal failures are logged and ignored in order to not abort driver
rollout.

Signed-off-by: Rajath Agasthya <ragasthya@nvidia.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 34541594029

Coverage increased (+0.7%) to 11.806%

Details

  • Coverage increased (+0.7%) from the base build.
  • Patch coverage: 7 uncovered changes across 1 file (15 of 22 lines covered, 68.18%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
cmd/driver-manager/main.go 22 15 68.18%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1711
Covered Lines: 202
Line Coverage: 11.81%
Coverage Strength: 0.13 hits per line

💛 - Coveralls

@rajathagasthya
rajathagasthya marked this pull request as ready for review September 10, 2026 23:36
Comment thread cmd/driver-manager/main.go
Comment thread cmd/driver-manager/main.go
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

Successfully merging this pull request may close these issues.

3 participants