Skip to content

Default to static linking of libcudart#1627

Merged
rapids-bot[bot] merged 25 commits intorapidsai:mainfrom
bdice:static-cudart-default
Mar 16, 2026
Merged

Default to static linking of libcudart#1627
rapids-bot[bot] merged 25 commits intorapidsai:mainfrom
bdice:static-cudart-default

Conversation

@bdice
Copy link
Copy Markdown
Contributor

@bdice bdice commented Dec 9, 2025

Summary

  • Enable static linking of libcudart by default (CUDA_STATIC_RUNTIME=ON)
  • Remove cuda-cudart from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

Changes

  • cpp/CMakeLists.txt: Change CUDA_STATIC_RUNTIME default from OFF to ON
  • conda/recipes/cuvs/recipe.yaml: Remove cuda-cudart from run deps
  • conda/recipes/libcuvs/recipe.yaml: Remove cuda-cudart from run deps (4 outputs)

Note: Python builds already use CUDA_STATIC_RUNTIME=ON (set in python/libcuvs/CMakeLists.txt).

- Remove CUDA_STATIC_RUNTIME option from cpp/CMakeLists.txt
- Always use static CUDA runtime in rapids_cuda_init_runtime
- Update get_cutlass.cmake and get_faiss.cmake to always use static
- Remove CUDA_STATIC_RUNTIME from python/libcuvs/CMakeLists.txt
- Remove CUDA_STATIC_RUNTIME from docs
- Remove cuda-cudart from run requirements in conda recipes
@bdice bdice force-pushed the static-cudart-default branch from 93486fc to c94e7e6 Compare December 9, 2025 18:39
@bdice bdice requested a review from a team as a code owner December 9, 2025 18:39
Copy link
Copy Markdown
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

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

  • Missing changes to ci/build_go.sh and docs/source/build.rst to remove -lcudart
  • Missing changes to rust/cuvs-sys/build.rs to drop cargo:rustc-link-lib=dylib=cudart
  • examples/go/README.md Needs updating

@bdice bdice added breaking Introduces a breaking change improvement Improves an existing functionality labels Dec 10, 2025
@cjnolet cjnolet moved this from Todo to In Progress in Unstructured Data Processing Jan 5, 2026
@KyleFromNVIDIA KyleFromNVIDIA requested review from a team as code owners March 11, 2026 18:30
Comment thread conda/recipes/libcuvs/recipe.yaml
Comment thread dependencies.yaml
Comment thread cpp/CMakeLists.txt Outdated
Comment thread cpp/CMakeLists.txt Outdated
This reverts commit ed1c778.
@KyleFromNVIDIA
Copy link
Copy Markdown
Member

libcuvs.so is still getting CUDA::cudart rather than CUDA::cudart_static due to a leak from rmm::rmm. Relevant excerpt from lib/cmake/rmm/rmm-targets.cmake:

# Create imported target rmm::rmm
add_library(rmm::rmm SHARED IMPORTED)

set_target_properties(rmm::rmm PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "CUDA::cudart;CCCL::CCCL;dl;nvtx3::nvtx3-cpp;rapids_logger::rapids_logger"
  INTERFACE_POSITION_INDEPENDENT_CODE "ON"
)

Comment thread rust/cuvs-sys/build.rs Outdated
Comment thread c/tests/CMakeLists.txt Outdated
@KyleFromNVIDIA
Copy link
Copy Markdown
Member

/merge

@rapids-bot rapids-bot Bot merged commit c44a7f2 into rapidsai:main Mar 16, 2026
148 of 151 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Unstructured Data Processing Mar 16, 2026
KyleFromNVIDIA pushed a commit to KyleFromNVIDIA/cuvs that referenced this pull request Mar 16, 2026
## Summary
- Enable static linking of libcudart by default (`CUDA_STATIC_RUNTIME=ON`)
- Remove `cuda-cudart` from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

## Changes
- `cpp/CMakeLists.txt`: Change `CUDA_STATIC_RUNTIME` default from OFF to ON
- `conda/recipes/cuvs/recipe.yaml`: Remove `cuda-cudart` from run deps
- `conda/recipes/libcuvs/recipe.yaml`: Remove `cuda-cudart` from run deps (4 outputs)

