Skip to content

Accept renamed nvidia-smi banner fields - #1748

Merged
yuanchen8911 merged 1 commit into
NVIDIA:mainfrom
yuanchen8911:fix/issue-1667-nvidia-smi-banners
Jul 15, 2026
Merged

yuanchen8911 merged 1 commit into
NVIDIA:mainfrom
yuanchen8911:fix/issue-1667-nvidia-smi-banners

Conversation

@yuanchen8911

@yuanchen8911 yuanchen8911 commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Accept both legacy and renamed NVIDIA driver banner fields when verifying nvidia-smi logs. Add table-driven regression coverage for both formats and for missing driver/CUDA alternatives.

Motivation / Context

Newer drivers report KMD Version: and CUDA UMD Version: instead of the legacy Driver Version: and CUDA Version: fields. The validator currently treats healthy GPU nodes using the renamed fields as failures.

Fixes: #1667
Related: N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundlers (pkg/bundler, pkg/component/*)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: ____________

Implementation Notes

verifyNvidiaSMILogs now evaluates required markers as any-of groups. The NVIDIA-SMI and success markers remain mandatory, while either the legacy or renamed form satisfies each driver and CUDA version group. The renamed-field regression fixture uses a representative NVIDIA-SMI 610.43.02 table banner (KMD Version: / CUDA UMD Version:) modeled on the renamed-field driver output described in #1667. Matching is case-insensitive: the renamed fields' casing is otherwise documented only via nvidia-smi --version deprecation text (lowercase "KMD version"), so casing variants across driver branches cannot reintroduce the false negative; diagnostics keep canonical casing. Missing-marker diagnostics separate multiple unsatisfied groups with semicolons.

Testing

GOFLAGS="-mod=vendor" go test -race -v ./validators/deployment/...
GOFLAGS="-mod=vendor" go test -coverprofile=/tmp/aicr/pr-1748-current.out ./validators/deployment/...
golangci-lint run --allow-parallel-runners -c .golangci.yaml ./validators/deployment/...
make test-coverage
unset GITLAB_TOKEN && make qualify
  • Deployment validator tests passed under the race detector.
  • validators/deployment coverage: 48.3% → 50.8% (+2.5 percentage points); verifyNvidiaSMILogs: 100%.
  • Affected-package lint: 0 issues.
  • Project coverage gate: 78.8% (75% required).
  • Full qualification: passed at 78.8% coverage, including 23/23 e2e tests and vulnerability/license checks.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert
  • Medium — Touches multiple components or has broader impact
  • High — Breaking change, affects critical paths, or complex rollout

Rollout notes: Backward compatible; existing Driver Version: and CUDA Version: banners remain accepted. No migration or feature flag is required.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S) — GPG signing info

@yuanchen8911 yuanchen8911 added the theme/validation Constraint evaluation, health checks, and conformance evidence label Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

verifyNvidiaSMILogs now accepts either legacy or renamed driver and CUDA banner markers while retaining the required NVIDIA-SMI and success markers. Missing marker alternatives are reported as grouped error details. A parallelized table-driven test covers legacy, renamed, mixed, and casing variants, plus exact errors for missing groups.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies #1667 by accepting legacy or renamed driver and CUDA markers while keeping NVIDIA-SMI and success checks mandatory.
Out of Scope Changes check ✅ Passed The change set stays focused on the NVIDIA-SMI validator and its tests with no evident unrelated additions.
Title check ✅ Passed The title accurately summarizes the main change: accepting renamed NVIDIA-SMI banner fields.
Description check ✅ Passed The description clearly matches the changeset and explains the validator update plus regression tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@yuanchen8911

Copy link
Copy Markdown
Contributor Author

Follow-up: the shared CI gap that excludes validators/** unit tests from make test and coverage is tracked in #1752. This covers the regression tests added here and in #1745.

@yuanchen8911
yuanchen8911 force-pushed the fix/issue-1667-nvidia-smi-banners branch 3 times, most recently from b6ba333 to 186da9e Compare July 14, 2026 20:01

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@validators/deployment/nvidia_smi_test.go`:
- Around line 32-71: Add table-driven test cases in the existing NVIDIA-SMI log
verification tests for logs missing the NVIDIA-SMI marker and logs missing
gpuCheckSuccessMsg. Assert the expected missing-marker errors while retaining
the existing driver/CUDA validation cases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: d73d4ad7-16bb-4568-be75-6f519bcfe38b

📥 Commits

Reviewing files that changed from the base of the PR and between 8223481 and b6ba333.

📒 Files selected for processing (2)
  • validators/deployment/nvidia_smi.go
  • validators/deployment/nvidia_smi_test.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
validators/deployment/nvidia_smi_test.go (1)

32-79: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Coverage gap persists: no case for solo-missing NVIDIA-SMI or success marker.

All test cases exercise the driver/CUDA alternation groups, but verifyNvidiaSMILogs also treats {"NVIDIA-SMI"} and {gpuCheckSuccessMsg} as mandatory single-marker groups (nvidia_smi.go lines 173, 176). No case asserts the exact error when either of those is absent — this was already raised in a prior review pass and remains unaddressed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@validators/deployment/nvidia_smi_test.go` around lines 32 - 79, The test
table in the NVIDIA-SMI log verification tests lacks coverage for missing single
mandatory markers. Add cases where logs omit “NVIDIA-SMI” and where logs omit
gpuCheckSuccessMsg, asserting the exact verifyNvidiaSMILogs error for each
missing marker while retaining the existing driver/CUDA group coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@validators/deployment/nvidia_smi_test.go`:
- Around line 32-79: The test table in the NVIDIA-SMI log verification tests
lacks coverage for missing single mandatory markers. Add cases where logs omit
“NVIDIA-SMI” and where logs omit gpuCheckSuccessMsg, asserting the exact
verifyNvidiaSMILogs error for each missing marker while retaining the existing
driver/CUDA group coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 49d5e823-cb69-403c-ad29-11c649b62767

📥 Commits

Reviewing files that changed from the base of the PR and between b6ba333 and 186da9e.

📒 Files selected for processing (2)
  • validators/deployment/nvidia_smi.go
  • validators/deployment/nvidia_smi_test.go

@yuanchen8911
yuanchen8911 force-pushed the fix/issue-1667-nvidia-smi-banners branch 2 times, most recently from 2fb7b42 to 629e116 Compare July 14, 2026 20:36
@yuanchen8911 yuanchen8911 changed the title WIP: Accept renamed nvidia-smi banner fields Accept renamed nvidia-smi banner fields Jul 14, 2026
@yuanchen8911
yuanchen8911 marked this pull request as ready for review July 14, 2026 22:25
@yuanchen8911
yuanchen8911 requested a review from a team as a code owner July 14, 2026 22:25

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct fix with the right shape: any-of marker groups keep the NVIDIA-SMI and success markers mandatory while accepting either the legacy or renamed driver/CUDA fields, so the gate still fails closed when neither alternative is present. The case-insensitivity rationale is well-argued (the renamed fields' table-banner casing isn't pinned anywhere authoritative, and the verified stream is only nvidia-smi output plus the controlled success echo, so false-positive risk is negligible). Verified the banner strings aren't matched anywhere else in the repo — the DCGM Driver Version hits in gpu-operator values are metric labels, unrelated. Exact-string error assertions pin the diagnostic format, and the new test file takes verifyNvidiaSMILogs to 100%. CI green, no blockers.

@njhensley njhensley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multi-persona review + adversarial verification — Approve ✅

Reviewed by an independent 3-lens panel (correctness · false-positive/robustness · test-coverage), then the false-positive-safety claim was re-derived from the code by an adversarial meta-reviewer — the important axis here, since accepting an unhealthy GPU is the dangerous direction.

It's safe: verifyNvidiaSMILogs is a secondary output-shape check reachable only after the verify pod reached Succeeded (i.e. nvidia-smi already exited 0 and the &&-gated GPU_CHECK_SUCCESS echo ran). Case-insensitivity only loosens which banner spellings are accepted; it never rejects less on the exit-0 gate and introduces no new unhealthy-passes path. The any-of group logic correctly requires ≥1 member of each of the 4 groups. The CUDA Driver Version: ⊇ Driver Version: substring overlap is pre-existing (old code used the same Contains), not introduced by the restructuring. Error strings match pkg/errors output byte-for-byte; all subtests pass under -race.

Non-blocking follow-up (🟡):

  • 🟡 No explicit negative test for a coincidental version: in unrelated log noise. The group-isolation tests functionally cover it, but an explicit rejection case (e.g. "libfoo version: 1.2\n" + gpuCheckSuccessMsg → expect reject on both banner groups) would document the false-positive-guard intent. Optional.

No blockers or majors.

@yuanchen8911
yuanchen8911 force-pushed the fix/issue-1667-nvidia-smi-banners branch from 629e116 to 5c511dc Compare July 14, 2026 23:46
@yuanchen8911
yuanchen8911 enabled auto-merge (squash) July 14, 2026 23:46
@yuanchen8911
yuanchen8911 force-pushed the fix/issue-1667-nvidia-smi-banners branch from 5c511dc to a693bf6 Compare July 14, 2026 23:58
@yuanchen8911
yuanchen8911 merged commit 3cfc476 into NVIDIA:main Jul 15, 2026
35 checks passed
mohityadav8 added a commit to mohityadav8/aicr that referenced this pull request Jul 25, 2026
…ge gate

Makefile excluded /validators from 'go list ./...' in make test, so
regression suites added in NVIDIA#1745/NVIDIA#1748 (and the older nvidia-smi,
inference-perf, nccl, conformance tests) never ran in CI.

- Drop -e /validators from the make test package filter.
- Exclude validators/ from the test-coverage threshold calc (its
  package coverage is 41-92%, pulling aggregate from 80.0% to 75.7%
  and breaking the 80% gate) while still running its tests.

Fixes NVIDIA#1752

Signed-off-by: Mohit Yadav <[email protected]>
@yuanchen8911
yuanchen8911 deleted the fix/issue-1667-nvidia-smi-banners branch August 19, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M theme/validation Constraint evaluation, health checks, and conformance evidence

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check-nvidia-smi fails on drivers renaming nvidia-smi banner fields

3 participants