interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / evidence / own-gpu-driver / rung2 / RUNBOOK.md

120 lines · 10241 bytes Raw Blame History Source

L332 rung 2, window 0: give the GPU to our driver for a few minutes, read it, give it back

Purpose: the smallest real step. Prove we can take the GB10 away from NVIDIA's driver and give it back, measure how long that takes (nvidia.ko has never been reloaded on this box since boot, so nobody knows), and let our module aien-gpu read the chip's identity and set up its memory area. Our module writes nothing to the GPU in window 0.

Scheduled by: the coordinator (ledger line "L332 window 0"). Run only inside that window. Hands-off: nothing needs a person at the machine unless the box fails to come back from a reboot (see Recovery).

What goes down, and for how long

Everything that uses the GPU, from part 1 until the restore reboot at the end of part 2. The four NVIDIA modules are nvidia_drm, nvidia_modeset, nvidia_uvm, nvidia (lsmod). Holders of /dev/nvidia* on 2026-10-21 22:0xZ (sudo fuser -v):

Why a reboot and not "unload the driver"

NVIDIA's display part has a worker that spins forever on this headless box (L158: nvEvoWaitForCoreNotifier). Unloading nvidia_modeset waits for that worker, so the unload would most likely hang with the GPU half torn down (INFERRED from ~/handoffs/fixer-modeset-kthread.md item 2; not tested). So the GPU is freed by booting once with NVIDIA's modules held back. Revised 2026-10-26 (NoNvDriver review): the hold-back is self-reverting (window-boot.sh). GRUB_DEFAULT=0 stays; a one-shot custom.cfg entry aien-gpu-window (today's command line plus `aien.gpuwindow=1 systemd.watchdog_sec=30 panic=10 oops=panic) is chosen for exactly one boot by grub-reboot`. In that boot only, aien-gpu-window-hold.service writes the hold-back file to /run/modprobe.d (tmpfs) before udev and modules-load, and aien-gpu-window-lease.service reboots after 25 minutes. Any later boot, planned or not, is today's boot with NVIDIA; no file to delete by hand. The old /etc/modprobe.d file survived a crash and pinned every later boot to "no NVIDIA". The NVIDIA modules are not in the initramfs (checked, fail-closed, by part 1 and by window-boot.sh check). Alternative not chosen: kexec with modprobe.blacklist= on the command line (no file, faster) because the GPU state after a kexec without a firmware reset is UNKNOWN on GB10.

Facts checked on 2026-10-21 (read-only)

Steps

Scripts in this directory, each line timed into window0-<UTC>.log (window0-current.log points at it). Prep (changes the boot config, needs Drake's go): ./window-boot.sh check (read-only, any time), then ./window-boot.sh install --yes (adds the inert GRUB entry and the two units; normal boots are unchanged).

  1. Any time before the window: ./window0-pre.sh (no --go) checks the module, Secure Boot, initramfs and lists holders.
  2. Window opens; coordinator stops the GPU users; ./window0-pre.sh --go: records lsmod, nvidia-smi, cmdline, module hash, refuses if anything but persistenced still holds the GPU, runs window-boot.sh check and arm --yes and reboots into the one-shot window entry.
  3. After ssh is back: ./window0-post.sh: refuses unless this is the window boot; logs boot time; checks no nvidia module and no driver on the GPU; sets panic auto-reboot; insmod aien_gpu allow_bind=1; aien_gpu_check (identity, firmware size, arena mmap pattern); rmmod; optional FLR recovery test (AIEN_W0_FLR=1, Drake decides); removes the /run hold-back file; timed modprobe nvidia nvidia_uvm + first nvidia-smi answer (NVIDIA's load-to-ready baseline); Omega gpu_launch_cost_test --reps 3 (first open after load, timed); prints WINDOW0 PASS or FAIL; normal reboot.
  4. After the restore reboot: lsmod | grep -c ^nvidia = 4, nvidia-smi -L lists the GPU, no aien.gpuwindow=1 on the command line, ./window-boot.sh status shows no next_entry; owners restart their servers; commit the log; window closes. ./window-boot.sh uninstall --yes when no more windows are planned.

Recovery

Gate (window 0 PASS when all hold)

Window 1: start NVIDIA's GSP firmware with our own code

Only after window 0 PASS (part 1 refuses otherwise). Same take-away and give-back as window 0 (reboot with NVIDIA held back, restore reboot), so the same people stop the same GPU users.

What our code does to the chip, all of it from the source lines quoted in native/kernel/gpu/gsp_mmio.h and gpu/contract/gb10_gsp.devc: builds the start-up package in memory the GPU can read (L192 builder), writes one 868-byte signed packet into SEC2's mailbox memory, rings SEC2 once, waits for SEC2 to hand control to GSP, writes the GSP-RM version into one register, then only reads: GSP's status messages until "INIT_DONE" or 30 s.

Why this cannot harm the chip: the GPU checks NVIDIA's signature on the firmware itself (the chain of trust lives in SEC2 and the boot ROM; we hand over NVIDIA's signed images byte for byte, pinned by SHA-256). Our module lets user space reach only the 12 start-up registers (6 of them writable), only with allow_boot=1, and rings the SEC2 doorbell once per load. What can go wrong is that GSP is left stopped or half started until the GPU is reset.

UNKNOWN until this window (said out loud):

Steps (each line timed into window1-<UTC>.log, window1-current.log points at it):

  1. Before the window: make -C native/linux/aien-gpu all tools sim-test (sim test PASS), the package ./window1-package.sh <dir> (WINDOW1_PACKAGE: PASS), then ./window1-pre.sh <dir> (checks only).
  2. Window opens, GPU users stopped: ./window1-pre.sh <dir> --go (blacklist file, reboot).
  3. After ssh is back: ./window1-post.sh: deletes the file, aborts if any NVIDIA module is loaded, sets panic auto-reboot, insmod aien_gpu allow_bind=1 allow_boot=1 arena_mib=<package size + 9> heap_mib=512, runs aien_gsp_boot (register trace with times, plan, every status message, GSP log buffers, verdict) into window1-<UTC>-run/, prints WINDOW1 PASS or STOPPED, reboots WITHOUT rmmod.
  4. After the restore reboot: ./window1-check.sh (four NVIDIA modules, nvidia-smi answers, file gone, aien_gpu not loaded): WINDOW1 RESTORE PASS. Owners restart their servers. Commit the log and the run directory, pass or fail.

Recovery: as window 0. If part 3 fails (nvidia-smi does not list the GPU after the restore reboot), reboot once more; if it still fails, the GPU needs a power cycle (Drake, physical), and nothing else is tried on the chip until then.

Gate (window 1 PASS): aien_gsp_boot verdict INIT-DONE, register trace inside the allowlist, WINDOW1 RESTORE PASS. Any other verdict is still a result: it names the step that stopped (SEC2, mask, lockdown, FMC code, core, queue).

Later windows (each needs its own prepared step and its own request)

  1. (window 1 above.)
  2. The RPC subset from docs/numeric/DRIVER_FLOOR.md and one channel (gpu/contract/gb10_chan.devc).
  3. Omega on aien-gpu through L202's typed handles: golden tokens identical to nvidia.ko, per-word timing and start time side by side.