Skip to content

enhancement: Add env-var gate for hardware detail mock data (ALL_SMI_MOCK_HARDWARE_DETAILS) #178

Description

@inureyes

Problem / Background

The vGPU mock is gated behind ALL_SMI_MOCK_VGPU and the MIG mock behind ALL_SMI_MOCK_MIG, allowing developers to test behavior with and without these features. However, the extended hardware detail fields (NUMA node ID, GSP firmware mode/version, NvLink remote device types, thermal thresholds, performance state) added in PRs #173 and #175 are emitted unconditionally by src/mock/templates/nvidia.rs.

This makes it impossible to mock-test how all-smi behaves when hardware details are absent (e.g., simulating an older NVIDIA driver that doesn't support GSP or NvLink queries).

Goal

Add an ALL_SMI_MOCK_HARDWARE_DETAILS environment variable gate around the extended hardware detail block in the NVIDIA mock template, consistent with the vGPU and MIG gating patterns.

Scope

  • Gate the hardware detail metrics block in src/mock/templates/nvidia.rs behind ALL_SMI_MOCK_HARDWARE_DETAILS
  • When the env var is unset, the mock should emit basic GPU metrics without NUMA, GSP, NvLink, or GPM fields
  • Thermal thresholds and P-state may be gated separately or together with hardware details (decide during implementation)
  • Update README mock server section to document the new env var

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions