Detect wedged vGPU VFs from the guest and report to the health store - #435
Merged
yummybomb merged 2 commits intoSep 2, 2026
Merged
Conversation
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 20, 2026 19:12
d312338 to
7d54fb9
Compare
yummybomb
marked this pull request as ready for review
August 20, 2026 19:33
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 20, 2026 20:17
7d54fb9 to
9a90223
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 20, 2026 21:57
9a90223 to
0ff16d1
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 20, 2026 22:04
0ff16d1 to
3db5546
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 21, 2026 15:13
3db5546 to
b35501a
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 21, 2026 20:44
b3bf925 to
55a0d6f
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 21, 2026 20:47
55a0d6f to
ee1b160
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
2 times, most recently
from
August 24, 2026 19:03
a5dc229 to
fed19c4
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
2 times, most recently
from
August 24, 2026 19:34
7bd4f52 to
67b2b24
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 24, 2026 20:08
67b2b24 to
0662ad9
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
2 times, most recently
from
August 25, 2026 14:25
f3bf0cc to
ff54c20
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 25, 2026 14:28
ff54c20 to
37bc190
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 28, 2026 14:44
a805d59 to
aa66cd3
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 28, 2026 17:28
1084aef to
b23a654
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b23a654. Configure here.
yummybomb
marked this pull request as draft
August 31, 2026 14:51
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 31, 2026 16:00
b49bc73 to
a53ca5c
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
August 31, 2026 20:53
a53ca5c to
86fb40e
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
2 times, most recently
from
September 2, 2026 15:00
7376919 to
fd85830
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
September 2, 2026 15:05
fd85830 to
0b36925
Compare
yummybomb
marked this pull request as ready for review
September 2, 2026 15:08
sjmiller609
approved these changes
Sep 2, 2026
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
September 2, 2026 17:42
0b36925 to
8408076
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
September 2, 2026 18:59
8408076 to
0b5395d
Compare
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
September 2, 2026 19:44
0b5395d to
3a019bc
Compare
The guest agent watches /dev/kmsg for kernel-facility NVRM RmInitAdapter failures, probes driver init at boot with nvidia-smi -L when present, and exposes the current GPU init state over GetGPUInitStatus via vsock. A host sentinel controller polls every vendor VFIO instance with a live VMM (control socket present) at bounded concurrency and reports failures and successes into the VF health store, which quarantines a VF once failures accumulate from enough distinct assignments. Reports are keyed on GPUClaimedAt, the identity a claim receives when it is persisted, so rescans and controller restarts cannot double-count an assignment. Release paths preserve a claim when hypervisor liveness is uncertain, log the reason, and count it in hypeman_instances_vgpu_liveness_uncertain_total. The sentinel repairs a failed health store load or persist once per poll so reports do not retry it inline, and routine OK polls for healthy VFs skip vendorVFIOMu.
Key sentinel reports with devices.FormatVFAssignedAt instead of re-deriving the format, throttle the health store repair warning to once a minute while the store stays unavailable, and describe what RepairVFHealthStore's vendorVFIOMu actually guards relative to the read-path retry in checkedAddresses.
yummybomb
force-pushed
the
hypeship/vgpu-wedge-quarantine
branch
from
September 2, 2026 20:15
3a019bc to
b56faa6
Compare
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.

