Skip to content

feat(hw-health): out-of-band GPU count & SEL fault alerting#3368

Open
hatamzad-nv wants to merge 1 commit into
NVIDIA:mainfrom
hatamzad-nv:feat/301-oob-gpu-detection
Open

feat(hw-health): out-of-band GPU count & SEL fault alerting#3368
hatamzad-nv wants to merge 1 commit into
NVIDIA:mainfrom
hatamzad-nv:feat/301-oob-gpu-detection

Conversation

@hatamzad-nv

Copy link
Copy Markdown

Summary

Implements out-of-band detection of missing GPUs, addressing #301.

Today SKU validation only runs in-band and at limited points in the host
lifecycle, so a GPU that drops off the BMC can go unnoticed. This adds two
complementary out-of-band detections to the hw-health service.

What's included

1. GpuInventoryCollector — GPU count vs. assigned SKU

Periodically counts a host's GPUs out-of-band via Redfish and raises a health
alert when the count is below the machine's assigned SKU total.

Counting is vendor-agnostic — GPUs attach in two forms, so we count both and
take the max:

  • SXM / HGX baseboards (H100 SXM, GB200, GB300, GH200) → one HGX_GPU_*
    chassis per GPU
  • PCIe cards (L40 / L40S, H100 PCIe, A100) → Redfish Processors with
    ProcessorType=GPU

max(chassis, processors) (not sum) because some platforms (e.g. GB200) expose
the same GPUs both ways. There is no BMC-vendor table to maintain — it works
across Dell / Lenovo / Supermicro / NVIDIA regardless of GPU form.

2. GpuFaultEventProcessor — SEL GPU-fault alerting

Watches the Redfish SEL / log stream and raises alerts on GPU-related faults
(NVLink, ECC row-remap, XID, …). Complements the count check by catching GPUs
that are present but faulting.

Both reuse the existing collector → sink → API pipeline, and use distinct
report sources
so inventory and fault alerts don't overwrite each other.

Safety / rollout

  • Disabled by default — opt-in via [collectors.gpu_inventory] (documented
    in config.example.toml).
  • Config validation — enabling it without the Carbide API source or the
    health-report sink is rejected at startup.
  • Machine endpoints only — skips switch / power-shelf endpoints.
  • RBAC — grants the Health role permission for FindSkusByIds (needed to
    resolve the expected count from the SKU).

Testing

  • cargo test -p carbide-health384 pass
    • Unit: SEL keyword/severity matching, shortage → alert decision, config validation
    • Integration (bmc-mock, real Redfish trees): DGX GB300 = 4, GB200 (chassis + processors), Dell R750 = 0
  • Hardware-validated: a Lenovo ThinkSystem SR670 V2 (8× NVIDIA L40) reports
    8 GPUs via ProcessorType=GPU — confirms the processor path on real PCIe hardware.
  • cargo fmt --all -- --check clean.
  • The api-core RBAC change can't compile on macOS (Linux-only TPM dep) → relies on CI.

Known follow-ups (non-blocking)

  • Deployment enablement: ships disabled; Helm/Kustomize enablement left as a
    deliberate decision (see below).
  • PCIe-only platforms: if a BMC ever exposed GPUs only under PCIeDevices
    (neither chassis nor processors) they'd count as 0. Not seen on any current
    fleet platform (Lenovo L40 uses ProcessorType=GPU, confirmed above); a PCIe
    source can be added if such firmware appears.
  • SEL tuning: keyword matching and fault auto-clear to be refined against real
    SEL samples.

Open decision for reviewers

Ships disabled by default for a safe rollout. Should it be enabled in
Helm/Kustomize now, or in a follow-up PR after a canary?

Checklist

  • Tests added and passing (384)
  • cargo fmt --check clean
  • Rebased on current main
  • DCO sign-off (Signed-off-by)
  • clippy-flow — runs on CI (Linux only)

cc @williampnvidia for review

@hatamzad-nv hatamzad-nv requested a review from a team as a code owner July 10, 2026 16:34
@copy-pr-bot

copy-pr-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 90ae965e-956b-419d-b1de-b3f9c14c8388

📥 Commits

Reviewing files that changed from the base of the PR and between d78ae6e and 89238f7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • crates/api-core/src/auth/internal_rbac_rules.rs
  • crates/health/Cargo.toml
  • crates/health/example/config.example.toml
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/gpu_inventory.rs
  • crates/health/src/collectors/mod.rs
  • crates/health/src/config.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/lib.rs
  • crates/health/src/processor/gpu_events.rs
  • crates/health/src/processor/mod.rs
  • crates/health/src/sink/events.rs
