skip to content
==> README.md <==
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.