Note: Python builds already use `CUDA_STATIC_RUNTIME=ON` (set in `python/libcuvs/CMakeLists.txt`).

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Robert Maynard (https://github.com/robertmaynard)
  - Ben Frederickson (https://github.com/benfred)

URL: rapidsai#1627
rapids-bot Bot pushed a commit that referenced this pull request Mar 16, 2026
KyleFromNVIDIA pushed a commit to KyleFromNVIDIA/cuvs that referenced this pull request Mar 18, 2026
- Enable static linking of libcudart by default (`CUDA_STATIC_RUNTIME=ON`)
- Remove `cuda-cudart` from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

- `cpp/CMakeLists.txt`: Change `CUDA_STATIC_RUNTIME` default from OFF to ON
- `conda/recipes/cuvs/recipe.yaml`: Remove `cuda-cudart` from run deps
- `conda/recipes/libcuvs/recipe.yaml`: Remove `cuda-cudart` from run deps (4 outputs)

Note: Python builds already use `CUDA_STATIC_RUNTIME=ON` (set in `python/libcuvs/CMakeLists.txt`).

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Robert Maynard (https://github.com/robertmaynard)
  - Ben Frederickson (https://github.com/benfred)

URL: rapidsai#1627
KyleFromNVIDIA pushed a commit to KyleFromNVIDIA/cuvs that referenced this pull request Mar 18, 2026
- Enable static linking of libcudart by default (`CUDA_STATIC_RUNTIME=ON`)
- Remove `cuda-cudart` from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

- `cpp/CMakeLists.txt`: Change `CUDA_STATIC_RUNTIME` default from OFF to ON
- `conda/recipes/cuvs/recipe.yaml`: Remove `cuda-cudart` from run deps
- `conda/recipes/libcuvs/recipe.yaml`: Remove `cuda-cudart` from run deps (4 outputs)

Note: Python builds already use `CUDA_STATIC_RUNTIME=ON` (set in `python/libcuvs/CMakeLists.txt`).

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Robert Maynard (https://github.com/robertmaynard)
  - Ben Frederickson (https://github.com/benfred)

URL: rapidsai#1627
rapids-bot Bot pushed a commit that referenced this pull request Mar 24, 2026
Rehash of #1627.

- Enable static linking of libcudart by default (`CUDA_STATIC_RUNTIME=ON`)
- Remove `cuda-cudart` from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

- `cpp/CMakeLists.txt`: Change `CUDA_STATIC_RUNTIME` default from OFF to ON
- `conda/recipes/cuvs/recipe.yaml`: Remove `cuda-cudart` from run deps
- `conda/recipes/libcuvs/recipe.yaml`: Remove `cuda-cudart` from run deps (4 outputs)

Note: Python builds already use `CUDA_STATIC_RUNTIME=ON` (set in `python/libcuvs/CMakeLists.txt`).

Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Divye Gala (https://github.com/divyegala)
  - Ben Frederickson (https://github.com/benfred)

URL: #1931
jrbourbeau pushed a commit to jrbourbeau/cuvs that referenced this pull request Mar 25, 2026
Rehash of rapidsai#1627.

- Enable static linking of libcudart by default (`CUDA_STATIC_RUNTIME=ON`)
- Remove `cuda-cudart` from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

- `cpp/CMakeLists.txt`: Change `CUDA_STATIC_RUNTIME` default from OFF to ON
- `conda/recipes/cuvs/recipe.yaml`: Remove `cuda-cudart` from run deps
- `conda/recipes/libcuvs/recipe.yaml`: Remove `cuda-cudart` from run deps (4 outputs)

Note: Python builds already use `CUDA_STATIC_RUNTIME=ON` (set in `python/libcuvs/CMakeLists.txt`).

Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Divye Gala (https://github.com/divyegala)
  - Ben Frederickson (https://github.com/benfred)

URL: rapidsai#1931
jrbourbeau pushed a commit to jrbourbeau/cuvs that referenced this pull request Mar 25, 2026
Rehash of rapidsai#1627.

- Enable static linking of libcudart by default (`CUDA_STATIC_RUNTIME=ON`)
- Remove `cuda-cudart` from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

- `cpp/CMakeLists.txt`: Change `CUDA_STATIC_RUNTIME` default from OFF to ON
- `conda/recipes/cuvs/recipe.yaml`: Remove `cuda-cudart` from run deps
- `conda/recipes/libcuvs/recipe.yaml`: Remove `cuda-cudart` from run deps (4 outputs)

Note: Python builds already use `CUDA_STATIC_RUNTIME=ON` (set in `python/libcuvs/CMakeLists.txt`).

Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Divye Gala (https://github.com/divyegala)
  - Ben Frederickson (https://github.com/benfred)

URL: rapidsai#1931
lowener pushed a commit to lowener/cuvs that referenced this pull request Mar 30, 2026
- Enable static linking of libcudart by default (`CUDA_STATIC_RUNTIME=ON`)
- Remove `cuda-cudart` from conda recipe run requirements (no longer needed when statically linked)

This is part of a RAPIDS-wide effort to switch to static CUDA runtime linking. See rapidsai/build-planning#235 for tracking.

- `cpp/CMakeLists.txt`: Change `CUDA_STATIC_RUNTIME` default from OFF to ON
- `conda/recipes/cuvs/recipe.yaml`: Remove `cuda-cudart` from run deps
- `conda/recipes/libcuvs/recipe.yaml`: Remove `cuda-cudart` from run deps (4 outputs)

Note: Python builds already use `CUDA_STATIC_RUNTIME=ON` (set in `python/libcuvs/CMakeLists.txt`).

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Robert Maynard (https://github.com/robertmaynard)
  - Ben Frederickson (https://github.com/benfred)

URL: rapidsai#1627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants