Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions c/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand Down Expand Up @@ -49,6 +49,7 @@ function(ConfigureTest)
GTest::gtest_main
$<IF:$<BOOL:${CUVSC_STATIC_CUVS_LIBRARY}>,$<COMPILE_ONLY:cuvs::cuvs_static>,cuvs::cuvs>
$<TARGET_NAME_IF_EXISTS:conda_env>
rmm::rmm
Copy link
Member

@KyleFromNVIDIA KyleFromNVIDIA Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not entirely clear to me why this is needed now. AFAICT, we've always been building with CUVSC_STATIC_CUVS_LIBRARY=ON, so the link error should have been triggered before this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now we're getting runtime link errors due to missing librmm.so: https://github.com/rapidsai/cuvs/actions/runs/23055523149/job/66970964103?pr=1627

)
set_target_properties(
${TEST_NAME}
Expand Down Expand Up @@ -94,7 +95,7 @@ endif()

ConfigureTest(NAME cuvs_c_headers PATH core/headers.c)
ConfigureTest(NAME cuvs_c_test PATH core/c_api.c)
target_link_libraries(cuvs_c_test PRIVATE CUDA::cudart)
target_link_libraries(cuvs_c_test PRIVATE CUDA::cudart_static)
ConfigureTest(NAME cuvs_c_neighbors_test PATH neighbors/c_api.c)

# ##################################################################################################
Expand Down
4 changes: 2 additions & 2 deletions ci/build_go.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail
Expand Down Expand Up @@ -31,7 +31,7 @@ set -eu
rapids-print-env

export CGO_CFLAGS="-I${CONDA_PREFIX}/include"
export CGO_LDFLAGS="-L${CONDA_PREFIX}/lib -lcudart -lcuvs -lcuvs_c"
export CGO_LDFLAGS="-L${CONDA_PREFIX}/lib -lcudart_static -ldl -lrt -lcuvs -lcuvs_c"
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
export CC=clang

Expand Down
1 change: 0 additions & 1 deletion conda/environments/all_cuda-129_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- clang-tools==20.1.4
- clang==20.1.4
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/environments/all_cuda-129_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- clang-tools==20.1.4
- clang==20.1.4
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/environments/all_cuda-131_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- clang-tools==20.1.4
- clang==20.1.4
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/environments/all_cuda-131_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- clang-tools==20.1.4
- clang==20.1.4
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/environments/bench_ann_cuda-129_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- clang==20.1.4
- click
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/environments/bench_ann_cuda-129_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- clang==20.1.4
- click
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/environments/bench_ann_cuda-131_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- clang==20.1.4
- click
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/environments/bench_ann_cuda-131_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- clang==20.1.4
- click
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-nvtx-dev
- cuda-profiler-api
Expand Down
1 change: 0 additions & 1 deletion conda/recipes/cuvs/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ requirements:
- if: cuda_major == "12"
then: cuda-python >=12.9.2,<13.0
else: cuda-python >=13.0.1,<14.0
- cuda-cudart
ignore_run_exports:
by_name:
- cuda-version
Expand Down
6 changes: 0 additions & 6 deletions conda/recipes/libcuvs/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ outputs:
- libraft-headers =${{ minor_version }}
- librmm =${{ minor_version }}
- nccl
- cuda-cudart
- libcublas
- libcurand
- libcusolver
Expand Down Expand Up @@ -198,7 +197,6 @@ outputs:
- libraft-headers =${{ minor_version }}
- librmm =${{ minor_version }}
- nccl
- cuda-cudart
- libcublas
- libcurand
- libcusolver
Expand Down Expand Up @@ -265,7 +263,6 @@ outputs:
- libraft-headers =${{ minor_version }}
- librmm =${{ minor_version }}
- nccl
- cuda-cudart
- libcublas
- libcurand
- libcusolver
Expand Down Expand Up @@ -328,7 +325,6 @@ outputs:
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- libraft-headers =${{ minor_version }}
- nccl
- cuda-cudart
- libcublas
- libcurand
- libcusolver
Expand Down Expand Up @@ -431,7 +427,6 @@ outputs:
- ${{ pin_subpackage("libcuvs", exact=True) }}
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- nccl
- cuda-cudart
- libcublas
- libcurand
- libcusolver
Expand Down Expand Up @@ -506,7 +501,6 @@ outputs:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- ${{ pin_subpackage("libcuvs", exact=True) }}
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- cuda-cudart
- libcublas
- libcurand
- libcusolver
Expand Down
4 changes: 1 addition & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ option(CUDA_ENABLE_KERNELINFO "Enable kernel resource usage info" OFF)
option(CUDA_ENABLE_LINEINFO
"Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler)" OFF
)
option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF)
option(CUDA_STATIC_MATH_LIBRARIES "Statically link the CUDA math libraries" OFF)
option(CUVS_STATIC_RAPIDS_LIBRARIES "Build and statically link RAPIDS libraries" OFF)
option(CUDA_LOG_COMPILE_TIME "Write a log of compilation times to nvcc_compile_log.csv" OFF)
Expand Down Expand Up @@ -116,7 +115,6 @@ message(VERBOSE "cuVS: Disable OpenMP: ${DISABLE_OPENMP}")
message(VERBOSE "cuVS: Enable kernel resource usage info: ${CUDA_ENABLE_KERNELINFO}")
message(VERBOSE "cuVS: Enable lineinfo in nvcc: ${CUDA_ENABLE_LINEINFO}")
message(VERBOSE "cuVS: Enable nvtx markers: ${CUVS_NVTX}")
message(VERBOSE "cuVS: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}")
message(VERBOSE "cuVS: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}")
message(VERBOSE "cuVS: Build and statically link RAPIDS libraries: ${CUVS_STATIC_RAPIDS_LIBRARIES}")