Summary
Top half of the wedged-VF work, stacked on #462 (the VF health store, placement exclusion, admission, and
/resourcesfields). This PR adds the detection path that feeds that store./dev/kmsgfor kernel-facilityNVRM: ... RmInitAdapter failed!records, probes driver init at boot withnvidia-smi -Lwhen the image has it, and exposes the current GPU initialization state overGetGPUInitStatusvia vsock.GPUClaimedAtfrom Quarantine unhealthy vGPU VFs via a persisted health store #462, the identity a claim receives when it is persisted.Rebuilt on the claim-first allocator
This branch was rebuilt from the new #462 head after #321 merged as the claim-first rewrite. The guest agent, guest RPC, sentinel controller, wiring, metrics, and docs are the previously reviewed code, squashed into one commit. What changed in the port:
GPUAssignedAtis gone frommain; the sentinel keys reports onGPUClaimedAt, which Quarantine unhealthy vGPU VFs via a persisted health store #462 sets in the same metadata save as the claim.GPURetainedForCleanupskip is gone with the retention-record design. The existing control-socket check already excludes instances without a VMM.create.gois dropped. Claim-first already persists the claim before the VF is touched.main's twohypervisorMayBeAlivecall sites; reconcile and the create/start cleanup guard share one wrapper that logs the resolution error and increments the liveness counter when it fails closed.Rebased onto the current #462 head (
cc6b625, itself rebased ontomainafter #428): the store now takes the threshold inInitVFHealth, retries a failed persist on read, and passes the quarantine set into the selector struct. The four review-round commits were squashed into the detection commit for the rebase; the review follow-ups (sentinel keyed ondevices.FormatVFAssignedAt, throttled repair warning, lock comment onRepairVFHealthStore) are a separate commit on top.Safety and failure handling
/dev/kmsgare rejected by the kernel-facility check. The guest is still the reporter, so a root workload that replaces the agent can report a failure; the per-assignment threshold and randomized VF selection bound how fast that drains capacity.nvidia-smiattempt is killed after 30 seconds. The guest agent waits for that process to be reaped before retrying, so an attempt stuck in uninterruptible I/O cannot accumulate concurrent probes; the independent kmsg watcher still reports the underlying init failure.Observability
hypeman_instances_vgpu_sentinel_init_failures_totalhypeman_instances_vgpu_sentinel_quarantines_totalhypeman_instances_vgpu_sentinel_checks_totalbyresult(ok,failed,unknown,rpc_error,unsupported_agent, orlist_error)hypeman_instances_vgpu_quarantined_vfshypeman_instances_vgpu_vf_health_store_unavailablehypeman_instances_vgpu_liveness_uncertain_totallib/devices/GPU.mdgains the detection and sentinel documentation.Known gap
The
nvidia-smi -Lprobe is the only source of an OK state. An image withoutnvidia-smi, or a driver that takes longer than the 10 minute probe window to initialize, stays UNKNOWN: its failures are still detected and tallied, but its assignments can never clear a tally or rescind a quarantine. Fleets running such images recover VFs only through the manual runbook inlib/devices/GPU.md.Out of scope
An operator force-cycle endpoint. Recovery remains the documented manual DCGM quiesce, SR-IOV cycle, state edit, restart, and verification flow.
Testing
Passed locally:
cmd/api/wire_gen.gowas regenerated withwireand matches.lib/guest/guest.pb.goandguest_grpc.pb.goare carried over from the previous head;guest.protohas not changed onmainsince, and the header records the sameprotocandprotoc-gen-goversions as the committed files.The full
lib/instancessuite was not run here; tests that boot real VM images need a host this environment does not provide.The underlying wedge signal and manual recovery sequence were previously validated on L40S hardware. A live end-to-end run of the guest watcher and host controller is still required before merge, including two failed assignments and the success path.
Note
High Risk
Changes vGPU capacity management (quarantine), runs continuous vsock polling against live VMs, and tightens when stale VF claims are released—mistakes could mis-quarantine hosts or leave wedged VFs in rotation.
Overview
Adds an end-to-end path to detect guest NVIDIA
RmInitAdapterfailures on vendor VFIO vGPUs and feed the existing VF health store (quarantine / placement exclusion).The guest agent watches kernel
/dev/kmsgfor NVRM init-failure lines, optionally probes withnvidia-smi -L, and exposesGetGPUInitStatusover vsock. SharedscanKmsgreplaces ad-hoc kmsg reading in the clock keeper.The vGPU sentinel controller runs in the API process (wire-injected), polls only running vendor-VFIO instances (control socket present), and records failures/successes keyed on
GPUClaimedAt. It repairs an unavailable health store once per poll and emits sentinel-specific metrics; instance metrics add quarantine and store-unavailable gauges plushypeman_instances_vgpu_liveness_uncertain_totalwhen reconcile/cleanup cannot prove the hypervisor is dead.VF health store changes:
RepairVFHealthStore, stricter persist behavior (no-op reports succeed while persist is failed; mutations fail closed), and a fast path so routine OK reports skipvendorVFIOMuwhen the VF has no tallies.Reconcile preserves claims on ambiguous hypervisor liveness via
vgpuHypervisorMayBeAlive(replacing the removed package-level helper).GPU.mddocuments detection, limits (OK only fromnvidia-smi), and observability.Reviewed by Cursor Bugbot for commit b56faa6. Bugbot is set up for automated code reviews on this repo. Configure here.