Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/tree/main/examples/hello_gpu # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / examples / hello_gpu` `d4b50f2` Merge Radicle main `95544128` into integ/omega-cuda-stack `331dba84` Drake Stapleton committed 2026-11-10 ``` .. README.md 6107 hello_gpu.c 33972 ``` README.md # hello_gpu: seeded host planning and checking The default executable uses `om/graph/hello.om` for input construction and whole-output checking, and `hello-plan.om` for scoreboard controls, chunk sizes, launch dimensions, byte counts, bandwidth reporting and simulator fault planning. `CUDAPP_MIGRATION_PENDING_HELLO_HOST=1` selects the C differential oracle only. It is OFF by default. The existing HELLO_CONTROL switch enables the intentional short-launch negative control; it does not select the C host oracle. C retains the IR instruction emission, register-allocation API calls, command-line and diagnostic I/O, clock acquisition, allocations, simulator invocation, device session and launches. No GPU launcher was moved into Omega. A result is checked on the host, but the checker is first-party seeded Omega, not handwritten C. Input values are finite binary32; the differential compares their bits exactly. The poison sentinel is counted separately from wrong answers. ## Host acceptance Every execution, including simulator, differential and mutant children, must run inside the device-hiding wrapper: ``` bwrap --dev-bind / / --dev /dev --proc /proc -- \ taskset -c 10-14 nice -n 10 make -j3 \ test-graph-residue test-graph-residue-mutants test-graph-residue-coverage \ test-hello-sim ``` Set `OMEGA_OMC` and `OMEGA_BRIDGE` to the pins required by `om/units.sh` when running the mutant gate. The coverage gate compiles its C oracles with `-O0 --coverage -ffp-contract=off`. It also runs the actual oracle executable's simulator path, plus past-end and short negative controls. Those controls must exit 1, not merely any nonzero status. `test-graph-residue` compares deterministic phase digests and diagnostics against the oracle and requires a deliberately changed result to disagree. The mutant gate compiles each changed `.om` unit; compile refusal is not counted as a killed mutant. ## D8: the process-tax line `hello_gpu` prints one overhead line (developer bar D8, `docs/issues/D8-process-tax.md`). On the GPU path it reads its resident memory (`VmRSS` in `/proc/self/status`) before the open, after the open and with its buffers allocated, its own buffer bytes, and what the session asked the driver for: ``` overhead (D8): resident B KiB before open, O KiB after open, W KiB with buffers; own buffers N KiB; session driver allocations S KiB in K; open cost ±X KiB, beyond own buffers ±Y KiB ``` `--sim` prints the same line without the open: `overhead (D8, simulator, no device opened): …`. The KiB rounding and the signed differences come from `hello-plan.om` mode 5. `test-graph-residue` checks mode 5 against the C oracle, and three mutants (`tests/d8_mutants.om`, run by `make test-graph-residue-mutants`) check its rounding and sign. `--hold-ms=N` (1 to 60000) holds the buffers after the line and prints the pid, so another process can read this one. The control build also accepts `--d8-ballast-mib=N`. It holds N MiB of touched host memory through the measurement, which is the negative control. `tests/d8_process_tax.om` (with its shared part `tests/d8_lib.om`, compiled by the pinned seeded omc) holds the bar that was fixed before any chip run, and the controls: - `make d8-process-tax-dry-run` (`dry-run`) runs on the host only, in bwrap with the GPU devices hidden. It runs the simulator, a device-hidden GPU path that must stop at NOT_RUN, the `--hold-ms` bound and the default build's refusal of `--d8-ballast-mib`, and judge self-tests on synthetic logs. This dry run is not chip evidence. - `make d8-process-tax` (`gpu`) takes one `spark-window` lease (gb10 exclusive, 20 minutes). Inside the lease it measures `hello_gpu --hold-ms=3000` and both controls (`--bug=short`, and `--d8-ballast-mib=512`), then releases the lease. It reads `VmRSS` and the driver's per-process report from outside the process. `build/d8_process_tax check-gpu OUTDIR` judges a recorded run again. The program runs these host tools, each at its absolute path or found on `PATH`: `/usr/bin/bwrap` (hides the GPU devices for the dry run), `/usr/bin/env`, `/usr/bin/nice`, `/usr/bin/taskset` (CPU pin, `D8_CORES`, default `16,17`), `spark-window`, `sha256sum`, `git`, and `nvidia-smi`. The 1080 s lease wall clock is kept by the program itself. `nvidia-smi` is an ORACLE: the driver's own per-process report, read from outside the process (B4). It is never shipped and never linked. ## Chip runbook — NOT_RUN This migration has no current hardware qualification. Historical hello receipts do not qualify these source bytes. No GPU window was authorized for this lane. - Obtain a current exclusive hardware window and follow the current Spark authorization procedure. Record the exact commit, generated identities, compiler and bridge digests, GPU identity, module version and window receipt. A free lock file alone is not authorization. Do not stop a service or change driver binding merely to run this example. - First complete the wrapped host gates above. Build `build/hello_gpu` and `build/hello_gpu_control` without executing a chip target. Record their hashes. - Inside the authorized hardware procedure only, run `make doctor`, then `make hello-gpu`. This step deliberately cannot use the host device-hiding bwrap: it needs the admitted GPU. Require exit 0, every element checked, zero wrong and unwritten elements, and a final `PASS`. - Run `make hello-gpu-control`. Its short final launch must produce exactly one missing result, executable exit 1, and the enclosing control target must pass. Never run the past-end control on hardware. It is simulator-only. - Compare the output hash with the same revision's wrapped simulator output. Keep stdout, stderr, exit codes and device admission evidence. A mismatch, timeout or missing negative-control observation is not PASS. Do not infer model-graph chip qualification from the vector-add receipt. The host simulator cannot establish chip timing, fault recovery or device safety.