This template project provides a drop-in sample to for using cuVS in a rust project.
First, please refer to our installation docs for the minimum requirements to use cuVS. Note that you will have to have the libcuvs.so and libcuvs_c.so binaries installed to compile this example project.
Once the minimum requirements are satisfied, this example template application can be built using 'cargo build', and this directory can be copied directly in order to build a new application with cuVS.
You may follow these steps to quickly get set up:
conda env create --name rust -f conda/environments/rust_cuda-131_arch-$(uname -m).yaml
conda activate rustYou may prefer to use mamba, as it provides significant speedup over conda.
- Set up the required environment variables:
LIBCLANG_PATH=$(dirname "$(find "$CONDA_PREFIX" -name libclang.so | head -n 1)")
export LIBCLANG_PATH
echo "LIBCLANG_PATH=$LIBCLANG_PATH"- Add the cuvs dependency in your project:
# Cargo.toml
[dependencies]
cuvs = ">=24.6.0"
#...rest of your dependenciesThen you can run your project with cargo run.
See main.rs for an example implementation.