rapidsai / build-planning

Tracking for RAPIDS-wide build tasks
https://github.com/rapidsai
0 stars 4 forks source link

Consider statically linking the CUDA runtime #4

Open vyasr opened 11 months ago

vyasr commented 11 months ago

Currently RAPIDS libraries support static linkage to cudart via a CMake flag CUDA_STATIC_RUNTIME. This flag is leveraged by wheel builds and by the Spark-RAPIDS JNI (specifically for cudf), but it is not the default. We would like to consider changing that. Using static libcudart has a few advantages:

Given that cudart is small, the typical size concerns around static linking aren't concerning. However, the CUDA libraries (such as the math libraries like cuBLAS) are large, so we don't typically want to statically link those. Furthermore, static linking has the potential to open us up to issues around weak linking and CUDA kernels in the case of header-only libraries (i.e. anything using thrust, or raft). Therefore, before we can move to building statically by default, we should ensure that our libraries are safe to build that way by marking all kernels as static.

vyasr commented 6 months ago

As part of this work, we should also look into migrating from using an option CUDA_STATIC_RUNTIME across RAPIDS to instead using the built-in CMAKE_CUDA_RUNTIME_LIBRARY variable. cf. https://github.com/rapidsai/cudf/issues/7888