✅ Files skipped from review due to trivial changes (2)
  • crates/health/example/config.example.toml
  • crates/health/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (10)
  • crates/health/src/processor/mod.rs
  • crates/health/src/sink/events.rs
  • crates/api-core/src/auth/internal_rbac_rules.rs
  • crates/health/src/collectors/mod.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/processor/gpu_events.rs
  • crates/health/src/config.rs
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/gpu_inventory.rs

Summary by CodeRabbit

  • New Features
    • Added optional GPU inventory monitoring to compare expected GPU counts (from assigned SKU) with BMC/Redfish inventory and emit success/shortage reports.
    • Added GPU fault detection that generates GPU-fault health alerts from actionable hardware log events.
    • Extended health report sources/probes/classifications to include GPU inventory and GPU faults.
  • Bug Fixes
    • GPU shortage alerts now clear automatically when inventory meets expectations (including when no GPUs are expected), and a dedicated alert is emitted when the expected SKU is missing.
  • Documentation
    • Updated the example config with collectors.gpu_inventory prerequisites and interval guidance.
  • Tests
    • Added integration tests covering GPU counting logic and alert behavior.

Walkthrough

Adds GPU inventory validation from live SKU and BMC data, GPU fault log processing, health-report types, configuration validation, collector discovery wiring, API access, tests, and RBAC permission support.

Changes

GPU health monitoring

Layer / File(s) Summary
Health configuration and reporting contracts
crates/health/src/config.rs, crates/health/src/sink/events.rs, crates/health/src/api_client.rs, crates/api-core/src/auth/internal_rbac_rules.rs, crates/health/example/config.example.toml, crates/health/Cargo.toml
Adds GPU inventory configuration and dependency validation, GPU report enums and mappings, Forge API methods for SKU and machine SKU retrieval, Health access to FindSkusByIds, and supporting configuration and test dependencies.
GPU inventory collector implementation
crates/health/src/collectors/gpu_inventory.rs, crates/health/src/collectors/mod.rs
Counts GPUs through Redfish chassis and processor views, compares actual counts with SKU expectations, emits health reports, and tests shortage, success, dual-view, and GPU-less scenarios.
Collector discovery and startup wiring
crates/health/src/discovery/context.rs, crates/health/src/discovery/spawn.rs
Registers GPU inventory as a collector kind, stores its state and configuration, creates the optional API client, and starts the collector for eligible machine endpoints.
GPU fault event processing
crates/health/src/processor/gpu_events.rs, crates/health/src/processor/mod.rs, crates/health/src/lib.rs
Detects actionable GPU-related log events, emits GPU fault alerts with machine targets, registers the processor in the health-report sink, and tests severity and keyword filtering.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DiscoveryLoop
  participant GpuInventoryCollector
  participant ApiClientWrapper
  participant BmcRedfish
  participant HealthReportSink
  DiscoveryLoop->>GpuInventoryCollector: start for enabled machine endpoint
  GpuInventoryCollector->>ApiClientWrapper: resolve assigned SKU
  GpuInventoryCollector->>BmcRedfish: count chassis and processor GPUs
  GpuInventoryCollector->>HealthReportSink: emit shortage or success report
Loading
sequenceDiagram
  participant CollectorEvent
  participant GpuFaultEventProcessor
  participant HealthReportSink
  CollectorEvent->>GpuFaultEventProcessor: deliver log event
  GpuFaultEventProcessor->>GpuFaultEventProcessor: filter severity and GPU keywords
  GpuFaultEventProcessor->>HealthReportSink: emit GPU fault alert
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately captures the main change: out-of-band GPU health detection and SEL fault alerting.
Description check ✅ Passed The description is directly related to the changeset and clearly explains the GPU inventory and fault alerting additions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@hatamzad-nv hatamzad-nv self-assigned this Jul 10, 2026

@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: 2

🧹 Nitpick comments (3)
crates/health/src/processor/gpu_events.rs (2)

92-106: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover both alert-target branches.

Current tests always use empty attributes, so the entry_idGPU/{id} mapping is never exercised, and the HostBMC fallback is not asserted. Add focused cases that verify both target values.

🤖 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 `@crates/health/src/processor/gpu_events.rs` around lines 92 - 106, The tests
for GPU fault report targets only cover empty attributes and do not verify
either mapping branch. Add focused tests around the GPU fault report processing
logic that provide an entry_id and assert the alert target is formatted as
GPU/{id}, and provide no entry_id and assert the fallback target is HostBMC.

Source: Coding guidelines


168-179: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use repository table-driven test helpers.

These tests repeat process(...) with multiple inputs and manually loop over cases. Prefer value_scenarios! or check_values so each severity and keyword variant is labeled and reported independently.

As per coding guidelines, prefer table-driven tests for operations with multiple input variants.

Also applies to: 191-206

