feat(validator): commit pending MIG-mode change via targeted GPU reset#2603
Open
lexfrei wants to merge 1 commit into
Open
feat(validator): commit pending MIG-mode change via targeted GPU reset#2603lexfrei wants to merge 1 commit into
lexfrei wants to merge 1 commit into
Conversation
On the vGPU (sandbox) workload path, a MIG-mode change is not applied until the GPU is reset, and neither the MIG mode nor the SR-IOV VFs survive a node reboot. The MIG manager can set MIG mode to Enabled, but committing that change requires a GPU reset it does not perform (its only reset mechanism reboots the whole node), so after a reboot MIG-backed vGPU devices cannot be created until the state is re-established out-of-band by host systemd units. Add an opt-in step to vGPU Manager validation that commits a pending-but- uncommitted MIG-mode enable via a targeted 'nvidia-smi --gpu-reset', right before VFs are waited for. The reset is destructive, so it is tightly gated: it runs only when explicitly enabled (commit-mig-mode-with-gpu-reset, off by default), only on the vGPU path, and only on a GPU whose MIG-mode enable is requested but not yet applied, that has no SR-IOV VFs enabled (no vGPU VM attached), and that has no running compute processes. In the steady state it is a no-op. It is best-effort: reset failures are logged and validation continues, preserving current behavior for setups that commit MIG mode and create VFs out-of-band. This complements the SR-IOV VF re-enable seam so MIG-backed vGPU can recover after a reboot without a hand-rolled host unit. VF re-enablement must run after this reset (a GPU reset requires SR-IOV to be disabled first). Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On the vGPU (sandbox) workload path, a MIG-mode change does not take effect until the GPU is reset, and neither the MIG mode nor the SR-IOV VFs survive a node reboot. The MIG manager can set MIG mode to
Enabled, but committing that change requires a GPU reset it does not perform — its only reset mechanism reboots the whole node (WITH_REBOOT). So after a reboot of a MIG-backed vGPU node, MIG mode is left requested-but-not-committed and MIG-backed vGPU devices cannot be created until the state is re-established out-of-band (host systemd units that enable MIG, runnvidia-smi --gpu-reset, thensriov-manage -e).This adds the MIG-mode-commit half of the reboot-recovery seam discussed in #2600. During vGPU Manager validation, right before the wait for VFs,
VGPUManager.validate()commits a pending-but-uncommitted MIG-mode enable via a targetednvidia-smi --gpu-reset. It composes with the SR-IOV VF re-enable seam in #2601: the reset must run before VF re-enablement, because a GPU reset requires SR-IOV to be disabled first. Together they let MIG-backed vGPU recover after a reboot without a hand-rolled host unit.Destructive GPU reset — why it is safe here
nvidia-smi --gpu-resetis destructive: it resets the GPU and tears down anything running on it. The step is therefore off by default and tightly gated. It performs a reset on a GPU only when all of the following hold:--commit-mig-mode-with-gpu-reset(envCOMMIT_MIG_MODE_WITH_GPU_RESET), defaultfalse. When unset, behavior is identical to today — no reset,validate()unchanged.commitMIGModeis reached only fromVGPUManager.validate(), which early-returns for non-vm-vgpuworkloads.mig.mode.pending == Enabledandmig.mode.current != Enabled— i.e. a change something else already requested that a reset would apply. The enable is never decided here; only committed.nvidia-smi --gpu-resetitself independently refuses to reset a GPU that is in use, which is the authoritative safety net.In the steady state (MIG already committed, or VFs/VMs present) it is a no-op. It is best-effort: reset failures are logged and validation continues, preserving current behavior for setups that commit MIG mode and create VFs out-of-band.
On NVSwitch / Fabric Manager systems, a single-GPU reset can interact with fabric partition state; this change only commits MIG mode and does not manage fabric partitions, which is one of the open design questions for the RFC.
Checklist
make lint) — the changed package is clean:GOOS=linux golangci-lint run ./cmd/nvidia-validator/reports 0 issues. Repo-widemake lintwas not run locally.make validate-generated-assets) — this change adds no API/CRD changes, so no generated assets change; the full target was not run.make validate-modules)Testing
gofmt,go build,go vet, andgolangci-lint runon the changed package, cross-compiledGOOS=linux(the validator is a Linux-only binary): clean, 0 issues. No asset orgo.mod/go.sumchanges.go test ./cmd/nvidia-validator/):TestNormalizePCIAddress(nvidia-smi 8-digit vs go-nvlib 4-digit PCI domains normalize to the same key),TestParseMIGModes(CSV parsing,[N/A], malformed rows, the pending-vs-current guard),TestMIGModeNeedsCommit(the enable-only commit predicate across every current/pending combination, including case-insensitivity), andTestShouldResetForMIGCommit(the full reset-decision guard matrix over uncommitted-enable × VFs-present × workload-running).nvidia-smi --gpu-resetpath relies on CI and cluster testing. This is why the PR is opened as a draft/RFC.Refs #2600, #2601.