Skip to content

machine-health: nvidia-smi argument list in Get-GpuDriverInfo splits on spaces after commas #3370

Description

@kyle-sexton

Context

plugins/machine-health/skills/audit/scripts/windows/lib/Get-GpuDriverInfo.ps1:33-34 invokes:

$raw = & nvidia-smi --query-gpu=name, driver_version `
    --format=csv, noheader 2>$null

In PowerShell native-command argument parsing, the space after each comma splits these into separate arguments: --query-gpu=name,, driver_version, --format=csv,, noheader (PowerShell also parses bare comma-separated tokens as arrays, which then flatten to separate native args). nvidia-smi therefore receives malformed flags and either errors or ignores the extra tokens, so the NVIDIA branch returns nothing on real hardware. The suite's mocks accept any arguments, masking the bug. Cost of leaving it: NVIDIA driver info is silently absent from real audits while tests stay green.

Proposed work

  • Pass each flag as a single token: --query-gpu=name,driver_version and --format=csv,noheader (no spaces), or quote the values.
  • Tighten the test mock to assert the exact argument shapes nvidia-smi receives, so a regression is caught.

Acceptance criteria

  • The nvidia-smi invocation passes --query-gpu=name,driver_version and --format=csv,noheader as two intact arguments.
  • A test fails if the argument list is split (mock asserts on received args).
  • On a machine with nvidia-smi, the audit reports GPU name and driver version (manual spot check).

References

  • plugins/machine-health/skills/audit/scripts/windows/lib/Get-GpuDriverInfo.ps1:33-34
  • Found by the batch-simplify sweep on branch claude/code-tidying-batch-simplify-s7ljbi; deliberately not fixed there because the sweep was behavior-preserving.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highSignificant impact, or blocks an imminent release; staff this cycle.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions