From 69ae97184c6c976928fded4054c5b08088a276c8 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 9 Dec 2025 10:30:11 -0600 Subject: [PATCH 1/3] Remove CUDA_STATIC_RUNTIME option, always use static linking - Remove CUDA_STATIC_RUNTIME option from cpp/CMakeLists.txt - Always link against CUDA::cudart_static - Remove -s flag from build.sh - Remove CUDA_STATIC_RUNTIME from python/librmm/CMakeLists.txt - Remove cuda-cudart from run requirements in conda recipes --- build.sh | 10 ++-------- conda/recipes/librmm/recipe.yaml | 3 --- conda/recipes/rmm/recipe.yaml | 1 - cpp/CMakeLists.txt | 10 +--------- python/librmm/CMakeLists.txt | 1 - 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/build.sh b/build.sh index 4195d0745..98ab0ca34 100755 --- a/build.sh +++ b/build.sh @@ -19,8 +19,8 @@ ARGS=$* # script, and that this script resides in the repo dir! REPODIR=$(cd "$(dirname "$0")"; pwd) -VALIDARGS="clean librmm rmm -v -g -n -s --ptds -h tests benchmarks" -HELP="$0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-s] [--ptds] [--cmake-args=\"\"] [-h] +VALIDARGS="clean librmm rmm -v -g -n --ptds -h tests benchmarks" +HELP="$0 [clean] [librmm] [rmm] [-v] [-g] [-n] [--ptds] [--cmake-args=\"\"] [-h] clean - remove all existing build artifacts and configuration (start over) librmm - build and install the librmm C++ code rmm - build and install the rmm Python package @@ -29,7 +29,6 @@ HELP="$0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-s] [--ptds] [--cmake-args=\"\\\" - pass arbitrary list of CMake configuration options (escape all quotes in argument) -h - print this text @@ -46,7 +45,6 @@ BUILD_TYPE=Release INSTALL_TARGET=install BUILD_BENCHMARKS=OFF BUILD_TESTS=OFF -CUDA_STATIC_RUNTIME=OFF PER_THREAD_DEFAULT_STREAM=OFF RAN_CMAKE=0 @@ -92,7 +90,6 @@ function ensureCMakeRan { echo "Executing cmake for librmm..." cmake -S "${REPODIR}"/cpp -B "${LIBRMM_BUILD_DIR}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ - -DCUDA_STATIC_RUNTIME="${CUDA_STATIC_RUNTIME}" \ -DPER_THREAD_DEFAULT_STREAM="${PER_THREAD_DEFAULT_STREAM}" \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DBUILD_TESTS=${BUILD_TESTS} \ @@ -136,9 +133,6 @@ fi if hasArg tests; then BUILD_TESTS=ON fi -if hasArg -s; then - CUDA_STATIC_RUNTIME=ON -fi if hasArg --ptds; then PER_THREAD_DEFAULT_STREAM=ON fi diff --git a/conda/recipes/librmm/recipe.yaml b/conda/recipes/librmm/recipe.yaml index 920a5b881..a127e198c 100644 --- a/conda/recipes/librmm/recipe.yaml +++ b/conda/recipes/librmm/recipe.yaml @@ -96,7 +96,6 @@ outputs: - rapids-logger =0.2 run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - - cuda-cudart - rapids-logger =0.2 run_exports: - ${{ pin_subpackage("librmm", upper_bound="x.x") }} @@ -136,7 +135,6 @@ outputs: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("librmm", exact=True) }} - rapids-logger =0.2 - - cuda-cudart ignore_run_exports: from_package: - cuda-cudart-dev @@ -193,7 +191,6 @@ outputs: - cuda-cudart-dev - ${{ pin_subpackage("librmm", exact=True) }} run: - - cuda-cudart - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("librmm", exact=True) }} ignore_run_exports: diff --git a/conda/recipes/rmm/recipe.yaml b/conda/recipes/rmm/recipe.yaml index a4fa8aa91..842379d22 100644 --- a/conda/recipes/rmm/recipe.yaml +++ b/conda/recipes/rmm/recipe.yaml @@ -75,7 +75,6 @@ requirements: - pip - scikit-build-core >=0.10.0 run: - - cuda-cudart - if: cuda_major == "12" then: cuda-python >=12.9.2,<13.0 else: cuda-python >=13.0.1,<14.0 diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 1f2241d60..784fd3338 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -48,9 +48,6 @@ message(VERBOSE "RMM: Build with NVTX support: ${RMM_NVTX}") # build type for cmake-gui. message(STATUS "RMM: RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'") -# cudart can be linked statically or dynamically -option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF) - # ################################################################################################## # * compiler options ------------------------------------------------------------------------------- @@ -99,12 +96,7 @@ target_include_directories( "$" INTERFACE "$") -if(CUDA_STATIC_RUNTIME) - message(STATUS "RMM: Enabling static linking of cudart") - target_link_libraries(rmm PUBLIC CUDA::cudart_static) -else() - target_link_libraries(rmm PUBLIC CUDA::cudart) -endif() +target_link_libraries(rmm PUBLIC CUDA::cudart_static) target_link_libraries(rmm PUBLIC CCCL::CCCL ${CMAKE_DL_LIBS} nvtx3::nvtx3-cpp rapids_logger::rapids_logger) diff --git a/python/librmm/CMakeLists.txt b/python/librmm/CMakeLists.txt index d1370c548..fdf7066b2 100644 --- a/python/librmm/CMakeLists.txt +++ b/python/librmm/CMakeLists.txt @@ -26,6 +26,5 @@ unset(rmm_FOUND) set(BUILD_TESTS OFF) set(BUILD_BENCHMARKS OFF) -set(CUDA_STATIC_RUNTIME ON) add_subdirectory(../../cpp rmm-cpp) From eed89204c263573bf06c928801783c7af9432328 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 9 Dec 2025 17:38:52 -0600 Subject: [PATCH 2/3] Always statically link cudart in tests. --- cpp/tests/CMakeLists.txt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index cdd8657bb..8a92d6efd 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -83,7 +83,7 @@ endfunction() function(ConfigureTest TEST_NAME) set(options LINK_DRIVER) - set(one_value CUDART GPUS PERCENT) + set(one_value GPUS PERCENT) set(multi_value) cmake_parse_arguments(_RMM_TEST "${options}" "${one_value}" "${multi_value}" ${ARGN}) if(NOT DEFINED _RMM_TEST_GPUS AND NOT DEFINED _RMM_TEST_PERCENT) @@ -97,13 +97,7 @@ function(ConfigureTest TEST_NAME) set(_RMM_TEST_PERCENT 100) endif() - if(_RMM_TEST_CUDART STREQUAL SHARED) - set(cudart_link_libs $ CUDA::cudart) - elseif(_RMM_TEST_CUDART STREQUAL STATIC) - set(cudart_link_libs $ CUDA::cudart_static) - else() - set(cudart_link_libs rmm) - endif() + set(cudart_link_libs $ CUDA::cudart_static) # Test with legacy default stream. ConfigureTestInternal(${TEST_NAME} ${_RMM_TEST_UNPARSED_ARGUMENTS}) @@ -146,10 +140,7 @@ ConfigureTest(POOL_MR_TEST mr/pool_mr_tests.cpp GPUS 1 PERCENT 100) ConfigureTest(HWDECOMPRESS_TEST mr/hwdecompress_tests.cpp LINK_DRIVER) # cuda_async mr tests -ConfigureTest(CUDA_ASYNC_MR_STATIC_CUDART_TEST mr/cuda_async_mr_tests.cpp GPUS 1 PERCENT 60 CUDART - STATIC) -ConfigureTest(CUDA_ASYNC_MR_SHARED_CUDART_TEST mr/cuda_async_mr_tests.cpp GPUS 1 PERCENT 60 CUDART - SHARED) +ConfigureTest(CUDA_ASYNC_MR_TEST mr/cuda_async_mr_tests.cpp GPUS 1 PERCENT 60) # cuda_async managed mr tests (available with CUDA 13+ runtime/driver) ConfigureTest(CUDA_ASYNC_MANAGED_MR_TEST mr/cuda_async_managed_mr_tests.cpp) From 736d7f9357fbfb7aaea0dea82e18486960eebe28 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 9 Dec 2025 17:44:01 -0600 Subject: [PATCH 3/3] Remove cuda-cudart-dev dependencies --- conda/recipes/librmm/recipe.yaml | 9 --------- conda/recipes/rmm/recipe.yaml | 2 -- 2 files changed, 11 deletions(-) diff --git a/conda/recipes/librmm/recipe.yaml b/conda/recipes/librmm/recipe.yaml index a127e198c..dd917cdf7 100644 --- a/conda/recipes/librmm/recipe.yaml +++ b/conda/recipes/librmm/recipe.yaml @@ -92,7 +92,6 @@ outputs: - ${{ stdlib("c") }} host: - cuda-version =${{ cuda_version }} - - cuda-cudart-dev - rapids-logger =0.2 run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} @@ -100,8 +99,6 @@ outputs: run_exports: - ${{ pin_subpackage("librmm", upper_bound="x.x") }} ignore_run_exports: - from_package: - - cuda-cudart-dev by_name: - cuda-version tests: @@ -130,14 +127,11 @@ outputs: - ${{ pin_subpackage("librmm", exact=True) }} - cuda-driver-dev - cuda-version =${{ cuda_version }} - - cuda-cudart-dev run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("librmm", exact=True) }} - rapids-logger =0.2 ignore_run_exports: - from_package: - - cuda-cudart-dev by_name: - cuda-version about: @@ -188,14 +182,11 @@ outputs: - cuda-version =${{ cuda_version }} host: - cuda-version =${{ cuda_version }} - - cuda-cudart-dev - ${{ pin_subpackage("librmm", exact=True) }} run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("librmm", exact=True) }} ignore_run_exports: - from_package: - - cuda-cudart-dev by_name: - cuda-version - librmm diff --git a/conda/recipes/rmm/recipe.yaml b/conda/recipes/rmm/recipe.yaml index 842379d22..3dc34f450 100644 --- a/conda/recipes/rmm/recipe.yaml +++ b/conda/recipes/rmm/recipe.yaml @@ -64,7 +64,6 @@ requirements: - ${{ stdlib("c") }} host: - cuda-version =${{ cuda_version }} - - cuda-cudart-dev - if: cuda_major == "12" then: cuda-python >=12.9.2,<13.0 else: cuda-python >=13.0.1,<14.0 @@ -84,7 +83,6 @@ requirements: ignore_run_exports: from_package: - cuda-python - - cuda-cudart-dev by_name: - cuda-version