Expand Down Expand Up @@ -153,7 +151,7 @@ endif()

if(NOT BUILD_CPU_ONLY)
# CUDA runtime
rapids_cuda_init_runtime(USE_STATIC ${CUDA_STATIC_RUNTIME})
rapids_cuda_init_runtime(USE_STATIC ON)
# * find CUDAToolkit package
# * determine GPU architectures
# * enable the CMake CUDA language
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/thirdparty/get_faiss.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function(find_and_configure_faiss)
"FAISS_ENABLE_CUVS ${PKG_ENABLE_GPU}"
"FAISS_ENABLE_PYTHON OFF"
"FAISS_OPT_LEVEL ${CUVS_FAISS_OPT_LEVEL}"
"FAISS_USE_CUDA_TOOLKIT_STATIC ${CUDA_STATIC_RUNTIME}"
"FAISS_USE_CUDA_TOOLKIT_STATIC ON"
"BUILD_TESTING OFF"
"CMAKE_MESSAGE_LOG_LEVEL VERBOSE"
)
Expand Down
8 changes: 7 additions & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ files:
- cuda_version
- rapids_build
- rust
- depends_on_cudart
- depends_on_libcuvs
- depends_on_libraft
- depends_on_nccl
Expand All @@ -110,6 +111,7 @@ files:
- cuda_version
- rapids_build
- go
- depends_on_cudart
- depends_on_libcuvs
- depends_on_libraft
- depends_on_nccl
Expand Down Expand Up @@ -319,7 +321,6 @@ dependencies:
- output_types: [conda]
packages:
- cuda-nvtx-dev
- cuda-cudart-dev
- cuda-profiler-api
- libcublas-dev
- libcurand-dev
Expand Down Expand Up @@ -357,6 +358,11 @@ dependencies:
- matrix:
packages:
- cuda-toolkit[cublas,curand,cusolver,cusparse,nvjitlink]>=12,<14
depends_on_cudart:
common:
- output_types: conda
packages:
- cuda-cudart-dev
depends_on_cupy:
common:
- output_types: conda
Expand Down
7 changes: 1 addition & 6 deletions docs/source/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ After building the C and C++ libraries, the Golang library can be built with the
export CUDA_HOME="/usr/local/cuda" # or wherever your CUDA installation is.
export CGO_CFLAGS="-I${CONDA_PREFIX}/include -I${CUDA_HOME}/include"
export CGO_LDFLAGS="-L${CONDA_PREFIX}/lib -lcudart -lcuvs -lcuvs_c"
export CGO_LDFLAGS="-L${CONDA_PREFIX}/lib -lcuvs -lcuvs_c"
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
export CC=clang
Expand Down Expand Up @@ -259,11 +259,6 @@ cuVS has the following configurable cmake flags available:
- OFF
- Enable the `-lineinfo` option for nvcc

