Skip to content

Use static linkage for CUDA runtime#992

Open
bdice wants to merge 1 commit into
rapidsai:mainfrom
bdice:static-cudart
Open

Use static linkage for CUDA runtime#992
bdice wants to merge 1 commit into
rapidsai:mainfrom
bdice:static-cudart

Conversation

@bdice
Copy link
Copy Markdown
Contributor

@bdice bdice commented Dec 9, 2025

Summary

  • Remove cuda-cudart from run requirements in conda recipes

With static linking of the CUDA runtime (the default for C++ and Python packages), the runtime is embedded in the binaries and the cuda-cudart package is not needed at runtime.

Part of rapidsai/build-planning#235

@bdice bdice requested review from a team as code owners December 9, 2025 17:58
@bdice bdice requested a review from gforsyth December 9, 2025 17:58
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Dec 9, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@jakirkham
Copy link
Copy Markdown
Member

Thanks Bradley! 🙏

The commit history is pulling in a bunch of old commits from past releases. Could we please rebase this?

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.

Locations we directly link to shared cudart:

cpp/CMakeLists.txt:            CUDA::cudart
cpp/plugins/cucim.kit.cumed/CMakeLists.txt:            CUDA::cudart
cpp/plugins/cucim.kit.cuslide/CMakeLists.txt:                CUDA::cudart
cpp/plugins/cucim.kit.cuslide/CMakeLists.txt:                CUDA::cudart
cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt:            CUDA::cudart
cpp/plugins/cucim.kit.cuslide2/CMakeLists.txt:                CUDA::cudart
cpp/plugins/cucim.kit.cuslide2/CMakeLists.txt:                CUDA::cudart
cpp/plugins/cucim.kit.cuslide2/tests/CMakeLists.txt:            CUDA::cudart
cpp/tests/CMakeLists.txt:            CUDA::cudart

@bdice bdice added breaking Introduces a breaking change improvement Improves an existing functionality labels Dec 10, 2025
@KyleFromNVIDIA KyleFromNVIDIA requested a review from a team as a code owner May 12, 2026 15:40
Copy link
Copy Markdown
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

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

Thanks Kyle! 🙏

This is looking better, but still needs a few things

host:
- click
- cuda-version ={{ cuda_version }}
- cuda-cudart-dev
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be dropped too

Suggested change

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, we're still compiling against cudart, so we still need it as a host dependency. We've already removed it as a run dependency since we've statically linked it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For static linkage this is already part of the NVCC compiler package

Copy link
Copy Markdown
Member

@KyleFromNVIDIA KyleFromNVIDIA May 12, 2026

Choose a reason for hiding this comment

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

Depending on the NVCC Conda package for cudart is wrong. NVCC lives in $BUILD_PREFIX (the build environment), since that's where the executable for the building architecture lives, while we need to get cudart from $PREFIX (the host environment), since that's where the library for the built architecture lives.

This isn't just a theoretical cross-compilation problem. We have previously had real issues with this. See https://github.com/rapidsai/cudf/pull/22290/changes#r3184782324 - we had to add cuda-cudart-dev back as a host dependency because the location of compute-sanitizer was being computed relative to cudart.

The bottom line is that if we're going to build against cudart, we need to have a dependency on cuda-cudart-dev at build time.

- yasm # [x86_64]
host:
- cuda-version ={{ cuda_version }}
- cuda-cudart-dev
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

Suggested change

@jakirkham
Copy link
Copy Markdown
Member

Also please drop any other instances of cuda-cudart-dev like this one

- cuda-cudart-dev

@KyleFromNVIDIA
Copy link
Copy Markdown
Member

We're still including cuda-cudart-dev in the cuda dependency set because it's still needed to build. We just don't include it in the runtime dependencies anymore.

@KyleFromNVIDIA KyleFromNVIDIA requested a review from jakirkham May 14, 2026 15:42
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

None yet

Development

Successfully merging this pull request may close these issues.

4 participants