fix(gpu): NVIDIA auto-detection with corrected PCI device-id read + runtime mode support (C&C) #30

Merged
clawdie merged 1 commit from nvidia-auto-detect into main 2026-06-04 22:10:01 +02:00

1 commit

Author SHA1 Message Date
Sam & Claude
d2ec1b7a72 fix(gpu): make NVIDIA auto-detection actually read the right PCI id (Sam & Claude)
The #29 detector grepped `chip=0x10de...`, but FreeBSD's chip field is
chip=0x<device><vendor> with vendor 0x10de in the LOW 16 bits — so it never
matched and the device id / recommended-branch logic was dead.

- nvidia_device_id: match `chip=0x<4hex>10de` and strip to the device id
  (chip=0x1c8c10de -> 1c8c).
- nvidia_branch_for_device: non-overlapping architecture ranges returning the
  build's lane labels {390,470,590} so detected vs staged compare correctly;
  empty/unknown -> 590 (safe default for modern unknown hardware).

Validated on Linux against representative ids: Fermi 0e22->390, Kepler 0fc8->470,
Maxwell 1380 / Pascal 1b81 / Turing 1c8c / Ada 2684 ->590, empty->590. sh -n clean.

This is the detection brain for the universal NVIDIA auto-install lane; the
on-image NVIDIA repo + boot-time install is the FreeBSD build-side work (handoff).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 22:07:02 +02:00