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
CUDApp / docs / speculation / NATIVE-DEVICE.md
| 1 | # Native GPU connection |
| 2 | |
| 3 | `native/nvrm/context.om` continues the canonical NVRM lifecycle from |
| 4 | `349913f17c083996680c72b32f767b225005155d` in seeded Omega. It uses the |
| 5 | NVIDIA580.173.02 public ABI definitions already retained with their notices in |
| 6 | this repository. No C or Rust runtime helper is linked or executed. |
| 7 | |
| 8 | The compiler extension is in Omega PR676. It adds scoped RM parameter binding, |
| 9 | an exact UVM request allowlist, owned memory addresses, ordered mapped words, |
| 10 | unused low-address reservations and binding limited to those reservations. |
| 11 | The source-born compiler has no foreign compiler, assembler or linker in its |
| 12 | construction chain. Independent GCC header-layout and GNU assembler encoding |
| 13 | oracles were used during development; shell and Node coordinated checks. |
| 14 | |
| 15 | The physical probes cover private RM/UVM context creation, a GPU address space, |
| 16 | coherent system-memory objects, their CPU and GPU mappings, an uncached queue, |
| 17 | the compute channel, a mapped notification page, submission and bounded waiting. |
| 18 | `nvstart` queries the device, `nvfull` attaches UVM, `nvalloc` returns an owned |
| 19 | mapping, `nvchan` creates an empty channel, `nvsend` submits one packet and |
| 20 | `nvwait` observes its completion. `nvdrop` releases an allocation and `nvstop` |
| 21 | tears down the entire context. Failed operations retain stage/error information. |
| 22 | |
| 23 | There is one outstanding packet at a time. Pending work prevents buffer release |
| 24 | and another submission. A missed completion latches a fault; further submission |
| 25 | and context reuse are refused. Partial allocation state remains recorded until |
| 26 | cleanup. The table has96 live allocation slots; the compiler has128 mapping |
| 27 | slots. These are bounded runtime resources, not model-sized allocation arenas. |
| 28 | |
| 29 | Teardown has three explicit phases: closed, driver resources live, and |
| 30 | descriptors closed with CPU mapping cleanup pending. A failed unmap retains its |
| 31 | mapping handle. A later `nvstop` retries only those mappings; it does not repeat |
| 32 | RM/UVM operations or descriptor closes. The context fault stays latched even |
| 33 | after cleanup succeeds. The [host refusal fixture](TEARDOWN-HOST.md) checks this |
| 34 | contract with substituted OS effects. Its native compilation and execution |
| 35 | remain NOT_RUN until replayed with the pinned compiler on Linux AArch64; the |
| 36 | earlier physical receipts do not qualify this source change. |
| 37 | |
| 38 | GPU buffers first reserve unused page-aligned CPU addresses below1TiB. File |
| 39 | binding can replace only that owned reservation. The same address is serialized |
| 40 | into the GPU mappings. This matters because a command entry's address field is |
| 41 | 40bits; ordinary Linux-selected CPU addresses can exceed it. The existing |
| 42 | canonical GP entry word, including its level bit, is retained. No other runtime |
| 43 | or shared compiler tree was modified. |
| 44 | |
| 45 | The driver reports the GB10 SM identifier as2564, matching the repository's |
| 46 | historical M16 receipt. That field uses a different numbering contract from the |
| 47 | CUDA target name. An initial test incorrectly expected3073 and was corrected. |
| 48 | Its initial negative-value diagnostic also required correction. Both failures |
| 49 | are retained locally. A UVM attempt launched before scheduling confirmation is |
| 50 | excluded from qualified evidence; subsequent probes required confirmed admission. |
| 51 | |
| 52 | | Physical check | Result | |
| 53 | | --- | --- | |
| 54 | | Device and private address-space lifecycle | Three complete cycles per probe passed. | |
| 55 | | Buffer lifecycle | Twelve buffers over three contexts; full written-byte comparison, explicit release and context-owned cleanup passed. | |
| 56 | | Empty channel lifecycle | Three cycles passed, including refusal to free its active queue. | |
| 57 | | FIFO submission | 2,052 distinct completion payloads passed across two contexts, including ring wrap. A deliberately wrong expected payload timed out and latched the fault. | |
| 58 | |
| 59 | These are correctness probes under shared hardware admission. The FIFO test |
| 60 | executes semaphore commands. The subsequent [native kernel qualification](NATIVE-KERNEL.md) |
| 61 | separately covers integer vector arithmetic. There is no model inference, |
| 62 | AIENOS endpoint integration or timing comparison in this device evidence. |
| 63 | Full-state rollback, all four experiment arms and issues63-66 |
| 64 | remain open. Cleanup refusal injection and independent final-source review remain |
| 65 | required alongside the next kernel/model stages. |
| 66 | |
| 67 | To build a probe, concatenate `native/nvrm/context.om` with the selected |
| 68 | `tests/speculation/native-{device,memory,channel,submit}-test.om`, compile it with |
| 69 | the pinned native compiler and run only in an admitted hardware window. Current |
| 70 | source/artifact identities and bounded results are in `evidence/speculation/native-device`. |