Use static linkage for CUDA runtime#992
Conversation
|
Thanks Bradley! 🙏 The commit history is pulling in a bunch of old commits from past releases. Could we please rebase this? |
robertmaynard
left a comment
There was a problem hiding this comment.
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
106cf5c to
55c7c66
Compare
jakirkham
left a comment
There was a problem hiding this comment.
Thanks Kyle! 🙏
This is looking better, but still needs a few things
| host: | ||
| - click | ||
| - cuda-version ={{ cuda_version }} | ||
| - cuda-cudart-dev |
There was a problem hiding this comment.
This needs to be dropped too
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
For static linkage this is already part of the NVCC compiler package
There was a problem hiding this comment.
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 |
|
Also please drop any other instances of Line 218 in 2129c3b |
|
We're still including |
Summary
cuda-cudartfrom run requirements in conda recipesWith static linking of the CUDA runtime (the default for C++ and Python packages), the runtime is embedded in the binaries and the
cuda-cudartpackage is not needed at runtime.Part of rapidsai/build-planning#235