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 / compat / cuda / README.md

142 lines · 8756 bytes Raw Blame History Source

C0 frozen CUDA compatibility profile (CUDApp#184)

Status: IMPLEMENTED and host-EXERCISED (static admission only). Device execution is NOT_RUN. This directory pins one CUDA Driver API application, its PTX module, and the exact surface either may use. Later gates (Bridge#42 C1 ABI, CUDApp#185 C2 translate, CUDApp#186 runner) check against these files and do not redefine them.

FileRole
fixture/vadd_drv.cDriver API application written for this gate: one context, one PTX module, three buffers, one launch, host-side verification.
fixture/vadd_u32.ptxThe module it loads, written by hand from the PTX ISA (class A, PROVENANCE.md section 2).
build.sh OUTRebuilds the aarch64 and x86_64 executables. A link-only stub libcuda.so.1 (each cu* symbol defined as 0, no code) satisfies the link; it is never a runtime library.
profile-c0-aarch64-v1.tsv, profile-c0-x86_64-v1.tsvOriginal frozen identities, retained byte-identical.
profile-c0-aarch64-v2.tsv, profile-c0-x86_64-v2.tsvHistorical standalone-oracle identities, retained byte-identical.
profile-c0-aarch64-v3.tsv, profile-c0-x86_64-v3.tsvActive standalone-oracle identities regenerated under merged bridge #77 (29d9cff7).
c0_check.omSeeded Omega admission checker, composed after om/cache/digest.om (SHA-256).
test.sh [WORKDIR]Rebuilds twice (hashes must match), proves the v1/v2/v3 CUDA import sets identical, admits both v3 profiles, then requires 14 negative controls to refuse. make test-cuda-c0-profile.

The v2 identity change moves the fixture's reference inputs, vector-add reference, grid size, checksum and failure aggregation to om/standalone-oracles/oracles.om. The host executable hashes change; the PTX and the CUDA import sets do not. The generated seeded bridge adds libc trap-handling imports, recorded in v2. The old v1/v2 profiles are not revised or used to admit the changed executables. build.sh only builds artifacts. Neither it nor test.sh executes the CUDA fixture on a GPU; the lane's separate host transport exercise is not device qualification.

Checker

c0_check check PROFILE EXE PTX RUNISA   # RUNISA: aarch64 | x86_64 | static
c0_check emit  PROFILE EXE PTX          # print the records read from the artifacts (authoring aid, never admission)

Exit 0 prints CUDA-C0-PROFILE PASS records=N imports=I ptxops=P. Exit 1 prints one CUDA-C0-PROFILE REFUSED <reason> [kind] <detail> line for each refusal. Exit 2 means a usage error and exit 3 an unreadable or oversized input (profile and PTX at most 64 KiB, executable at most 1 MiB). The checker reads the three files and writes only to stdout. It never runs the artifact.

Admission requires all of the following:

Profile record kinds

schema, profile <id> <ver> C0, host <isa> ELF64 <abi> <os> <GLIBC floor>, toolchain <name> <version>, artifact <host-exe|ptx> <sha256> <name>, needed <soname> <replacement|system>, verneed <version> <file>, import <symbol> <cuda|libc|crt> <supported|system|weak> <source api>, lookup absent <prefix>, ptx <version> <target> <address size>, entry <name> <params>, regprefix <p>, ptxdir|ptxop|sreg <token> supported, deny <opcode root> <class>, feature <name> <supported|unsupported> <detail>, numeric <op> <rule>, launch <k> <v>, expect <k> <v>, runner <id> <gate> <AVAILABLE_NOT_RUN|BLOCKED_HARDWARE|BLOCKED_GPU_WINDOW|BLOCKED_DECISION> <evidence>.

The C0 surface consists of these Driver API calls: cuInit, cuDeviceGet, cuCtxCreate (_v4), cuModuleLoadData, cuModuleGetFunction, cuMemAlloc (_v2), cuMemcpyHtoD/DtoH (_v2), cuLaunchKernel, cuCtxSynchronize, cuMemFree (_v2), cuModuleUnload and cuCtxDestroy (_v2). The PTX side is integer global-memory arithmetic only.

The following are unsupported in C0, and each is either refused or absent:

numeric rows fix the integer semantics (wrap modulo 2^32).

Launch values (Wolfram)

WolframLanguageEvaluator: With[{n=4099,blk=256}, ... a=Mod[i*2654435761,2^32], b=Mod[(2^32-1)-Mod[7i,2^32],2^32], c=Mod[a+b,2^32] ...] gives grid 17, 4352 threads, 253 idle tail threads, checksum 8806203976955 (fits in u64), and 4098 wrapped sums.

Provenance

Runner inventory (observed 2026-10-29)

RunnerGateStateEvidence
Spark host (aarch64, glibc 2.39)C0 staticEXERCISED by test.shevidence/CUDA-C0-PROFILE-20261029/
Spark GB10 (10de:2e12 rev a1, NVRM 580.173.02 open, VBIOS 9a.0b.2d.00.00)C3 deviceBLOCKED_GPU_WINDOW/proc/driver/nvidia, lspci; needs a spark-window and Drake's authorization
arm64 AMD / Intel GPUC4BLOCKED_HARDWAREnone attached to the Spark
x86_64 NVIDIA / AMD / Intel hostC4BLOCKED_HARDWAREno x86 GPU host in inventory
Stock NVIDIA cuda-samples (v13.4)C3BLOCKED_DECISIONbuilding them needs nvcc on NVIDIA's inputs, outside PROVENANCE class B

GPU arms (NOT_RUN; each needs a spark-window and Drake's authorization)

# C3: run the C0 fixture on GB10 against the CUDApp replacement libcuda, with a binding trace
spark-window open --gb10 shared --quiet none <ledger>        # coordinator-approved ledger only
compat/cuda/build.sh /tmp/c0 && cd /tmp/c0/aarch64
LD_LIBRARY_PATH=<cudapp replacement libcuda dir> LD_DEBUG=bindings ./vadd_drv ../vadd_u32.ptx 2> bindings.log
# expect: exit 0, stdout "VADD_U32 PASS n=4099 grid=17 block=256 checksum=8806203976955",
# every cu* binding resolved in the replacement library, and none in an NVIDIA libcuda
spark-window close <window-id>