🤖 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 `@crates/health/src/processor/gpu_events.rs` around lines 168 - 179, The tests
in ignores_non_actionable_severity and alerts_on_warning_severity should use the
repository’s table-driven test helpers instead of repeated assertions. Refactor
the severity variants into labeled value_scenarios! or check_values cases so
each input is evaluated and reported independently, preserving the existing
expected alert behavior.

Source: Coding guidelines

crates/health/src/discovery/spawn.rs (1)

387-425: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing success log on collector start — inconsistent with sibling blocks.

Every other collector-start block in this function (Discovery, Sensor, Metrics, Firmware, LeakDetector) logs a tracing::info! on the Ok(monitor) branch with endpoint_key and a running total (e.g. lines 107-114, 150-158, 192-199, 368-376, 449-457). The new GPU inventory block silently inserts the collector without any success log, which weakens observability parity when diagnosing rollout/startup behavior for this feature.

♻️ Suggested fix
             Ok(monitor) => {
                 ctx.collectors
                     .insert(CollectorKind::GpuInventory, key.clone().into(), monitor);
+                tracing::info!(
+                    endpoint_key = %key,
+                    total_collectors = ctx.collectors.len(CollectorKind::GpuInventory),
+                    "Started GPU inventory collection for BMC endpoint"
+                );
             }
🤖 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 `@crates/health/src/discovery/spawn.rs` around lines 387 - 425, Add a
success-level tracing::info! call in the Ok(monitor) branch of the GPU inventory
Collector::start block, matching the logging pattern used by Discovery, Sensor,
Metrics, Firmware, and LeakDetector, including the endpoint key and current
running collector total after insertion.
🤖 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 `@crates/health/src/collectors/gpu_inventory.rs`:
- Around line 247-269: Align the entity_count semantics in run_iteration: when
handling Expected::SkuMissing, do not report a measured GPU count because
Redfish was not queried. Return entity_count: None, matching the Expected::NoSku
and Expected::Count(0) branches while preserving the missing-SKU alert.

In `@crates/health/src/processor/gpu_events.rs`:
- Around line 29-35: The GPU fault keyword matching in GPU_FAULT_KEYWORDS misses
hyphenated “row-remap” messages. Normalize separators before matching or add
both “row remap” and “row-remap” keywords, then add a regression test covering
an “ECC row-remap” payload.

---

Nitpick comments:
In `@crates/health/src/discovery/spawn.rs`:
- Around line 387-425: Add a success-level tracing::info! call in the
Ok(monitor) branch of the GPU inventory Collector::start block, matching the
logging pattern used by Discovery, Sensor, Metrics, Firmware, and LeakDetector,
including the endpoint key and current running collector total after insertion.

In `@crates/health/src/processor/gpu_events.rs`:
- Around line 92-106: The tests for GPU fault report targets only cover empty
attributes and do not verify either mapping branch. Add focused tests around the
GPU fault report processing logic that provide an entry_id and assert the alert
target is formatted as GPU/{id}, and provide no entry_id and assert the fallback
target is HostBMC.
- Around line 168-179: The tests in ignores_non_actionable_severity and
alerts_on_warning_severity should use the repository’s table-driven test helpers
instead of repeated assertions. Refactor the severity variants into labeled
value_scenarios! or check_values cases so each input is evaluated and reported
independently, preserving the existing expected alert behavior.
🪄 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: CHILL

Plan: Enterprise

Run ID: a666367c-e6b2-4bc3-9fbd-aae405311c89

📥 Commits

Reviewing files that changed from the base of the PR and between 6ac0588 and b638905.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • crates/api-core/src/auth/internal_rbac_rules.rs
  • crates/health/Cargo.toml
  • crates/health/example/config.example.toml
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/gpu_inventory.rs
  • crates/health/src/collectors/mod.rs
  • crates/health/src/config.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/lib.rs
  • crates/health/src/processor/gpu_events.rs
  • crates/health/src/processor/mod.rs
  • crates/health/src/sink/events.rs

Comment thread crates/health/src/collectors/gpu_inventory.rs
Comment thread crates/health/src/processor/gpu_events.rs
@hatamzad-nv hatamzad-nv force-pushed the feat/301-oob-gpu-detection branch from b638905 to d78ae6e Compare July 10, 2026 16:55
Detect GPUs missing out-of-band (issue NVIDIA#301): a GPU-count-vs-SKU collector and
a SEL GPU-fault processor in hw-health. GPU counting is vendor-agnostic:
max(HGX_GPU_* chassis, ProcessorType=GPU processors) vs the SKU total.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Amir Hatamzad <ahatamzad@nvidia.com>
@hatamzad-nv hatamzad-nv force-pushed the feat/301-oob-gpu-detection branch from d78ae6e to 89238f7 Compare July 10, 2026 17:39
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.

1 participant