interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / native / gsp / README.md

148 lines · 8264 bytes Raw Blame History Source

WARNING: This can and may permanently damage your system. No warranty of any kind. Do not use it unless you are a professional lab that is prepared to lose the hardware.

native/gsp: GSP firmware container parser (read-only)

This directory holds read-only research into the GPU boot chain. fwimage.om reads one firmware file and writes a text report. It never opens a device, maps a BAR, writes to a device or runs anything on one.

On Drake's DGX Spark the signed boot chain is never modified: UEFI and platform firmware, NVIDIA-signed GSP/booter/FMC firmware, VBIOS and fuses. A future first-party driver may only load NVIDIA's signed firmware unmodified, as nouveau and nova do. Replacing the boot chain is future work, and only if a dedicated, sponsored DGX Spark exists for it.

Files

PathRole
native/gsp/fwimage.omSeeded Omega (OM-2) parser. It is compiled together with omega-mv om/tls/sha2.om (SHA-256).
tests/gsp/run-fwimage-host.shHost runner: pins, compile, oracle comparison, negative controls.
tests/gsp/expected-580.173.02.txtExpected report, generated with readelf -SW, dd and sha256sum only.

Build and run, with the pinned omc from omega-mv 369dbc96daa1684db2d7c2c7085bbf16b3fd77ee (seed/out/omc sha256 2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f):

cat native/gsp/fwimage.om "$OMEGA_MV/om/tls/sha2.om" | "$OMEGA_MV/seed/out/omc" > /tmp/fwimage
chmod 700 /tmp/fwimage
/tmp/fwimage /lib/firmware/nvidia/580.173.02/gsp_ga10x.bin gb20y
tests/gsp/run-fwimage-host.sh "$OMEGA_MV/seed/out/omc" /lib/firmware/nvidia/580.173.02/gsp_ga10x.bin

The runner refuses (exit 69) unless the omc, sha2.om (5cf0f981…6fdb33) and the firmware (32cb7cf3…d963) match their pins. It prints FWIMAGE PASS only when every check below holds:

  1. The committed expectation equals a fresh readelf/dd/sha256sum reference.
  2. The fwimage output equals that expectation, with no family, with gb20y and with gb10y.
  3. An expectation with one altered digest digit is rejected (a negative control on the checker itself).
  4. The C oracle ck_gsp_fw_inspect.c from lane L332 agrees on the lines both tools print. The runner builds it into its temporary directory, and it is used only as a verification oracle.
  5. Six mutated inputs are refused, each with its documented code: truncated to 1000 bytes (12), ELF magic byte changed (10), .fwversion sh_offset past end of file (14), .fwversion renamed (16), a duplicate section name (18), and an unknown family (17).

Report and exit codes

SECTION <name> off=<hex> size=<hex>     every section header after index 0, in table order
FWVERSION <text>
SHA256 <name> <hex>                     .fwimage and every .fwsignature_* section, in table order
SELECT family=<f> image_off=<hex> image_size=<hex> sig_section=.fwsignature_<f> sig_sha256=<hex>

All checks run before any output, so a refusal prints only FWIMAGE REFUSE <reason> on stderr.

ExitMeaning
0report written
2usage
3I/O: open, seek, short read or stdout write failed
10not ELF (magic)
11not ELF64 / little-endian / version 1 / RISC-V (e_machine 243)
12truncated: file shorter than 64 bytes, or the section header table passes end of file
13malformed header: e_ehsize or e_shentsize not 64, e_shnum 0, e_shstrndx 0 or ≥ e_shnum, name table not SHT_STRTAB or empty
14section or name out of bounds (offset + size > file size, overflow-checked; name outside the table; table not zero-terminated)
15missing .fwimage
16missing .fwversion
17unknown family (only gb20y, gb10y)
18duplicate section names
19capacity: more than 1024 sections or a name table above 64 KiB
20selected .fwsignature_<family> absent
21.fwimage or a .fwsignature_* section is SHT_NOBITS or empty
22.fwversion malformed: size 0 or above 63, no final zero byte, or a non-printable byte
100+nOmega runtime trap n (none expected)

Container format, as the 580.173.02 driver reads it

Citations are paths under open-gpu-kernel-modules 580.173.02 (git 20e4e6e19cc26ba47b5cbe23130a396be100c427).

Measured on /lib/firmware/nvidia/580.173.02/gsp_ga10x.bin (75,012,080 bytes) with readelf -SW:

Where fwimage.om is stricter than the driver:

CheckDriverfwimage.om
e_shstrndx boundaccepts shstrndx == shnum (:5127), which indexes one past the tablerequires 0 < shstrndx < shnum
duplicate section namesbackward scan, so the last header with a name winsrefuses (18)
e_machine (243) and e_versionnot checkedchecked

Chip identity: gb20y or gb10y (unresolved)

The family string picks the signature section, so a wrong family selects the wrong signature. Family selection (src/nvidia/arch/nvalloc/common/inc/nv-firmware-chip-family-select.h):

ChipArchitectureImplementationFamilySource
GB10BGB1XX = 0x1A0 (src/common/inc/swref/published/nv_arch.h:51)0x0B (:111)gb10ynv-firmware-chip-family-select.h:58-62
GB20BGB2XX = 0x1B0 (nv_arch.h:53)≥ GB20B = 0x0B (:127)gb20ynv-firmware-chip-family-select.h:64-68

Lane L332 assumed GB10B (gb10y). Lead evidence points to GB20B (gb20y):

Only a PMC_BOOT_42 read during an authorized window settles it; that read is not run. Until then the parser and runner treat both families and report both selections.

The two signature digests differ:

FamilySignature digest
gb20y6d38023b…f9a1
gb10y08541c3a…8f2d