* - CUDA_STATIC_RUNTIME
- ON, OFF
- OFF
- Statically link the CUDA runtime

* - CUDA_STATIC_MATH_LIBRARIES
- ON, OFF
- OFF
Expand Down
10 changes: 5 additions & 5 deletions examples/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
add_executable(CAGRA_C_EXAMPLE src/cagra_c_example.c)
target_include_directories(CAGRA_C_EXAMPLE PUBLIC "$<BUILD_INTERFACE:${DLPACK_INCLUDE_DIR}>")
target_link_libraries(
CAGRA_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $<TARGET_NAME_IF_EXISTS:conda_env>
CAGRA_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $<TARGET_NAME_IF_EXISTS:conda_env>
)

add_executable(L2_C_EXAMPLE src/L2_c_example.c)
target_include_directories(L2_C_EXAMPLE PUBLIC "$<BUILD_INTERFACE:${DLPACK_INCLUDE_DIR}>")
target_link_libraries(
L2_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $<TARGET_NAME_IF_EXISTS:conda_env>
L2_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $<TARGET_NAME_IF_EXISTS:conda_env>
)

add_executable(IVF_FLAT_C_EXAMPLE src/ivf_flat_c_example.c)
target_include_directories(IVF_FLAT_C_EXAMPLE PUBLIC "$<BUILD_INTERFACE:${DLPACK_INCLUDE_DIR}>")
target_link_libraries(
IVF_FLAT_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $<TARGET_NAME_IF_EXISTS:conda_env>
IVF_FLAT_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $<TARGET_NAME_IF_EXISTS:conda_env>
)

add_executable(IVF_PQ_C_EXAMPLE src/ivf_pq_c_example.c)
target_include_directories(IVF_PQ_C_EXAMPLE PUBLIC "$<BUILD_INTERFACE:${DLPACK_INCLUDE_DIR}>")
target_link_libraries(
IVF_PQ_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $<TARGET_NAME_IF_EXISTS:conda_env>
IVF_PQ_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $<TARGET_NAME_IF_EXISTS:conda_env>
)

add_executable(BRUTEFORCE_C_EXAMPLE src/bruteforce_c_example.c)
target_include_directories(BRUTEFORCE_C_EXAMPLE PUBLIC "$<BUILD_INTERFACE:${DLPACK_INCLUDE_DIR}>")
target_link_libraries(
BRUTEFORCE_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $<TARGET_NAME_IF_EXISTS:conda_env>
BRUTEFORCE_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $<TARGET_NAME_IF_EXISTS:conda_env>
)
2 changes: 1 addition & 1 deletion examples/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You may prefer to use `mamba`, as it provides significant speedup over `conda`.
1. Set up the required environment variables:
```bash
export CGO_CFLAGS="-I${CONDA_PREFIX}/include"
export CGO_LDFLAGS="-L${CONDA_PREFIX}/lib -lcudart -lcuvs -lcuvs_c"
export CGO_LDFLAGS="-L${CONDA_PREFIX}/lib -lcudart_static -ldl -lrt -lcuvs -lcuvs_c"
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
export CC=clang
```
Expand Down
1 change: 1 addition & 0 deletions go/dlpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cuvs
// #include <stdlib.h>
// #include <dlpack/dlpack.h>
// #include <cuvs/core/c_api.h>
// #include <cuda_runtime_api.h>
import "C"

import (
Expand Down
3 changes: 1 addition & 2 deletions python/libcuvs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand Down Expand Up @@ -31,7 +31,6 @@ endif()
unset(cuvs_FOUND)

# --- CUDA --- #
set(CUDA_STATIC_RUNTIME ON)
set(CUDA_STATIC_MATH_LIBRARIES OFF)

# --- RAFT ---#
Expand Down
5 changes: 4 additions & 1 deletion rust/cuvs-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ fn main() {
"cargo:rustc-link-search=native={}/lib",
cuvs_build.display()
);
if let Ok(conda_prefix) = env::var("CONDA_PREFIX") {
println!("cargo:rustc-link-search=native={}/lib", conda_prefix);
}
println!("cargo:rustc-link-lib=dylib=cuvs_c");
println!("cargo:rustc-link-lib=dylib=cudart");
println!("cargo:rustc-link-lib=static=cudart_static");

// we need some extra flags both to link against cuvs, and also to run bindgen
// specifically we need to:
Expand Down
Loading