The CUDA driver API calls meshd needs, loaded at runtime from libcuda.so.1 (no CUDA headers or toolkit to build), with an injectable table for tests
$ sexc add @ajax/cuda-driver- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 02:56v/# 1 version
- drwxr-xr-x-Oct 27 02:56files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 02:56 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-text ^0.1.0, @ajax/mesh-check ^0.1.0
- dependents
- @ajax/cuda-driver-fake, @ajax/mesh-cuda, @ajax/mesh-mps, @ajax/mesh-mps-worker
- keywords
- mesh alphaos cuda gpu driver dlopen
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/cuda-driver
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/cuda-driver 2 3The CUDA driver API calls meshd needs, as a table of functions loaded from `libcuda.so.1` at runtime: building needs no CUDA headers or toolkit. The types and constants are the CUDA 13.0 ABI as alpha-rust-mesh's cudarc 0.19 bindings declare them (including `CUdevResource` for green contexts). `mesh_cu_ck` gives cuda.rs's error messages (`cuInit: CUDA_ERROR_NO_DEVICE`); `src/names.c` holds every CUresult name. Tests swap the table (`mesh_cuda_set`), as @ajax/cuda-driver-fake does. 4 5## Differences 6 7The Rust's cudarc panics when it cannot load the driver; here `mesh_cuda_load` returns an error naming `libcuda.so.1`. 8 9## Ported from 10 11[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/cuda.rs (its `ck`, and the cudarc calls it makes). 12 13## Tests 14 15`tests/driver.c`: names, both error styles, an injected table, and loading on a machine without the driver. 16 17## Licence 18 19MIT. See the repository's LICENSE.