omega-harness
Agent skills for operating, encoding and communicating in Omega (.om) and the AIEN repositories
Brought by drakestapleton
omega-harness / skills / nvidia-gb10 / SKILL.md
| 1 | --- |
| 2 | name: nvidia-gb10 |
| 3 | description: Load before touching the NVIDIA GPU in Drake's DGX Spark (the GB10 chip). Covers running or benchmarking a model on the Spark GPU, the shared model service, the chip lock and timing windows, NVIDIA driver debugging, writing kernels for the chip, and the mistakes already made there. |
| 4 | --- |
| 5 | |
| 6 | # NVIDIA GB10 (the Spark's GPU): how to work on it without repeating old mistakes |
| 7 | |
| 8 | Researched 2026-11-14 (Spark clock 2026-11-15T01:54Z) from our own records, plus NVIDIA's documentation fetched |
| 9 | through Context7 the same day (section 12). Every line carries a source. Sources: |
| 10 | `RULES` = the agent instruction file installed on the Spark from this repository's `rules/rules.txt` plus the |
| 11 | machine's local overlay (generated, binding, newer than anything here); |
| 12 | `BOARD <time>` = a line of `HANDOFFS/BOARD.md` on the Spark; `Lnnn` = an entry of `ledger list all` on the Spark; |
| 13 | `cortex <id>` = `cortex_get <id>`; `TEAM-MEMORY:n` = line n of `HANDOFFS/TEAM-MEMORY.md`. |
| 14 | Machine-local places are named, not spelled out; the Spark's local configuration says where each one is: |
| 15 | `HANDOFFS` = the team's shared handoff folder (board, team memory, evidence); `BIN` = the operator's local tool |
| 16 | folder; `STATE` = the operator's local state folder; `DOCS` = the offline vendor manuals; `YARDSTICKS` = the |
| 17 | timing windows and receipts folder; `MODEL_PORT` = the local port of the shared model service. |
| 18 | The Spark's local overlay of RULES spells out the real folders and port that `HANDOFFS`, `BIN`, `STATE`, `DOCS` and |
| 19 | `MODEL_PORT` stand for; the header of |
| 20 | `spark-receipt` names `YARDSTICKS`. Substitute the real values from there before running a command below. |
| 21 | Numbers are quoted from those records with their dates. Nothing here was re-measured. |
| 22 | If a record and this file disagree, the record wins. Section 11 lists what the records themselves disagree on. |
| 23 | |
| 24 | ## 1. What the hardware is |
| 25 | |
| 26 | - NVIDIA GB10 Grace Blackwell superchip: Blackwell GPU, compute capability SM 12.1 (`sm_121`, not datacenter |
| 27 | Blackwell), with 10 Cortex-X925 + 10 Cortex-A725 cores. [Spark skill `spark-hardware-manual` section 1] |
| 28 | - PCI device 10de:2e12 at 000f:01:00.0. `nvidia-smi` names it "NVIDIA GB10", driver 580.173.02 |
| 29 | (open kernel modules). [GPUID.TXT below; `nvidia-smi --query-gpu=name,driver_version` read 2026-11-15T01:54Z] |
| 30 | - The chip's own identity registers say GB20B, not GB10B: BOOT_0 0x1bb000a1, BOOT_42 0x1bba1000 = architecture |
| 31 | 0x1B (GB200), implementation 0xB. Read on bare metal 2026-11-12T05:45Z. |
| 32 | [`HANDOFFS/hive/finalize/spark-boot/result-20261112T054515Z/GPUID.TXT`; L1267; cortex ca5df793-54f4-4bdc-9d43-36e91c4750ba] |
| 33 | - Unified memory: one LPDDR5x pool for CPU and GPU, no separate GPU memory. `nvidia-smi` shows memory total as |
| 34 | N/A; that is normal here. Linux MemTotal is 127598752 kB = 121.69 GiB (aien-calc, not stored). Marketing size |
| 35 | is 128 GB. [`spark-hardware-manual` section 1; `/proc/meminfo` read 2026-11-15T01:54Z] |
| 36 | - Two dies. Memory controllers sit on the CPU die, so every GPU byte to or from DRAM crosses NVLink-C2C |
| 37 | (345 GB/s per direction per `nvidia-smi c2c -s`). GPU L2 is 24 MiB. [TEAM-MEMORY:5; whitepaper `DOCS/gb10/`] |
| 38 | - Memory bandwidth: 273 GB/s is derived (8533 MT/s x 256 bit), aggregate for reads and writes. Measured GPU DRAM |
| 39 | read ceiling 236.9 GB/s on 2026-10-25. [cortex omp-learn-ef4477f648e01652] |
| 40 | - 48 SMs, 1536 threads per SM, 65,536 registers per SM, 100 KiB shared memory per SM carvable (measured |
| 41 | 2026-10-25). A launch of 1024-thread CTAs fits one CTA per SM, so one wave is 48 CTAs. |
| 42 | [cortex omp-learn-ef4477f648e01652; TEAM-MEMORY:16] |
| 43 | - SM clock: idle 208 MHz, 2548 MHz observed under a 35B load (2026-10-25); 2444 MHz seen under a sustained full-GPU load |
| 44 | (2026-11-08). `nvidia-smi` gives memory clock and power limit as N/A. [same cortex id; BOARD 2026-11-08T23:37:31Z] |
| 45 | - Vendor documents are kept offline in `DOCS` (GB10 whitepaper and Hot Chips deck in `DOCS/gb10/`), searched |
| 46 | with `doc-grep` / `doc-page`. The Blackwell Tuning Guide is datacenter-first: only its CC 12.x lines apply. |
| 47 | Doc traps: "8 TB/s HBM3E" is GB300 and "126 MB L2" is GB200. [TEAM-MEMORY:18; cortex omp-learn-ef4477f648e01652] |
| 48 | |
| 49 | ## 2. Binding rules that govern GPU use (read RULES; this is only an index) |
| 50 | |
| 51 | - "Shared model on MODEL_PORT: claim time on the board" (Drake, 2026-11-14). See section 4. |
| 52 | - "Play well together" (2026-10-24): look first, say on the board what you run and for how long, use an idle chip |
| 53 | without asking anyone, step aside when asked, never kill or block a coworker's job. Never ask Drake for |
| 54 | permission to use an idle shared resource. |
| 55 | - "Debugging a machine" (2026-10-03): read the manufacturer's documentation before experimenting. A hook |
| 56 | (the harness hook `manual-guard.sh`) blocks chip and driver edits and launches until |
| 57 | `docs-read REPO "SOURCE" "QUOTED LINE or DOCS SILENT on X"` is recorded (valid 8 h). Load the Spark skills |
| 58 | `spark-hardware-manual` and `investigate` first. |
| 59 | - "Hardware first" (2026-10-24): reason from the chip, memory movement and measured bottlenecks; new code is Omega. |
| 60 | - "Build our own, close to the metal" (2026-10-16): outside tools are research or a comparison point, never the |
| 61 | plan. Report speed against the hardware ceiling, not only the old baseline. |
| 62 | - "Mathematics goes through Wolfram and the calculator" and "No estimates without a receipt": every figure comes |
| 63 | from `aien-calc eval` (cite `calc:<id>`) or Wolfram; otherwise write "not measured". |
| 64 | - "Harness lock": never swap which model serves on MODEL_PORT unless its four conditions hold (Drake's words from |
| 65 | this session quoted on the board, replacement proven, undo written first, plain note to Drake). |
| 66 | - "Spark is for development, not serving" (Drake, 2026-11-14): never leave any model running when you are not |
| 67 | using it; bring yours up and down with a trap; no model service enabled at boot. |
| 68 | [`HANDOFFS/RULE-spark-no-idle-models.md`; BOARD 2026-11-14T13:36:01Z] |
| 69 | - Never kill, stop or restart another lane's job; coordinate a restart with that lane on the board (any agent |
| 70 | may take the coordinator role). [RULES] |
| 71 | |
| 72 | ## 3. Before you touch the chip |
| 73 | |
| 74 | 1. Look: `spark-window status`, `nvidia-smi --query-compute-apps=pid,name,used_memory --format=csv`, |
| 75 | `ps`, and the last 40 lines of `HANDOFFS/BOARD.md`. [RULES "Play well together"] |
| 76 | `BOARD.md` is about 3 MB: always `tail` it or `grep ... | cut -c1-600`. |
| 77 | 2. If a current CLAIM, START or RESERVED line names the chip or MODEL_PORT, wait or settle it on the board. |
| 78 | 3. Post one board line before you start (what, how long, how to reach or pause you) and a RELEASE or DONE line |
| 79 | after: `echo "$(date -u +%FT%H:%MZ) CLAIM <lane> to all: ..." >> HANDOFFS/BOARD.md`. [RULES "Team board"] |
| 80 | 4. The chip lock is the file `/tmp/aien-gb10.lock` (flock). Take it through `spark-window`, not by hand, when |
| 81 | timing. `spark-window locks gb10` shows holders and queue. [`BIN/spark-window` header] |
| 82 | 5. Check memory before any load (section 5). |
| 83 | 6. CPU-side work during someone's timing window: run under the queen pool locks |
| 84 | (`HANDOFFS/hive/queen/pool-*.lock`, flock), `taskset`, `nice 10`, and post pid/pgid so the timing lane can |
| 85 | SIGSTOP and SIGCONT you. [cortex omp-learn-0bcfaab846d0e636] |
| 86 | |
| 87 | `spark-window` usage (from its header, read 2026-11-14; do not paraphrase from memory, run `sed -n 1,60p` on it): |
| 88 | - `spark-window open NAME [--ledger ID] [--lease MIN] [--gb10 exclusive|shared|none] [--quiet exclusive|none] [--wait]` |
| 89 | - `spark-window run CMD...` sets `SPARK_WINDOW`, `SPARK_WINDOW_DIR` and, if it holds the chip, `AIEN_GB10_LOCK_HELD=1`. |
| 90 | - `spark-window close [ID]`, `status`, `id`, `locks [gb10|quiet]`. |
| 91 | - Always capture the window id and close with an `EXIT` trap (`WID=$(spark-window open <name> --lease 15 --gb10 exclusive --quiet exclusive | tail -n 1); trap 'spark-window close "$WID" >/dev/null 2>&1 || true' EXIT`). `--lease` takes integer minutes (`15`, not `15m`) and `NAME` is positional. |
| 92 | - **Verify CLI flags before passing `--sim` to any GPU test binary**: some tests (e.g. `gpu_qmma_probe_test`) only support `--host-only` and treat unknown flags as a live-GPU run. Check `main()` or `--help` first so a host check never opens the GB10 outside a window. |
| 93 | - One window at a time. Exclusive windows are for timing receipts only and last at most 20 min; an overrun gets |
| 94 | NO VERDICT. `--quiet none` is for value checks and must never produce a number reported as a speed. |
| 95 | - `open` waits for a quiet machine (gives up after 2700 s by default: load at most 10, at most 3 quiet-lock |
| 96 | jobs), then waits for the chip lock with no timeout. [cortex omp-learn-923b7b170bf8244f, read from source 2026-10-30] |
| 97 | - `STATE/aien-coordinator/CHIP-RESERVED` is a courtesy note that spark-window prints; it is not a gate. |
| 98 | [RULES; TEAM-MEMORY:11] |
| 99 | - `spark-receipt` syntax: always invoke inside `spark-window run` with positional `NAME` (`spark-window run spark-receipt NAME -- CMD`), never `--window` or `--out`, so `window_id` is recorded cleanly. |
| 100 | - Live 35B `q36-serve` teacher launches: use `~/.local/bin/q36-35b --port PORT` (`--model-dir`, not `--model`) and allow a **90–120 s cold-load readiness wait** when page cache is cold (34.7 GB safetensors observed at `43–72 s`). |
| 101 | - Never run 165-task `ollm-gb10 gsample` loops inside a 20m exclusive GPU window; run 16-way parallel CPU `ollm sample` outside the window instead. |
| 102 | |
| 103 | Automatic actors you will meet: |
| 104 | - `chip-watchdog` (`BIN/chip-watchdog`, seen running on 2026-11-15): every 5 s it checks the |
| 105 | exclusive holder of `/tmp/aien-gb10.lock`. If that process tree used no CPU and 0 % GPU for 45 s |
| 106 | (`CHIP_WATCHDOG_WINDOW`), it sends SIGTERM then SIGKILL and posts a board line. Holding the lock through an |
| 107 | idle baseline gets you killed (BOARD 2026-11-14T15:20:25Z and 15:22:10Z). A client that holds the lock for a |
| 108 | detached container is killed at about 45 s while the container keeps running. |
| 109 | [script source; cortex omp-learn-b2a3151da06520eb] |
| 110 | - TracePause (a loop run from another session, seen 2026-11-15): SIGSTOPs other lanes' CPU jobs during a timing window and |
| 111 | SIGCONTs them after. A stopped job shows rc 147. Check the board for an open PAUSE line before starting jobs. |
| 112 | [BOARD 2026-11-15T00:05:26Z, 00:06:50Z; TEAM-MEMORY:27] |
| 113 | |
| 114 | ## 4. The shared model on port MODEL_PORT |
| 115 | |
| 116 | - What it is (2026-11-14): `aien-serve-http --engine omega`, model `qwen3.6-35b-a3b-fp8` (the "35B"), started by the |
| 117 | systemd user unit `motor-revival.service` (L1015). The unit checks the sha256 of the binary and then of the |
| 118 | weights before it starts the server; read its working directory, environment and command line from |
| 119 | `systemctl --user cat motor-revival.service` (read 2026-11-15), not from a copy. On 2026-11-15 the unit pinned |
| 120 | the server to two X925 cores inside `quiet-measure`'s set (section 6): check its `CPUAffinity` before timing |
| 121 | beside a running server. |
| 122 | - The unit is disabled and normally inactive since 2026-11-14. [`HANDOFFS/RULE-spark-no-idle-models.md`; `is-enabled` = disabled] |
| 123 | - Check: `nvidia-smi --query-compute-apps=pid,name,used_memory --format=csv`, `spark-window locks gb10`, and |
| 124 | `curl -s localhost:MODEL_PORT/health` (reported fields: status, model, engine, concurrency, in_flight). |
| 125 | [BOARD 2026-11-14T10:04:23Z; cortex omp-learn-a9344da0159c83f9] |
| 126 | - Start (after a board CLAIM): `systemctl --user start motor-revival.service`. Stop: `systemctl --user stop |
| 127 | motor-revival.service`; wrap both in a script with a trap so the model goes down on every exit path. |
| 128 | [BOARD 2026-11-13T20:26:56Z, 2026-11-14T13:40:52Z] |
| 129 | - The rule (Drake, 2026-11-14): the model may be shut down and left DOWN; nobody has to put it back. Do not stop |
| 130 | it under a lane with a current claim. Post a quiet-time or test claim, then a RELEASE line. [RULES] |
| 131 | - While it runs it uses about 56 GiB of the shared pool (56089 MiB, nvidia-smi 2026-11-15T01:54Z) and, as started |
| 132 | by the unit, holds `/tmp/aien-gb10.lock` exclusively for its whole life. Any other chip job then waits or |
| 133 | reports NOT_RUN (L1072). [`spark-window status` 2026-11-15T01:54Z] |
| 134 | - Do not wrap a request to the server in `flock /tmp/aien-gb10.lock`: the server takes that lock itself and |
| 135 | answers 503. Send when `flock -n /tmp/aien-gb10.lock true` succeeds and retry only on 503. Its default is |
| 136 | top_k 20; send top_k 0 for greedy work. [cortex d4e0f1ee-96de-4c63-be17-aca1d032c712, 2026-10-20, 27B build] |
| 137 | - A second large model never fits beside it: on 2026-10-25T02:47Z a second 35B load passed its MemAvailable check |
| 138 | and the kernel OOM killer took the live server. [cortex omp-learn-17961307b17bbeac] |
| 139 | - For A/B timing of serving builds use a private port, not MODEL_PORT, so other clients do not contaminate the arms. |
| 140 | Test-server ports have owners (TEAM-MEMORY:2). [cortex omp-learn-a9344da0159c83f9] |
| 141 | - The server refuses requests that carry tools ("tool calling is not supported"). [L1150] |
| 142 | - If you must kill a server by hand, select the pid by `--port`, not by a pgrep pattern (a pattern once matched |
| 143 | the caller's own shell). [cortex omp-learn-465866d88240ca4b] |
| 144 | |
| 145 | ## 5. Memory: one pool, and MemAvailable lies |
| 146 | |
| 147 | - GPU allocations come out of host RAM. A device upload plus host buffers next to a resident server triggered the |
| 148 | OOM killer on 2026-10-18 (it killed the live server). Guard used since: refuse unless MemAvailable is at least |
| 149 | the upload size + 12 GiB. [cortex 0d7da592-3ac5-41f7-b8d4-5559a1044163] |
| 150 | - MemAvailable counts mmapped model file pages as reclaimable while they are in use. Admission should use |
| 151 | MemAvailable minus Mapped. [cortex omp-learn-17961307b17bbeac; `BIN/q36-extra` header v4] |
| 152 | - Wait for memory first, then take the chip lock, then check memory again; if short, drop the lock and loop. |
| 153 | Never wait for memory while holding the lock. [cortex 19998b69-4c84-4c7d-ad44-0b0d771249e9] |
| 154 | - Leave about 10 s (or a readiness check) between one chip process exiting and the next starting: RM frees memory |
| 155 | late and the next process dies with NV_ERR_NO_MEMORY. [cortex 9eb3320d-52bb-4e2d-b331-7b3a7b0e520b] |
| 156 | |
| 157 | ## 6. Measuring speed correctly |
| 158 | |
| 159 | - Value checks (tokens, logits, cosines) may share the chip. Only timing needs it alone, for as short as the |
| 160 | measurement needs. [RULES "Play well together"; spark-window header, L405 policy] |
| 161 | - A speed number counts only from an exclusive window on a quiet machine: |
| 162 | `spark-window open NAME --wait`, then `spark-window run spark-receipt NAME -- CMD`, then `spark-window close`. |
| 163 | `quiet-measure CMD...` pins CMD to the X925 cores (5-9,15-19) under the quiet lock. |
| 164 | [headers of `spark-window`, `spark-receipt`, `quiet-measure`] |
| 165 | - What invalidates a number: the window overran its lease (NO VERDICT); it ran with `--quiet none`; builds ran |
| 166 | beside it (label it "shared machine"); other clients hit the same server; the model on MODEL_PORT was generating. |
| 167 | A contaminated baseline was discarded on 2026-10-24 when untouched kernels moved 3.86 to 4.02 ms. |
| 168 | [spark-window header; cortex 9eb3320d-52bb-4e2d-b331-7b3a7b0e520b] |
| 169 | - Budget a sweep against the lease deadline (mtime of `$SPARK_WINDOW_DIR/held` + lease), not your own start time; |
| 170 | wrap each run in `timeout`; log skipped cells NOT_RUN. [cortex omp-learn-923b7b170bf8244f] |
| 171 | - `GraphStats.chip_ns` is host-clock time from submit to marker seen (50 us poll after a 2000 us spin), not GPU |
| 172 | time. Use per-launch device stamps for a true split. [cortex omp-learn-f5a39ecbf8ef75f3, 2026-10-31] |
| 173 | - An instrument's off-switch control must also reject stale data from an earlier run (stamps once came back |
| 174 | "valid" with stamping off). [cortex ec9876e5-643e-4558-9aa5-8b0b0589664f] |
| 175 | - The engine flushes GPU L2 at launch end, so a GPU-cached "control" read after completion proves nothing. |
| 176 | [TEAM-MEMORY:15] |
| 177 | - Compute bytes-per-token floors with a stated bandwidth and say which: 273 GB/s nominal or 236.9 GB/s measured. |
| 178 | Before tuning a grid constant: waves = ceil(CTAs / 48). About 22 us per launch is fixed cost, so fewer |
| 179 | launches beat better grids. [TEAM-MEMORY:9, 16, 24; cortex omp-learn-ef4477f648e01652] |
| 180 | - Head-to-head runs: freeze the protocol before any timed number, check correctness first, report prompt |
| 181 | processing and generation separately, record driver, clocks, power state and load per session, and disclose |
| 182 | which arms load NVIDIA user-space libraries. Model: `HANDOFFS/H2H9B/PROTOCOL.md` (v3, 2026-10-27). |
| 183 | - Drake on comparisons (2026-11-13): if ours does not beat theirs, assign a root cause and corrective action, |
| 184 | fix, retest. [cortex omp-learn-3d51cac320c021a3] |
| 185 | - Receipts: `spark-receipt` writes `YARDSTICKS/receipts/<date>-<NAME>.json` (energy, GPU W, load, MemAvailable, |
| 186 | lock holders, NVRM error delta, exit code, git head). Wall energy under about 20 J is noise. |
| 187 | |
| 188 | ## 7. Known traps (symptom; cause; fix; source) |
| 189 | |
| 190 | 1. Host-polled completion marker arrives about 1.06 s late or never (`marker2_wait word=0x0`); the marker memory |
| 191 | was GPU-cacheable system memory, which NVIDIA's `nvos.h` says is not coherent with CPU mappings; allocate |
| 192 | poll and marker memory with `nvrm_alloc_gpu_uncached`. [cortex d03a999a-1d55-4875-83d1-ba277daae049, a4f2b40e-5327-410c-8763-d38cac94202b] |
| 193 | 2. GPU re-executes old commands or never reports the next job; CPU-rewritten, GPU-read memory (GPFIFO/USERD, |
| 194 | pushbuffers, pools) was GPU-cacheable; make it GPU-uncached, or use NVIDIA's flush and invalidate sequence. |
| 195 | Regression test: physics `nvrm/submission_visibility_gates.c`. [cortex d116ecf9-6d98-439e-880b-8a721d77cf46] |
| 196 | 3. Decode slow (GEMV 153 of 273 GB/s) after "uncache everything"; chip-only intermediates were uncached, so every |
| 197 | read went to DRAM; keep host-touched regions uncached and chip-only intermediates cached (153 to about |
| 198 | 207 GB/s, 2026-10-19). Caching weights gave no gain. [cortex 015433e3-f08c-43f6-a666-adf4fd1ca630] |
| 199 | 4. Resident GPU program unreliable; fix was four rules: scoreboard every control word, uncached poll memory, |
| 200 | regcount >= used + 2 (top 2 registers reserved), MEMBAR.SC.SYS before the tail store. |
| 201 | [cortex 1d867912-a365-4af3-948d-74055e7bfef1] |
| 202 | 5. `NV_ERR_TIMEOUT ... STOP_CHANNEL` jams (158 on 2026-09-28); our own tests were killed mid-run and the resident |
| 203 | seat kept spinning; never kill, force-stop or `timeout` a chip test with a resident seat, run it detached, |
| 204 | one GPU test at a time. [cortex d601e9b6-c4e7-4076-b2f9-9c6af933c604] |
| 205 | 6. New GPU client fails at channel create with status 81 (0x51 NV_ERR_NO_MEMORY) while tens of GB are free; the |
| 206 | driver wants one contiguous block and `/proc/buddyinfo` shows 0 free order-9 blocks; read MemFree and |
| 207 | buddyinfo, not MemAvailable. What cleared it on 2026-11-12, run with root privileges: `sync`, then |
| 208 | `sysctl vm.drop_caches=2`, then `sysctl vm.compact_memory=1` (see section 11 before using). |
| 209 | [cortex 13b21036-23ea-497f-956a-9b12f476ead4, 45a41b22-bf26-4013-848f-1c2fb21156a9] |
| 210 | 7. A gate inside the judge sat 83 minutes in `flock -x`; it re-opened the lock its own parent held; use physics |
| 211 | `tests/gb10_lock.sh` (walks ancestors), honour `AIEN_GB10_LOCK_HELD=1`; to unstick, kill only the waiting |
| 212 | flock, never the holder. [cortex f92b85a0-7c59-4ad6-b12f-14b9af1401f2] |
| 213 | 8. Server answers 503 "GPU lock held" forever while sweeps run; its non-blocking poll never wins against queued |
| 214 | flock(1) waiters; queued blocking acquire fixed the 27B door (2026-10-19). [cortex 53b7935d-e09a-404e-872b-bf92950945c1] |
| 215 | 9. Builds stall for 25 min behind a measurement; `quiet-measure flock /tmp/aien-gb10.lock CMD` took the quiet |
| 216 | lock first then queued for the chip; lock order is chip first, then quiet. The fix was recorded as not yet |
| 217 | installed. [cortex 7c23b9f3-1cf9-4ebe-a1ad-07da3d83c94c] |
| 218 | 10. Kernel refuses or misbehaves above 32 KiB shared memory; QMD word 36 was a constant; it is now written per |
| 219 | launch, code cap 65536 bytes. Treat any such constant as unproven until a chip gate has run above it. |
| 220 | [cortex e10e9c85-a431-4f9b-81cc-8089b1c247ac, omp-learn-6ef9994f2b45d5ef] |
| 221 | 11. Hand-written cubin rejected by `cuModuleLoadData` (error 200) on sm_121; it lacks the `.nv.capmerc` and |
| 222 | `.nv.merc.*` sections. [cortex omp-learn-73e93cda4e7f6b89, 2026-10-23] |
| 223 | 12. A "native" harness secretly linked libcuda (M16, failed audit); prove independence with `ldd`, `nm -u` and |
| 224 | `/proc/PID/maps`. [cortex 77d59ce6-40d7-4991-8e6a-f72cd34f2340] |
| 225 | 13. Outputs left unwritten after completion was signalled (about 1 in 2,800 launches, marked UNVERIFIED in the |
| 226 | record); a 200 ms host delay cut 781/6000 to 2/6000; full cause unresolved. [cortex a667cbb7-dd17-44f5-a7ce-085d3d3ab9f7] |
| 227 | 14. Power: on 2026-11-08 a sustained full-GPU load hit an 85 W hard stop 3 times in 5 min (peak 87 W); notes from that workload's authors say |
| 228 | some Sparks power off at sustained 88 to 92 W. Changing clocks (`nvidia-smi -lgc`) is Drake's call; the |
| 229 | standing brief was stock clocks and power limits only. [BOARD 2026-11-08T23:37:31Z, 2026-11-09T01:46:45Z] |
| 230 | 15. NVRM "Out of memory" retry lines without an Xid can appear in the kernel log on a run that still finishes |
| 231 | rc 0 with correct numbers. [BOARD 2026-11-14T19:33:26Z] |
| 232 | 16. A long job launched over ssh hangs; use `nohup setsid ... </dev/null >log 2>&1 &`. |
| 233 | [cortex omp-learn-0bcfaab846d0e636] |
| 234 | 17. Own-driver (`aien_gpu.ko`) Stage B stops immediately on a warm Spark (`mmio_us=230`, `polls=0,0,0,0`, |
| 235 | `gsp_mb0=0x80000000`) and reloading `nvidia.ko` then fails (`ksec2PollForCanSend_IMPL: Timed out waiting for |
| 236 | SEC2 command queue to be empty`, `0x110094=0xbadf4100`); unloading `nvidia.ko` leaves GSP suspended |
| 237 | (`LIBOS_INTERRUPT_PROCESSOR_SUSPENDED`), and SEC2 only cold-starts GSP once per reset; never hot-swap |
| 238 | `aien_gpu` onto a warm `nvidia`-booted Spark — own-driver GSP boot requires a cold boot with `nvidia` |
| 239 | blacklisted (Window 0) and explicit operator approval for the restart. Also stop `aien-run-spark-sensors.service` |
| 240 | beside `nvidia-persistenced` if unloading `nvidia*`, or `rmmod` returns `EBUSY`. |
| 241 | [BOARD 2026-11-18T23:08:51Z, 23:17:45Z, 23:18:38Z] |
| 242 | 18. Sysfs PCIe FLR (`echo 1 > /sys/bus/pci/devices/000f:01:00.0/reset`) drops SSH and forces a full SoC reboot |
| 243 | (~60 s) instead of resetting only the GPU; `PDB_PROP_GPU_TRIGGER_PCIE_FLR` is `GB10B`-only (`NV_FALSE` on |
| 244 | `GB20B`, `open-gpu-kernel-modules 580.173.02` `g_gpu_nvoc.c`); never use sysfs FLR as a non-reboot recovery or |
| 245 | hand-back step on the Spark. [BOARD 2026-11-18T23:17:45Z, 23:42:35Z] |
| 246 | 19. Driver patches, built `.ko` modules, staged GSP packages, and live logs disappear after a GPU swap/reboot; |
| 247 | they were staged under `/tmp`; always stage driver checkouts, built modules, firmware packages, `.om` binaries, |
| 248 | and checksum manifests in persistent storage and write live logs into `HANDOFFS` before any module swap or |
| 249 | reboot. [BOARD 2026-11-18T23:17:45Z] |
| 250 | 20. Cold-boot Stage B fails at `stage=7` (`polls=0,0,0,1`, `hwcfg2=0xbadf4100`, `gsp_mb0=0xbadf4100`) even with |
| 251 | `NO_NVIDIA_LOADED`; the driver used `GB10B` HALs (`SEC2 MAILBOX0` poll, `COTv1`, `GB10B` images, |
| 252 | `.fwsignature_gb10y`) on a `GB20B` die (`BOOT_42=0x1bba1000`), and step 8 mistook PRI target-mask lockdown |
| 253 | (`0xbadf4100`) for lockdown release; port every HAL to `GB20B` (see `./references/gb20b-gsp-boot.md`) before |
| 254 | spending a Window 0 reboot. [HANDOFFS/L332/window0-20261118T234217Z; BOARD 2026-11-18T23:44:02Z, 23:51Z] |
| 255 | |
| 256 | ## 8. What we do not use |
| 257 | |
| 258 | - No CUDA toolkit in our path: no CUDA C++, nvcc, cuBLAS/cuDNN, CUDA runtime (Drake, 2026-09-23). |
| 259 | [operator memory note `decision-leave-max.md`, `founding-principle-metal-first.md`] |
| 260 | - No new C/CUDA tools; new code is Omega (2026-10-24). [TEAM-MEMORY:4; RULES] |
| 261 | - No MAX for new model paths (2026-09-23). No Python as a structural part; Python is allowed for outside tools, |
| 262 | references and measuring instruments (2026-10-29). [`decision-leave-max.md`; RULES "Python boundary"] |
| 263 | - Still used, and say so: NVIDIA's open kernel modules 580.173.02 (nvidia, nvidia-uvm) and NVIDIA's signed GSP |
| 264 | firmware. "No CUDA" does not mean "no driver". Never claim "no NVIDIA code at all". |
| 265 | [cortex omp-learn-6ef9994f2b45d5ef, omp-learn-b654f9a92d110794; operator memory note `sovereignty-no-outside-deps.md`] |
| 266 | - Own kernel driver work (L332 / `aien-gpu`) as of 2026-11-18: Stage A (`aien_gpu.ko` PCI bind, `BOOT_0=0x1bb000a1`, |
| 267 | `BOOT_42=0x1bba1000`, 7-unit Omega self-test, firmware hash check) and pure-`.om` `doctor` passed on live Spark |
| 268 | silicon (`HANDOFFS/L332/window0-20261118T234217Z`), while Stage B (`GB20B` SEC2/GSP boot) and Stage C remain |
| 269 | `HOST_TESTED` + `QEMU` (`hardware=NOT_RUN` pending a reviewed Window 0 cold boot). |
| 270 | - NVIDIA user-space CUDA appears only as the comparison arm in head-to-heads. [`HANDOFFS/H2H9B/PROTOCOL.md`] |
| 271 | |
| 272 | ## 9. Where evidence goes |
| 273 | |
| 274 | - Windows: `YARDSTICKS/windows/<id>/open.json`, `close.json`. Receipts: `YARDSTICKS/receipts/`. |
| 275 | - Numbers: `aien-calc eval "<expr>"` (cite `calc:<id>`); `aien-calc export` copies a receipt next to evidence. |
| 276 | - Facts others need: one BOARD line; lasting facts one line in `HANDOFFS/TEAM-MEMORY.md`; progress in the ledger |
| 277 | (`ledger note ID "TEXT"`, `ledger done ID "EVIDENCE"`). |
| 278 | - Lessons: Cortex `aien-lessons` (Symptom / Root cause / Fix / Verified). Hardware investigations follow the |
| 279 | `investigate` skill. [RULES] |
| 280 | |
| 281 | ## 10. What needs Drake |
| 282 | |
| 283 | - Swapping the model that serves on MODEL_PORT, or changing a harness. [RULES "Harness lock"] |
| 284 | - Changing GPU clocks or power limits. [BOARD 2026-11-09T00:28:25Z] |
| 285 | - Unbinding the GPU from nvidia.ko, a VFIO bind, or any device write outside the driver (stops every GPU user; |
| 286 | recorded as needing Drake's go). Rebooting the Spark or booting it natively. The signed boot chain is never |
| 287 | written. Stopping another lane's job is not approval to restart the Spark, and sysfs PCIe FLR on `000f:01:00.0` |
| 288 | reboots the whole SoC (trap 18): both require Drake's explicit go for a planned restart. |
| 289 | [cortex omp-learn-b654f9a92d110794, omp-learn-8e437914757898e2; BOARD 2026-11-18T23:18:38Z; operator memory note `aienos-native-boot-status.md`] |
| 290 | - Re-enabling any model service at boot. [`HANDOFFS/RULE-spark-no-idle-models.md`] |
| 291 | - Not Drake: using an idle chip, stopping the idle shared model under a board claim. [RULES] |
| 292 | |
| 293 | ## 11. Where the records disagree or are unconfirmed |
| 294 | |
| 295 | - Chip name: bare-metal `GPUID.TXT` (2026-11-12) and live `aien_gpu.ko` Stage A (2026-11-18) both confirmed |
| 296 | `BOOT_0=0x1bb000a1`, `BOOT_42=0x1bba1000` (`GB20B`, arch `0x1B`, impl `0xB`; `g_hal_archimpl.h:96`). Driver boot |
| 297 | HALs must target `GB20B`, not `GB10B` (section 13). Whether NVIDIA UVM's GB10B sticky-L2 quirk applies remains |
| 298 | INFERRED, not measured (L1267); the cache traps in section 7 were measured on this chip either way. |
| 299 | - Which lock the MODEL_PORT server holds: chip-watchdog's header says the live server uses its own lock, and older |
| 300 | start recipes set `AIEN_SERVE_GPU_LOCK=/tmp/aien-serve-MODEL_PORT.lock`; the motor-revival unit does not set it, and |
| 301 | on 2026-11-15T01:54Z the server held `/tmp/aien-gb10.lock` exclusively. Whether the watchdog would kill an |
| 302 | idle server holding that lock was not confirmed. |
| 303 | - Is the 35B retired? `q36-extra` says the 35B was retired by Drake on 2026-11-06 and MODEL_PORT is reserved for the |
| 304 | own Omega LLM; the board shows the 35B started on MODEL_PORT by motor-revival through 2026-11-15. |
| 305 | - How the model is started may change: a lane is moving user units from systemd to `aien-supervise` |
| 306 | (BOARD 2026-11-15T01:52Z). Check the board before trusting the `systemctl` commands in section 4. |
| 307 | - `drop_caches`: the coordinator allowed only `=1`, "never 2 or 3" (BOARD 2026-11-10T13:20:13Z); two days later |
| 308 | only `=2` cleared the fragmentation (BOARD 2026-11-12T03:30:05Z). No later ruling found. Post on the board first. |
| 309 | - Bandwidth ceiling: TEAM-MEMORY:9 computes ceilings at 273 GB/s; the 2026-10-25 measurement says use 236.9. |
| 310 | - Max SM clock: one research brief quotes 3003 MHz from nvidia-smi (cortex bf03fc8c-0ece-40ab-baeb-c3caeaecc234); |
| 311 | observed under load were 2548 and 2444 MHz. |
| 312 | - Shared memory per SM: 100 KiB carvable (measured), "99 KB" in L293, code cap 65536 bytes. |
| 313 | - Server memory while serving: about 47 GB resident (2026-10-25), 56089 MiB by nvidia-smi (2026-11-15), about |
| 314 | 62 GB RSS for the earlier 30B (2026-10-31). Different builds and context sizes; measure, do not assume. |
| 315 | - Not found in the records searched: a written list of everything that invalidates a timing; a documented power |
| 316 | limit for this unit; a tool named `motor-revival` (it is a unit name and a ledger owner, not a command); |
| 317 | any `LESSON-*.md` about the GPU (the only one is the harness wipe). |
| 318 | |
| 319 | ## 12. NVIDIA's own documentation (fetch it, never recall it) |
| 320 | |
| 321 | Do not answer a vendor question from memory. Fetch the current page through Context7 (MCP server `context7`; |
| 322 | without the tools: `curl -G https://context7.com/api/v1/<id> --data-urlencode type=txt --data-urlencode topic=...`) |
| 323 | and quote the source URL. Library ids checked 2026-11-14: |
| 324 | - `/websites/nvidia_dgx_dgx-spark` (docs.nvidia.com/dgx/dgx-spark: user guide, known issues, updates, recovery) |
| 325 | - `/nvidia/open-gpu-kernel-modules` (the driver source we run; ioctl, UVM and error notes) |
| 326 | - `/websites/build_nvidia_spark` (NVIDIA's Spark playbooks; all CUDA-stack, comparison arm only) |
| 327 | The offline copies in `DOCS` (section 1) and the docs-read hook (section 2) still apply on the Spark. |
| 328 | |
| 329 | What those pages say that matters here (fetched 2026-11-14, each from the URL named): |
| 330 | - Memory reporting on this unified-memory machine is a documented known issue. NVIDIA publishes a C routine that |
| 331 | estimates allocatable memory from `/proc/meminfo`: MemAvailable plus free swap, adjusted for hugetlbfs pages, |
| 332 | which cannot be swapped. [docs.nvidia.com/dgx/dgx-spark/known-issues.html] This Spark has no swap (0 B, read |
| 333 | 2026-11-14), and our own records add that mapped model pages must be subtracted (section 5). |
| 334 | - NVIDIA's documented workaround for memory-reporting problems is `sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'` |
| 335 | and then restarting the application. [same page] This is a third position beside the two in section 11 |
| 336 | ("=1 only" and "=2 worked"). It drops caches for every lane on the machine: post on the board first. |
| 337 | - Update path: `sudo apt update && sudo apt dist-upgrade`, `sudo fwupdmgr refresh`, `sudo fwupdmgr upgrade`, |
| 338 | reboot. [docs.nvidia.com/dgx/dgx-spark/os-and-component-update.html] An update can change the driver |
| 339 | (580.173.02 on 2026-11-15) and firmware under every measurement, and it reboots the machine: needs Drake. |
| 340 | - Firmware setup for Secure Boot changes is reached with `sudo systemctl reboot --firmware-setup`. |
| 341 | [docs.nvidia.com/dgx/dgx-spark/dgx-spark.pdf] Secure Boot state is tied to the native-boot work: needs Drake. |
| 342 | - Device nodes: `ls /dev/nvidia*` is NVIDIA's first check when the GPU is not reachable. [same PDF] |
| 343 | - NVIDIA's container examples for this machine use CUDA 13 images (`nvcr.io/nvidia/cuda:13.0.1-devel-ubuntu24.04`). |
| 344 | [docs.nvidia.com/dgx/dgx-spark/ngc.html] For us that is the comparison arm only (section 8). |
| 345 | - Driver recovery in the open-module notes is unload and reload: `rmmod nvidia_uvm nvidia_drm nvidia`, then |
| 346 | `modprobe nvidia`, `modprobe nvidia_uvm`. [github.com/nvidia/open-gpu-kernel-modules, _autodocs/errors.md] |
| 347 | That stops every GPU user on the Spark: Drake's go, a board line first, and never under a resident seat (trap 5). |
| 348 | - The user-space control interface named there: `NV_ESC_CARD_INFO`, `NV_ESC_REGISTER_FD`, `NV_ESC_ALLOC_OS_EVENT`, |
| 349 | `NV_ESC_CHECK_VERSION_STR`, `NV_ESC_IOCTL_XFER_CMD`, `NV_ESC_EXPORT_TO_DMABUF_FD`, `NV_ESC_WAIT_OPEN_COMPLETE` |
| 350 | on `/dev/nvidia0`. [same repo, _autodocs/QUICK_REFERENCE.md] The `_autodocs` pages are generated summaries; |
| 351 | for anything our driver code depends on, read the header in the pinned source instead. |
| 352 | |
| 353 | ## 13. Own-driver (aien-gpu) GB20B boot checklist |
| 354 | |
| 355 | Before editing `aien-gpu` or scheduling a Window 0 cold boot on the Spark, read |
| 356 | [gb20b-gsp-boot.md](./references/gb20b-gsp-boot.md). For the 4x-verified bit-for-bit structure of |
| 357 | `gsp_ga10x.bin` (`580.173.02`) and firmware study hygiene rules (`0700` local-only, zero repo contamination), |
| 358 | read [gsp-firmware-580-173-02.md](./references/gsp-firmware-580-173-02.md). Summary: |
| 359 | |
| 360 | - **Check prior work first:** prior pure-Omega GB20B SEC2/COTv2 work (`ogd-qual-gsp` / `omega-gpu-driver` |
| 361 | `GB20B.md`) and `HANDOFFS/L332/` receipts already document the `580.173.02` HAL bindings; do not port from |
| 362 | `GB10B` scratch assumptions. |
| 363 | - **Cold boot only (Window 0):** never hot-swap `aien_gpu` after `nvidia.ko` (trap 17) and never issue sysfs FLR |
| 364 | on `000f:01:00.0` (trap 18). Stage all artifacts and checksums outside `/tmp` (trap 19); `spark-window` state |
| 365 | resets across a reboot, so reclaim/track it on the board and remove any one-boot `nvidia` blacklist before the |
| 366 | restore reboot (`BOARD 2026-11-18T23:42:35Z`). |
| 367 | - **Verify all GB20B HALs + ABI + mutants before spending a reboot:** `.fwsignature_gb20y`, `GspRmBoot_GB20B` |
| 368 | (`monCodeOff=0xf000`), `GspRmFmcGfwProdSigned_GB20B`, FWSEC `0x5e0==0xFF`, `COTv2` (`860 B`, `FRTS=0`), SEC2 |
| 369 | `MSGQ` (`0x840c80/84`, `TAIL` before `HEAD` ack), Stage C bit-30 `RUNLIST_DOORBELL_ENABLE` (`| 0x40000000`), |
| 370 | backwards-compatible `AGPU_ABI_VERSION=1` (version sub-blocks instead), `_Static_assert` wire layouts, and full |
| 371 | fresh-clone + QEMU + mutation gates. |
| 372 |