← Back to Pull requests

Gate operands on the nvidia module's sysfs initstate #2959

Closed
unknown closed this pull request without merging on Oct 05, 2026 20:00 UTC
View on GitHub
unknown unknown commented on Sep 23, 2026 10:12 UTC
Author

Description

Operand toolkit-validation init containers (GFD, device plugin, DCGM, DCGM Exporter, MIG Manager, MPS Control Daemon) now detect a loaded NVIDIA driver through the kernel's per-module sysfs state instead of /proc/modules:

-until [ -f /run/nvidia/validations/toolkit-ready ] && { grep -q '^nvidia ' /proc/modules || [ -e /dev/dxg ]; }; do ...
+until [ -f /run/nvidia/validations/toolkit-ready ] && { grep -qsx live /sys/module/nvidia/initstate || [ -e /dev/dxg ]; }; do ...

The module check was added so that an operand is not created while the driver is unloaded (#2874, fixed by #2881). /proc/modules keeps a module listed while it is still initializing (Loading) and while it is being removed (Unloading), and grep '^nvidia ' matches both, so the gate can open in the middle of a driver load or unload, which is the window it is meant to close. /sys/module/nvidia/initstate reads live only once module init has completed, and coming or going otherwise.

initstate is part of the documented sysfs module ABI (Documentation/ABI/testing/sysfs-module, since 2.6.19), and it matches how the validator already decides the module is loaded: isNvidiaModuleLoaded() in cmd/nvidia-validator/main.go reads /sys/module/nvidia/refcnt. -s keeps the loop's output to its own "waiting" line while the module is absent.

Not changed: the WSL2 /dev/dxg branch, and the container-toolkit runtime wrapper, which still checks /proc/modules on its own (separate repository).

Checklist

  • No secrets, sensitive information, or unrelated changes

  • Lint checks passing (make lint): fails with 3 SA4023 findings in cmd/nvidia-validator/main.go (lines 741, 742, 1728), a file this PR does not touch; the same three were reported on pristine main in #2881

  • Generated assets in-sync (make validate-generated-assets)

  • Go mod artifacts in-sync (make validate-modules)

  • Test cases are added for new code paths: TestOperandToolkitReadinessWaitsForLiveDriver now asserts the sysfs gate on all six manifests
  • Testing

  • go test ./controllers -run TestOperandToolkitReadinessWaitsForLiveDriver: failed on all six subtests with only the test updated, passes with the manifests changed.

  • make unit-test: 21 packages ok, no failures. make fmt: clean.
  • Diff: 319 lines (+239 / -80) across 3 files Reviewer: tariq1890 Review duration: 17867m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 319 lines diff across 3 files
    0.40
    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.345
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2959"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    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: 40.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    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: 16.0% · Safe to merge
    16.0%