clawdie-iso/doc/NVIDIA-UNIVERSAL-HANDOFF.md
Sam & Claude a9323aeddc feat(gpu): universal NVIDIA lane — detect + install branch at boot (Sam & Claude)
Opt-in NVIDIA_UNIVERSAL lane (default NO; normal/single-branch builds unchanged):
one ISO that adapts to an unknown NVIDIA target.

- build.cfg: NVIDIA_UNIVERSAL flag.
- build.sh: install_nvidia_universal_repo() stages an on-image pkg repo with all
  three branches (390/470/580 + settings), pkg-repo metadata, and a file:// repo
  conf; universal mode bakes no branch and sets clawdie_live_gpu_mode=nvidia-auto.
- clawdie_live_gpu: nvidia-auto mode detects the device id (PR #30 fix) -> branch
  {390,470,590} -> pkg-name -> `pkg install -r clawdie-nvidia` -> kldload, all
  best-effort with fallback to integrated/scfb (never blocks boot).
- doc/NVIDIA-UNIVERSAL-HANDOFF.md: Codex FreeBSD build + hardware validation plan.

sh -n clean; detector+branch+pkg map unit-tested on Linux
(1c8c->590->nvidia-driver-580, 0fc8->470, 0e22->390). The pkg fetch/repo layout,
offline boot install, writable root, kernel ABI, and image size MUST be validated
on the FreeBSD build host + real NVIDIA hardware (see handoff).

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

3.4 KiB

NVIDIA universal lane — Codex build + hardware validation handoff

From: Claude (Linux) · To: Codex ISO Builder (FreeBSD 15 host) Goal: one ISO that boots on any NVIDIA machine — detect the GPU pre-SDDM, install the matching branch from an on-image repo, kldload it, then SDDM/XFCE.

Authored on Linux (sh -n clean; detector + branch/pkg map unit-tested). The package/boot behavior must be built and proven on FreeBSD + real NVIDIA hardware — it cannot be validated from Linux.

What landed (behind NVIDIA_UNIVERSAL, default NO — normal builds unaffected)

  • build.cfg: NVIDIA_UNIVERSAL flag.
  • build.sh:
    • install_nvidia_universal_repo()pkg fetch -d the three families (nvidia-driver-390/470/580 + settings) into /usr/local/share/clawdie/nvidia-repo, pkg repo it, write /usr/local/etc/pkg/repos/clawdie-nvidia.conf (file:// , enabled).
    • In universal mode: no branch baked into the root; rc.conf clawdie_live_gpu_mode="nvidia-auto".
  • live/operator-session/clawdie-live-gpu (nvidia-auto mode): detect device id → branch {390,470,590} → pkg install -r clawdie-nvidia nvidia-driver-<n> nvidia-settings → kldload via existing select/load. Best-effort: any failure falls through to the integrated/scfb path — never worse than today.

Must verify on the FreeBSD build host

  1. pkg fetch -o / pkg repo layout — confirm pkg fetch -y -o DIR -d ... places archives where pkg repo DIR expects them; adjust if pkg repo needs DIR/All. Confirm the dependency closure is complete (offline boot install must not reach the network).
  2. Boot install commandpkg install -y -r clawdie-nvidia nvidia-driver-470 nvidia-settings resolves purely from the file:// repo with no network.
  3. Writable root at boot — the USB-root install must allow pkg install before SDDM (it does on a real on-USB FreeBSD; confirm).
  4. Kernel ABI — the staged kmod packages must match the image's kernel.
  5. Image size — three branches + deps add several hundred MB; confirm headroom against IMAGE_SIZE.
  6. Exactly one branch installed at boot (no mixing).

Build commands

# colibri artifacts first (do NOT cargo clean after)
cd /home/clawdie/colibri && git fetch origin && git reset --hard origin/main
cargo build --workspace --release

# universal image (set COLIBRI_REPO explicitly if building from a tmp worktree)
cd /home/clawdie/clawdie-iso && git fetch origin && git reset --hard origin/main
sudo env NVIDIA_UNIVERSAL=YES FEATURE_CLAWDIE=YES \
  COLIBRI_REPO=/home/clawdie/colibri \
  CLAWDIE_ARTIFACT_DIR=/home/clawdie/colibri/target/release \
  ./build.sh --skip-memstick-fetch --live-default-password

Hardware acceptance

  1. Boot on the NVIDIA target.
  2. cat /var/log/clawdie-live-gpu.log — expect: detected device id, chosen branch + pkg, "installed nvidia-driver-", selected/loaded modules.
  3. kldstat | grep nvidia and SDDM → XFCE comes up accelerated.
  4. If install/load failed, the log shows the fallback and the desktop still comes up on integrated/scfb (no hard failure).

Deletion criteria

Delete this handoff once a NVIDIA_UNIVERSAL=YES image has, on real NVIDIA hardware, auto-installed the correct branch and reached XFCE — with the result recorded below.

Results

(Codex: build host, GPU model + device id, branch chosen, pkg install outcome, image size delta, SDDM/XFCE result.)