diff --git a/c/tests/CMakeLists.txt b/c/tests/CMakeLists.txt index 6d52e5b174..4f65238841 100644 --- a/c/tests/CMakeLists.txt +++ b/c/tests/CMakeLists.txt @@ -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 # ============================================================================= @@ -49,6 +49,7 @@ function(ConfigureTest) GTest::gtest_main $,$,cuvs::cuvs> $ + rmm::rmm ) set_target_properties( ${TEST_NAME} @@ -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) # ################################################################################################## diff --git a/ci/build_go.sh b/ci/build_go.sh index 925dfb9153..80370048ff 100755 --- a/ci/build_go.sh +++ b/ci/build_go.sh @@ -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 @@ -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 diff --git a/conda/environments/all_cuda-129_arch-aarch64.yaml b/conda/environments/all_cuda-129_arch-aarch64.yaml index 74f13bad68..d3a6d4dd8d 100644 --- a/conda/environments/all_cuda-129_arch-aarch64.yaml +++ b/conda/environments/all_cuda-129_arch-aarch64.yaml @@ -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 diff --git a/conda/environments/all_cuda-129_arch-x86_64.yaml b/conda/environments/all_cuda-129_arch-x86_64.yaml index f726fbd93f..7da3405cec 100644 --- a/conda/environments/all_cuda-129_arch-x86_64.yaml +++ b/conda/environments/all_cuda-129_arch-x86_64.yaml @@ -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 diff --git a/conda/environments/all_cuda-131_arch-aarch64.yaml b/conda/environments/all_cuda-131_arch-aarch64.yaml index d35632064f..94129ae55a 100644 --- a/conda/environments/all_cuda-131_arch-aarch64.yaml +++ b/conda/environments/all_cuda-131_arch-aarch64.yaml @@ -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 diff --git a/conda/environments/all_cuda-131_arch-x86_64.yaml b/conda/environments/all_cuda-131_arch-x86_64.yaml index 367cf0ec6e..23150f3ba4 100644 --- a/conda/environments/all_cuda-131_arch-x86_64.yaml +++ b/conda/environments/all_cuda-131_arch-x86_64.yaml @@ -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 diff --git a/conda/environments/bench_ann_cuda-129_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-129_arch-aarch64.yaml index 26df7c96c9..5dd1abf183 100644 --- a/conda/environments/bench_ann_cuda-129_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-129_arch-aarch64.yaml @@ -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 diff --git a/conda/environments/bench_ann_cuda-129_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-129_arch-x86_64.yaml index d63791f084..75d36d1f33 100644 --- a/conda/environments/bench_ann_cuda-129_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-129_arch-x86_64.yaml @@ -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 diff --git a/conda/environments/bench_ann_cuda-131_arch-aarch64.yaml b/conda/environments/bench_ann_cuda-131_arch-aarch64.yaml index d1e3a5bae4..3758fab63b 100644 --- a/conda/environments/bench_ann_cuda-131_arch-aarch64.yaml +++ b/conda/environments/bench_ann_cuda-131_arch-aarch64.yaml @@ -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 diff --git a/conda/environments/bench_ann_cuda-131_arch-x86_64.yaml b/conda/environments/bench_ann_cuda-131_arch-x86_64.yaml index 4b09d1b885..5f93dbb946 100644 --- a/conda/environments/bench_ann_cuda-131_arch-x86_64.yaml +++ b/conda/environments/bench_ann_cuda-131_arch-x86_64.yaml @@ -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 diff --git a/conda/recipes/cuvs/recipe.yaml b/conda/recipes/cuvs/recipe.yaml index dcce17cb13..690a2cf1f9 100644 --- a/conda/recipes/cuvs/recipe.yaml +++ b/conda/recipes/cuvs/recipe.yaml @@ -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 diff --git a/conda/recipes/libcuvs/recipe.yaml b/conda/recipes/libcuvs/recipe.yaml index abd3031a94..4453b18393 100644 --- a/conda/recipes/libcuvs/recipe.yaml +++ b/conda/recipes/libcuvs/recipe.yaml @@ -129,7 +129,6 @@ outputs: - libraft-headers =${{ minor_version }} - librmm =${{ minor_version }} - nccl - - cuda-cudart - libcublas - libcurand - libcusolver @@ -198,7 +197,6 @@ outputs: - libraft-headers =${{ minor_version }} - librmm =${{ minor_version }} - nccl - - cuda-cudart - libcublas - libcurand - libcusolver @@ -265,7 +263,6 @@ outputs: - libraft-headers =${{ minor_version }} - librmm =${{ minor_version }} - nccl - - cuda-cudart - libcublas - libcurand - libcusolver @@ -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 @@ -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 @@ -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 diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d4e9f2c6b4..d91bf0e30a 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -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) @@ -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}") @@ -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 diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 75a4473276..dfdc1a4d31 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -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" ) diff --git a/dependencies.yaml b/dependencies.yaml index e855a93f3e..df6159084b 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -96,6 +96,7 @@ files: - cuda_version - rapids_build - rust + - depends_on_cudart - depends_on_libcuvs - depends_on_libraft - depends_on_nccl @@ -110,6 +111,7 @@ files: - cuda_version - rapids_build - go + - depends_on_cudart - depends_on_libcuvs - depends_on_libraft - depends_on_nccl @@ -319,7 +321,6 @@ dependencies: - output_types: [conda] packages: - cuda-nvtx-dev - - cuda-cudart-dev - cuda-profiler-api - libcublas-dev - libcurand-dev @@ -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 diff --git a/docs/source/build.rst b/docs/source/build.rst index dcef10c96b..5e863e40f4 100644 --- a/docs/source/build.rst +++ b/docs/source/build.rst @@ -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 @@ -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 diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index feb7a03309..61092834c7 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -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 "$") target_link_libraries( - CAGRA_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $ + CAGRA_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $ ) add_executable(L2_C_EXAMPLE src/L2_c_example.c) target_include_directories(L2_C_EXAMPLE PUBLIC "$") target_link_libraries( - L2_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $ + L2_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $ ) add_executable(IVF_FLAT_C_EXAMPLE src/ivf_flat_c_example.c) target_include_directories(IVF_FLAT_C_EXAMPLE PUBLIC "$") target_link_libraries( - IVF_FLAT_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $ + IVF_FLAT_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $ ) add_executable(IVF_PQ_C_EXAMPLE src/ivf_pq_c_example.c) target_include_directories(IVF_PQ_C_EXAMPLE PUBLIC "$") target_link_libraries( - IVF_PQ_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $ + IVF_PQ_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $ ) add_executable(BRUTEFORCE_C_EXAMPLE src/bruteforce_c_example.c) target_include_directories(BRUTEFORCE_C_EXAMPLE PUBLIC "$") target_link_libraries( - BRUTEFORCE_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart $ + BRUTEFORCE_C_EXAMPLE PRIVATE cuvs::c_api CUDA::cudart_static $ ) diff --git a/examples/go/README.md b/examples/go/README.md index 798a024de4..819b05c700 100644 --- a/examples/go/README.md +++ b/examples/go/README.md @@ -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 ``` diff --git a/go/dlpack.go b/go/dlpack.go index 6fe619fd35..fcb9632586 100644 --- a/go/dlpack.go +++ b/go/dlpack.go @@ -3,6 +3,7 @@ package cuvs // #include // #include // #include +// #include import "C" import ( diff --git a/python/libcuvs/CMakeLists.txt b/python/libcuvs/CMakeLists.txt index 7f5d100587..bac8373cf7 100644 --- a/python/libcuvs/CMakeLists.txt +++ b/python/libcuvs/CMakeLists.txt @@ -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 # ============================================================================= @@ -31,7 +31,6 @@ endif() unset(cuvs_FOUND) # --- CUDA --- # -set(CUDA_STATIC_RUNTIME ON) set(CUDA_STATIC_MATH_LIBRARIES OFF) # --- RAFT ---# diff --git a/rust/cuvs-sys/build.rs b/rust/cuvs-sys/build.rs index 99e811eeb9..cec80eb736 100644 --- a/rust/cuvs-sys/build.rs +++ b/rust/cuvs-sys/build.rs @@ -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: