Skip to content

Use static linkage for CUDA runtime#559

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

Use static linkage for CUDA runtime#559
bdice wants to merge 3 commits intorapidsai: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 ucxx-tests conda recipe

With static linking of the CUDA runtime, the runtime is embedded in the binaries and the cuda-cudart package is not needed at runtime.

Part of rapidsai/build-planning#235

Remove cuda-cudart from run requirements in ucxx-tests conda recipe
since static linking embeds the runtime into binaries.
@bdice bdice requested a review from a team as a code owner December 9, 2025 18:13
@bdice bdice requested a review from KyleFromNVIDIA December 9, 2025 18:13
@pentschev pentschev added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Dec 9, 2025
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.

I don't think we can do this at the ucxx level.

UCX depends on libcudart https://github.com/search?q=repo%3Aopenucx%2Fucx%20cudart&type=code

@bdice bdice added the breaking Introduces a breaking change label Dec 10, 2025
@bdice bdice requested a review from a team as a code owner December 10, 2025 00:11
@pentschev
Copy link
Copy Markdown
Member

I don't think we can do this at the ucxx level.

UCX depends on libcudart https://github.com/search?q=repo%3Aopenucx%2Fucx%20cudart&type=code

UCXX only links dynamically to UCX. I'm definitely ignorant of linking details, but if UCXX switches to link statically to CUDA, does it become a problem with UCXX linking dynamically to UCX, and in turn UCX link dynamically to CUDA? That is what the current linkage tree in UCXX looks like.

@robertmaynard
Copy link
Copy Markdown
Contributor

I don't think we can do this at the ucxx level.
UCX depends on libcudart https://github.com/search?q=repo%3Aopenucx%2Fucx%20cudart&type=code

UCXX only links dynamically to UCX. I'm definitely ignorant of linking details, but if UCXX switches to link statically to CUDA, does it become a problem with UCXX linking dynamically to UCX, and in turn UCX link dynamically to CUDA? That is what the current linkage tree in UCXX looks like.

My concern is:

The goal of this is to improve minor version compatibility. If UCX is loading the shared library version of cudart, it is a failure point of minor version compatibility. So if UCXX isn't extending the subset of libcudart symbols usage it doesn't need to change ( since either project will fail ).

With these changes we will have ucxx use the functions from the static version of libcudart and works, while ucx is using the shared library version and will fail.

@pentschev
Copy link
Copy Markdown
Member

So if UCXX isn't extending the subset of libcudart symbols usage it doesn't need to change ( since either project will fail ).

UCXX shouldn't be extending symbol usage, except for those indirectly being used via RMM.

@bdice bdice removed the non-breaking Introduces a non-breaking change label Dec 11, 2025
@bdice
Copy link
Copy Markdown
Contributor Author

bdice commented Dec 11, 2025

@robertmaynard Are you concluding this PR should be closed with no changes made? I am happy to cut this from the broader scope if that's the right outcome.

@vyasr
Copy link
Copy Markdown
Contributor

vyasr commented Dec 30, 2025

I think the real change we need here is to discuss statically linking cudart in UCX. This may also necessitate introducing a new approach in UCX for detecting the availability of the CUDA transport, but I would hope not. I haven't looked in a while, but IIRC the libuct_cuda.so binary is dynamically linked to the driver libcuda.so, and the dlopen of that transport governs whether CUDA support is available. Beyond that, if UCX also uses cudart symbols but statically links to it then we should be on the MVC happy path.

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