Expand description
Dynamic CUDA driver library loader.
This module is the architectural foundation of oxicuda-driver. It locates
and loads the CUDA driver shared library (libcuda.so on Linux,
nvcuda.dll on Windows) at runtime via libloading, so that no CUDA
SDK is required at build time.
§Platform support
| Platform | Library names tried | Notes |
|---|---|---|
| Linux | libcuda.so.1, libcuda.so | Installed by NVIDIA driver |
| Windows | nvcuda.dll | Ships with the display driver |
| macOS | — | Returns UnsupportedPlatform |
§Usage
Application code should not interact with DriverApi directly.
Instead, call try_driver to obtain a reference to the lazily-
initialised global singleton:
let api = try_driver()?;
// api.cu_init, api.cu_device_get, …The singleton is stored in a OnceLock so that the (relatively
expensive) dlopen + symbol resolution only happens once, and all
subsequent accesses are a single atomic load.
Structs§
- Driver
Api - Complete function-pointer table for the CUDA Driver API.
Functions§
- try_
driver - Get a reference to the lazily-loaded CUDA driver API function table.