There are often multiple versions of CUDA installed, and different programs may require different CUDA versions. Therefore it is important to ensure that the FFI bindings are for the desired version of CUDA.
There are several features that pin the API bindings to specific CUDA versions:
One and only one of these features must be set somewhere in the cargo dependency graph in order for the cuda crate to be used, otherwise the crate will force a compile-time error.
For further details on CUDA version compatibility, please see: https://docs.nvidia.com/deploy/cuda-compatibility/index.html.
It is recommended that binary crates specify one and only one of these version features, whereas library crates should specify no features.
cuda_sys: This features substitutes the FFI bindings auto-generated by bindgen with the bindings provided by the cuda_sys crate. As of cuda_sys v0.2.0, these bindings are specific to CUDA 8.0 only.
fresh: For maintainers of the crate itself. This feature generates fresh FFI bindings using bindgen from the build script.