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
Owner

Two-part NVIDIA lane fix:

  1. Runtime mode support (PR #29 absorbed): clawdie_live_gpu now respects clawdie_live_gpu_mode (safe/auto/nvidia) and clawdie_live_gpu_nvidia_branch (390/470/590). Dedicated NVIDIA-target builds set mode=nvidia in rc.conf; default builds stay auto.

  2. Device-id correction (d2ec1b7): the old detector read chip=0x10de... (vendor half) and never matched. Fixed to read chip=0x<device>10de — extracts the actual device ID from the high 16 bits, then maps to the correct driver branch.

Detection verified on Linux against real device IDs: Fermi→390, Kepler→470, Maxwell/Pascal/Turing/Ada→590, unknown→590-safe. Logs to /var/log/clawdie-live-gpu.log.

Boot path: detects NVIDIA → logs device ID + recommended branch → if mode=nvidia + nvidia.ko present → kldload; otherwise falls through to integrated/AMD/scfb (never worse than today). Mismatch guard: staged branch ≠ detected → warns, skips proprietary load.

Two-part NVIDIA lane fix: 1. **Runtime mode support** (PR #29 absorbed): clawdie_live_gpu now respects `clawdie_live_gpu_mode` (safe/auto/nvidia) and `clawdie_live_gpu_nvidia_branch` (390/470/590). Dedicated NVIDIA-target builds set mode=nvidia in rc.conf; default builds stay auto. 2. **Device-id correction** (d2ec1b7): the old detector read `chip=0x10de...` (vendor half) and never matched. Fixed to read `chip=0x<device>10de` — extracts the actual device ID from the high 16 bits, then maps to the correct driver branch. **Detection verified on Linux against real device IDs:** Fermi→390, Kepler→470, Maxwell/Pascal/Turing/Ada→590, unknown→590-safe. Logs to /var/log/clawdie-live-gpu.log. **Boot path:** detects NVIDIA → logs device ID + recommended branch → if mode=nvidia + nvidia.ko present → kldload; otherwise falls through to integrated/AMD/scfb (never worse than today). Mismatch guard: staged branch ≠ detected → warns, skips proprietary load.
clawdie added 1 commit 2026-06-04 22:09:51 +02:00
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>
clawdie merged commit 49794906eb into main 2026-06-04 22:10:01 +02:00
clawdie deleted branch nvidia-auto-detect 2026-06-04 22:10:01 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/clawdie-iso#30
No description provided.