Skip to content

Default to static linking of libcudart#20814

Open
bdice wants to merge 4 commits intorapidsai:mainfrom
bdice:static-cudart-default
Open

Default to static linking of libcudart#20814
bdice wants to merge 4 commits intorapidsai:mainfrom
bdice:static-cudart-default

Conversation

@bdice
Copy link
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/cudf/recipe.yaml: Remove cuda-cudart from run deps
  • conda/recipes/cudf_kafka/recipe.yaml: Remove cuda-cudart from run deps

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

@bdice bdice requested review from a team as code owners December 9, 2025 17:20
@bdice bdice requested a review from AyodeAwe December 9, 2025 17:20
@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Dec 9, 2025
@KyleFromNVIDIA KyleFromNVIDIA added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 9, 2025
@bdice bdice requested a review from a team as a code owner December 9, 2025 18:44
@github-actions github-actions bot added Python Affects Python cuDF API. Java Affects Java cuDF API. labels Dec 9, 2025
@GPUtester GPUtester moved this to In Progress in cuDF Python Dec 9, 2025
Copy link
Contributor

@ttnghia ttnghia left a comment

Choose a reason for hiding this comment

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

We will also need to update spark-rapids-jni after this.

@@ -1147,7 +1141,7 @@ if(CUDF_BUILD_STREAMS_TEST_UTIL)
target_include_directories(${_tgt} PRIVATE "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/include>")
target_link_libraries(${_tgt} PUBLIC CUDA::cudart rmm::rmm)
Copy link
Contributor

Choose a reason for hiding this comment

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

@vyasr Can we even support stream related testing with a static cuda runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CI is passing. Is that enough signal or do we need more? I changed this in bcfbbd1.

@@ -1114,12 +1110,10 @@ endif()

# * build cudf_identify_stream_usage --------------------------------------------------------------
if(CUDF_BUILD_STREAMS_TEST_UTIL)
Copy link
Contributor

Choose a reason for hiding this comment

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

If we can't even enable CUDF_BUILD_STREAMS_TEST_UTIL any more we need to remove it entirely.

@vyasr Do we still need these tests to enforce usage of stream only APIs? If so I think we will need to figure out new CI builds that use cudart=shared and stream tests but aren't part of our release

@bdice bdice added the breaking Breaking change label Dec 10, 2025
@bdice bdice removed libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API. CMake CMake build issue Java Affects Java cuDF API. non-breaking Non-breaking change labels Dec 10, 2025
@bdice bdice added the DO NOT MERGE Hold off on merging; see PR for details label Dec 11, 2025
@bdice
Copy link
Contributor Author

bdice commented Dec 11, 2025

Marking as DO NOT MERGE. @vyasr will need to investigate what we can do to enable a separate CI job for stream testing that dynamically links to libcudart.

@jakirkham
Copy link
Member

jakirkham commented Dec 12, 2025

Previously Spark RAPIDS encountered performance issues using the static cudart

Admittedly that was a long time ago and many things have changed since then

Do we know whether this is still relevant for Spark RAPIDS? cc @abellina (who debugged this issue previously)

@vyasr
Copy link
Contributor

vyasr commented Dec 12, 2025

That issue looks like it was with Arrow statically linking cudart and not cudf.

@abellina
Copy link
Contributor

abellina commented Jan 9, 2026

That issue looks like it was with Arrow statically linking cudart and not cudf.

Yes at this rate, we are linking cudf with cudart statically in our spark-rapids-jni project, so we are already doing static linking ourselves. I don't see an issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change DO NOT MERGE Hold off on merging; see PR for details improvement Improvement / enhancement to an existing function

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

7 participants