omega-gpu-driver
aien-dev/omega-gpu-driver
Brought by drakestapleton
omega-gpu-driver / GB20B.md
| 1 | # GB20B source-selected SEC2 candidate |
| 2 | |
| 3 | Status: IMPLEMENTED, host simulator EXERCISED only. Physical W0, firmware boot, RPC, |
| 4 | resources, queues and compute on the Spark remain NOT_RUN in this qualification. |
| 5 | No merge, deployment, service stop, VFIO bind/open, reset or BAR access is authorized here. |
| 6 | |
| 7 | ## Authorities and deliberate oracle correction |
| 8 | |
| 9 | NVIDIA open-gpu-kernel-modules tag 580.173.02, exact revision |
| 10 | `20e4e6e19cc26ba47b5cbe23130a396be100c427`, is the vendor authority. The physics |
| 11 | third_party copy is pruned; qualification used an unmodified full checkout of that revision. |
| 12 | `src/nvidia/generated/g_kernel_sec2_nvoc.c:674-804` selects different preparation, |
| 13 | MCTP-header and send/receive HALs for GB10B and GB20B. It shares the low-level command |
| 14 | queue send implementation. The generated GSP HAL selects GB20B boot and production |
| 15 | FMC archives at `g_kernel_gsp_nvoc.c:792-795,928-930`; WPR metadata remains GB10B's |
| 16 | implementation at lines 986-989. Do not substitute the GB10B archives. |
| 17 | |
| 18 | The C reference moved deliberately from aienux `c5bb3a4b9898257658aba0b7178a3c73a0371c27` |
| 19 | to #463 `a108b1144a064aa7b824374a622d627c6ba91fd1`. Both the former C reference and |
| 20 | Omega encoded GB10B MCTP SOM|EOM as 0xc0000000. The vendor GB10B HAL |
| 21 | `ksec2CreateMctpHeader_539ab4` actually returns 1. The corrected C arena and simulator |
| 22 | are the independent oracle; arena and RPC gates pin the same complete reference revision. |
| 23 | `mutants-arena.sh` reinstates the old value and requires an exact-byte parity failure. |
| 24 | This is an oracle correction, not evidence the previous common-mode comparison was correct. |
| 25 | |
| 26 | ## Distinct profile, not a relaxed GB10 gate |
| 27 | |
| 28 | | Property | GB10B | GB20B | |
| 29 | |---|---|---| |
| 30 | | BOOT_42 architecture / implementation | 0x1a / 0xb | 0x1b / 0xb | |
| 31 | | signed ELF family | gb10y | gb20y | |
| 32 | | boot / FMC generated archive suffix | GB10B | GB20B | |
| 33 | | MCTP first word for single COT | 1 | 0xc0000000 (SOM, EOM, SEID=SEQ=0) | |
| 34 | | COT version / packed payload bytes | 1 / 860 | 2 / 860 | |
| 35 | | FRTS sysmem size | FMC image bytes (GB10B HAL quirk) | zero | |
| 36 | | prerequisite | existing GB10B flow | FWSEC scratch 0x5e0 == 0xff | |
| 37 | | send completion | SEC2 busy mailbox consumed | MSGQ response, SEC2_RESPONSE 0x15, command COT 0x14, FSP_OK | |
| 38 | |
| 39 | `gsp/profile.om:gpclass` classifies the second profile separately. `gpchip` and the |
| 40 | existing mapped transport admission remain GB10B-only: GB20B classification does not |
| 41 | admit GB10B system-info records or a GB10B package. No actual BOOT_42 has been measured. |
| 42 | |
| 43 | `gsp/arena.om` now composes either profile. For profile 2, `arpkg[0..3)` must each be |
| 44 | 2 (gb20y signed-image family, GB20B boot archive, GB20B FMC archive respectively). |
| 45 | Boot code/data/manifest offsets must be inside the supplied boot image; GB10B fixed |
| 46 | sizes are not applied to GB20B. Common WPR/FMC-args layout follows the generated shared |
| 47 | WPR HAL. The selected FMC and its 48-byte hash, 384-byte key and 384-byte signature |
| 48 | are copied to the bounded aligned arena. COT v2 leaves every FRTS field zero. |
| 49 | These profile assertions describe the caller's checked extraction, NOT cryptographic |
| 50 | verification. `fwprep FWFILE OGKMSRC OUTDIR gb20b` prepares this profile offline. |
| 51 | It selects the gb20y signature and both GB20B production archives, checks the SHA-256 of |
| 52 | all three complete inputs against the vendor pins, then creates a fresh output directory and publishes the boot image and FMC |
| 53 | inputs. It writes `fw.gb20b.manifest` last. An existing output directory is refused. The default |
| 54 | three-argument invocation prepares the historical GB10B profile. The board identity |
| 55 | and the physical launch still require hardware qualification. |
| 56 | |
| 57 | `gsp/sec2.om:s2boot` takes actual BOOT_42 plus explicit profile/package and refuses a |
| 58 | mismatch before register access. It requires silicon, SEC2 present and FMC enabled; |
| 59 | waits for FWSEC secure boot; sends the complete 868-byte single packet on command |
| 60 | queue 0; waits on MSGQ rather than GB10B's mailbox; reads bounded response EMEM with |
| 61 | AINCR; verifies pointer progress, acknowledges tail before head, checks vendor/type, |
| 62 | COT command and error; then runs the shared GSP mask/lockdown/FMC/CPU-active completion. |
| 63 | Source: `kernel_sec2_gb20b.c:280-536,547-549,962-1085`, `kernel_sec2.c:250-593`, |
| 64 | `sec2_mctp_format.h:34-53`, `nvdm_payload_cmd_response.h` and `kern_fsp_cot_payload.h`. |
| 65 | Unsupported fragmented responses, malformed sizes and nonzero firmware errors refuse. |
| 66 | Task ID is captured, not interpreted as a GSP RPC sequence number. |
| 67 | |
| 68 | The vendor secure-boot deadline is max(scaled four seconds, default GPU timeout). |
| 69 | This library receives finite poll budgets; a native caller must implement that timer |
| 70 | policy with its own monotonic clock and approved pause. No production timing or reset |
| 71 | policy is asserted by a synthetic check-count simulation. Warm/resume, confidential |
| 72 | compute and firmware debug variants are not implemented by this cold-production path. |
| 73 | |
| 74 | ## Full-size host image |
| 75 | |
| 76 | `tests/arena_large.sh FIRMWARE VERIFIED_GB20B_PACKAGE` compiles the native composer and reads the real |
| 77 | inputs from the signed-firmware package. The test stages 76,496,896 bytes in an anonymous host mapping. |
| 78 | It checks all 74,969,088 firmware bytes, 18,303 leaf pages and their parent pointers, the bootloader, |
| 79 | both signatures, the FMC and its key and digest. The test fixture supplies model addresses and system |
| 80 | parameters. The finite byte model in `tests/arena_bytes.lean` proves the upper bank fits, a byte write |
| 81 | round-trips and the other bytes in its word are preserved. |
| 82 | |
| 83 | The host composer admits 80 MiB. The existing owned device-window policy in `chan/gmmu.om` admits |
| 84 | 8 MiB. Physical transport, real device addresses, cache visibility and firmware launch still need |
| 85 | hardware qualification. |
| 86 | |
| 87 | ## Composed launcher and native effect seam |
| 88 | |
| 89 | `build.sh` builds `build/w0`, `build/fwprep` and the model-only `build/ogd`. The latter |
| 90 | accepts `model` and `model-trace` and refuses a physical launch with exit 95. Host units cover |
| 91 | protocol building, modeled boot/RPC, resource records and queue/completion ownership; |
| 92 | their passing tests do not create a launcher. `gsp/dispatch.om` still refuses hardware. |
| 93 | `chan/dma.om` and `gsp/mmio.om` target Linux VFIO/map handles, NOT native Aienux capabilities. |
| 94 | |
| 95 | The missing native seam is concrete: load/relocate/link the .om unit to a kernel ABI; |
| 96 | provide non-forgeable profile-bound PCI/MMIO, SMMU-owned DMA-window and IRQ capabilities; |
| 97 | keep CPU VA, IOVA and GPU VA distinct; enforce ordered publish/MMIO/cache visibility; |
| 98 | submit a GPU store and engine/system visibility fence; observe uncached completion; |
| 99 | then prove engine quiescence or bus-master-off before SMMU abort/unmap/reclaim. Current |
| 100 | published/quarantined windows intentionally cannot be reclaimed. A Linux invalid-fd |
| 101 | or anonymous-memory test is not this seam. Neither this SEC2 candidate nor a BOOT_42 |
| 102 | read establishes GPU-initiated DMA containment or compute. |
| 103 | |
| 104 | ## Minimal W0 identity authorization request (not execution) |
| 105 | |
| 106 | Request only one `build/w0 000f:01:00.0 20` invocation, no optional HEXOFF, after an |
| 107 | exclusive approved window and a fresh boot with NVIDIA held back. It reads PCI config |
| 108 | and BOOT_0/1/42 through pread and read-only BAR mapping and compares both views. |
| 109 | **Opening VFIO can implicitly FLR the GPU; closing/releasing it can SBR its parent |
| 110 | 000f:00:00.0. Read-only register intent is NOT reset-free.** Empty reset_method does |
| 111 | not prevent release SBR. This cannot run beside the resident service on 18091. |
| 112 | |
| 113 | Before authorization, parent must recheck current BDF, singleton IOMMU group, privileges, |
| 114 | pinned w0/compiler and restore recipe; obtain a current spark-window/quietlock reservation |
| 115 | and Drake's explicit approval for service stop, two reboots, VFIO bind/open and FLR/SBR. |
| 116 | The existing recovery stick is read-only: serial 5D0344B4, PARTUUID |
| 117 | f227357c-1e80-4fd0-a55e-2efbef1dd25c, current firmware Boot0002. Its historical attended |
| 118 | recovery proof is 2026-09-25, NOT a recovery boot today. Never overwrite it. See the |
| 119 | parent's `recovery-stick-readonly-20261028.md`; a candidate image needs a separate medium. |
| 120 | |
| 121 | Exact proposed existing-script procedure, only after those authorizations: |
| 122 | |
| 123 | 1. Freeze and hash this checkout and binaries. `test ! -e build/ogd` is REQUIRED. |
| 124 | Run `sh window/d2-pre.sh` (preflight only). The parent verifies it records the exact |
| 125 | resident process argv/cwd/environment/coordinator restore key and no other GPU users. |
| 126 | This must not be inferred from a stale receipt. Do not use `--go` before approval. |
| 127 | 2. Parent records Drake's exact approved window in |
| 128 | `/home/drakestapleton/handoffs/OwnDriver/window/APPROVED` using the existing three |
| 129 | lines (`window: ...`, `reset: approved`, `reboot: approved`). Then from this frozen |
| 130 | checkout: `sh window/d2-pre.sh --go D2`. Here D2 is only the existing recovery runner: |
| 131 | **no ogd may exist or be introduced until the window closes**. No boot/hello/exec |
| 132 | invocation is authorized. Do not replace it with a firmware-boot test. |
| 133 | 3. W1 takes the chip lock, stops the process serving 18091, waits for no compute apps, |
| 134 | records sysctls, installs temporary NVIDIA hold-back and recovery unit, and reboots. |
| 135 | W2 sets restore state/removes hold-back FIRST, checks no NVIDIA modules, binds VFIO |
| 136 | and requires root:root:0600. W3 requires runtime-active and executes precisely |
| 137 | `sudo -n build/w0 000f:01:00.0 20`. Expected: config identity plus BOOT_0/1/42, |
| 138 | successful pread/map comparison, exit 0. Record actual BOOT_42; do not manufacture |
| 139 | an expected hexadecimal value from NVIDIA marketing or Linux RM chip naming. |
| 140 | 4. With ogd absent, the runner MUST log boot and hello NOT_RUN, then unbind VFIO |
| 141 | (possible SBR), clear override/PM, and reboot to the NVIDIA-enabled normal boot. |
| 142 | R loads/rebinds NVIDIA, restores saved sysctls and the exact recorded resident |
| 143 | launch recipe, waits for 18091 `/v1/models`, checks one greedy chat and exactly |
| 144 | one resident GPU process, removes the temporary unit and checks privileges. |
| 145 | 5. Any failure follows W7/R, not a retrying GPU probe. The runner has one reboot |
| 146 | fallback. If restore still fails, stop and require Drake's physical power-cycle / |
| 147 | attended recovery procedure. Preserve logs. W0 identity success is not firmware, |
| 148 | RPC, DMA or compute qualification. Firmware loading stays NOT_RUN. |
| 149 | |
| 150 | The D2 label does not grant additional authority: if `build/ogd` exists, this procedure |
| 151 | REFUSES before starting; a W0-only stage would be needed before authorizing that tree. |
| 152 | The live 18091 must remain untouched until the parent relays exact current approval. |