Skip to content

Remove nvidia-smi dependency: driver-free SKU via GFD label + PCI device-ID #1351

Description

@mchmarny

Summary

Derive the GPU accelerator SKU without nvidia-smi, then remove the SMI collector entirely. This lets the snapshot/agent image drop its CUDA base (nvcr.io/nvidia/cuda) and ship as a pure-Go static image built with ko, eliminating the recurring CUDA-image CVE surface.

Motivation / Context

The only data the rest of AICR consumes from the SMI collector is the GPU product name → accelerator SKU (gpu.smi.gpu.model, pkg/fingerprint/from_measurements.go#L41). Driver/CUDA/vbios/MIG/memory fields are collected but consumed by nothing (no fingerprint dimension, no validator code, no recipe constraint).

The SKU is already obtainable without SMI:

  • GFD node label nvidia.com/gpu.product (set by GPU Feature Discovery / GPU Operator) is already captured by the topology collector and already feeds reconcileAccelerator (from_measurements.go#L102). In the motivating OKE L40S snapshot, SMI returned 0 GPUs yet the fingerprint still resolved an accelerator from this label.
  • PCI device ID is already discovered by the NFD PCI source — extractHardwareInfo iterates the device instances and reads vendor/class (pkg/collector/gpu/nfd.go#L113-L119) but discards dev.Attributes["device"], the device ID needed to identify the SKU driver-free.

nvidia-smi never covered the day-0 case anyway (no driver image ⇒ no nvidia-smi); PCI enumeration is the genuinely driver-free path. So removing SMI in favor of label + PCI is strictly better for AICR's pre-deployment use case, and removes a heavy, CVE-prone base image.

The CUDA dependency is wired into the build, not just the agent pod:

.ko.yaml:15         defaultBaseImage: nvcr.io/nvidia/cuda:13.2.1-runtime-ubuntu24.04
.goreleaser.yaml:152               base_image: nvcr.io/nvidia/cuda:13.2.1-runtime-ubuntu24.04
.settings.yaml:150  snapshot_agent_cuda_image: nvcr.io/nvidia/cuda:13.1.0-base-ubuntu24.04

Fixes: N/A
Related: #1349, #1350 (token-boundary SKU matching — prerequisite; the PCI/label paths must reuse that same normalization + unknown-sku logic)

Proposed approach (phased)

  1. (done in fix(fingerprint): match GPU SKUs on token boundaries not substrings #1350) Token-boundary SKU matching so product names / labels classify correctly and unknown SKUs fail safe to unknown-sku.
  2. PCI device-ID → accelerator mapping. In extractHardwareInfo, read dev.Attributes["device"], map it to the AICR accelerator enum via a curated device-ID table, and surface it on HardwareInfo (pkg/collector/gpu/hardware.go#L30) + the hardware subtype. Add a fingerprint source for it. Reuse fix(fingerprint): match GPU SKUs on token boundaries not substrings #1350's normalization; unknown device IDs → unknown-sku.
  3. Make the GFD label the primary SKU source and remove the SMI collector (collectSMI, the NVSMIDevice XML model, and the nvidia-smi exec in pkg/collector/gpu). Fingerprint precedence becomes: GFD label → PCI device-ID → unknown-sku.
  4. Drop the CUDA base image. Flip .ko.yaml / .goreleaser.yaml base to distroless/static, remove snapshot_agent_cuda_image, and build the agent/server image with ko like aicr.

Open decisions (call out before implementation)

  • Device-ID table ownership / freshness. Where it lives and how it's kept current (CI check vs periodic review). New device IDs fail safe to unknown-sku until added; NVIDIA-employee maintainers have launch visibility. AICR's enum is coarse (~7 buckets), so the table maps device-ID → bucket, not exact marketing names.
  • GFD availability assumption. nvidia.com/gpu.product requires GPU Operator/GFD to have labeled the node. The PCI path is the fallback for nodes before that.
  • Residual host access. PCI/module detection still needs host /sys (+ /proc) mounts (pkg/snapshotter/doc.go#L195). Removing SMI drops the driver / CUDA image / --runtime-class nvidia requirement, not the sysfs mount.

Acceptance criteria

  • extractHardwareInfo maps PCI device IDs to the accelerator enum; covered by a table-driven test for every supported SKU's known device IDs, with unknown IDs → unknown-sku.
  • Fingerprint resolves the SKU with nvidia-smi absent, on both a GFD-labeled node (label path) and an unlabeled node (PCI path).
  • SMI collector code removed; no remaining consumers of SMI-only fields.
  • Image base switched to static/distroless; nvidia-smi and the CUDA base no longer required to fingerprint; grype scan no longer surfaces CUDA-image CVEs.
  • Docs updated (pkg/collector/gpu/doc.go, snapshotter agent docs, any image/runtime-class guidance).

Type of Change

  • New feature / enhancement (driver-free SKU detection; dependency removal)
  • Bug fix

Risk Assessment

  • Low
  • Medium — touches GPU collection, fingerprint precedence, and image build; phased and reversible (SMI removal is the last, gated step).

Metadata

Metadata

Assignees

Fields

No fields configured for Enhancement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions