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

76 lines · 3963 bytes Raw Blame History Source

compat/nvml: CUDA++ libnvidia-ml subset

Every file here is generated from the seeded Omega unit native/nvml/api.om by the omega-bridge cabi-1 C ABI library emitter (omega-bridge#83). Never edit them; edit api.om and regenerate:

FileBridge mode
libnvidia-ml.ctools/bridge-seeded lib-c native/nvml/api.om
nvml.htools/bridge-seeded lib-h native/nvml/api.om
libnvidia-ml.maptools/bridge-seeded lib-map native/nvml/api.om (version script: the 11 exports, local: *;)

The bridge checkout is OMEGA_CABI_BRIDGE; its src/toc.om and tools/bridge-seeded are pinned by sha256 in om/omega-bridge-cabi.lock. This second pin is temporary (Manager(Aien) D2, unify under Linear DRA-154) and is used only for api.om; the 53 other units stay on om/omega-bridge.lock through om/units.sh. tests/nvml/gate.om regenerates all three files and refuses any byte difference.

The library answers this subset of NVML (CUDA 13.0 nvml.h): nvmlInit_v2, nvmlShutdown, nvmlErrorString, nvmlDeviceGetCount_v2, nvmlDeviceGetHandleByIndex_v2, nvmlDeviceGetName, nvmlDeviceGetUUID, nvmlDeviceGetTemperature, nvmlDeviceGetMemoryInfo, nvmlDeviceGetUtilizationRates, nvmlDeviceGetComputeRunningProcesses_v3, and the unversioned nvmlInit/nvmlDeviceGetCount/... names through the same macros NVIDIA's header uses (off with NVML_NO_UNVERSIONED_FUNC_DEFS). Types, values and prototypes follow the CUDA 13.0 header; no NVIDIA text is copied.

api.om owns the protocol loop, the dispatch of each step action to the #281 transport (omega2_nvrm_open_file, omega2_nvrm_close_file, omega2_nvrm_ioctl, native/nvrm/transport.om), copy bounds, opaque handles, the error-string cache and the process lock. RM request construction and error policy stay in native/nvml/{nvml,query,step,errstr}.om, imported by api.om. NVIDIA's libnvidia-ml is never linked or loaded.

Build

cc -fPIC -shared -Wl,-soname,libnvidia-ml.so.1 \
   -Wl,--version-script=compat/nvml/libnvidia-ml.map \
   -o libnvidia-ml.so.1 compat/nvml/libnvidia-ml.c

The library imports the transport symbols from the process that loads it (the test caller links tests/nvml/transport.c; production links the #281 transport), so -Wl,-z,defs is not used. The gate instead checks the undefined symbols against an allowlist.

Behaviour changes from the removed handwritten shell

The handwritten cudapp_nvml.c is gone. The generated library is stricter in four cases, each reachable only if a step returns malformed output:

The 476 checks and 22 mutants observe the same results as before.

Status

TierVerdict
Generated libnvidia-ml.so.1 + C caller over fake RM (tests/nvml/transport.c)HOST_TESTED: 476 checks
Seeded Omega model over fake RMHOST_TESTED: 476 checks; 22/22 mutants with the original failure counts
ABI against CUDA 13.0 nvml.hHOST_TESTED: 55 facts; 11 generated prototypes compile against it; a changed type is rejected
Exports, soname and imports (ORACLE nm/readelf)HOST_TESTED: exactly 11 T exports, soname libnvidia-ml.so.1, allowlisted imports; an object calling ioctl is rejected
Concurrent callersNOT_RUN
Live resource managerNOT_RUN: opening /dev/nvidia* needs an authorized GPU window
Utilization over the #281 transportNOT_RUN: 55888-byte control vs the e5b32567 devcall bound (aien-dev/omega-mv#1048)

Evidence: evidence/NVML-365-2026-11-07/. No hardware qualification or deployment claim. CI on this change is NOT_RUN while aien-dev Actions is externally blocked.