Skip to content

Commit e1851bf

Browse files
committed
Remove CUDA_STATIC_RUNTIME option, always use static cudart
1 parent 139e95b commit e1851bf

8 files changed

Lines changed: 20 additions & 50 deletions

File tree

cpp/CMakeLists.txt

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ option(CUDA_ENABLE_LINEINFO
5959
)
6060
option(CUDA_WARNINGS_AS_ERRORS "Enable -Werror=all-warnings for all CUDA compilation" ON)
6161

62-
# cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic linking
63-
option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" ON)
64-
65-
set(DEFAULT_CUDF_BUILD_STREAMS_TEST_UTIL ON)
66-
67-
if(CUDA_STATIC_RUNTIME OR NOT BUILD_SHARED_LIBS)
62+
# Stream testing requires dynamic CUDA runtime linking, which is no longer supported
63+
set(DEFAULT_CUDF_BUILD_STREAMS_TEST_UTIL OFF)
64+
if(BUILD_SHARED_LIBS)
6865
set(DEFAULT_CUDF_BUILD_STREAMS_TEST_UTIL OFF)
6966
endif()
7067

@@ -98,7 +95,6 @@ message(
9895
VERBOSE
9996
"CUDF: Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler): ${CUDA_ENABLE_LINEINFO}"
10097
)
101-
message(VERBOSE "CUDF: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}")
10298
message(VERBOSE
10399
"CUDF: Build with remote IO (e.g. AWS S3) support through KvikIO: ${CUDF_KVIKIO_REMOTE_IO}"
104100
)
@@ -989,7 +985,7 @@ if(TARGET conda_env)
989985
target_link_libraries(cudf PRIVATE conda_env)
990986
endif()
991987

992-
rapids_cuda_set_runtime(cudf USE_STATIC ${CUDA_STATIC_RUNTIME})
988+
rapids_cuda_set_runtime(cudf USE_STATIC ON)
993989

994990
file(
995991
WRITE "${CUDF_BINARY_DIR}/fatbin.ld"
@@ -1036,7 +1032,7 @@ if(CUDF_BUILD_TESTUTIL)
10361032
PUBLIC cudf
10371033
PRIVATE $<TARGET_NAME_IF_EXISTS:conda_env>
10381034
)
1039-
rapids_cuda_set_runtime(cudftest_default_stream USE_STATIC ${CUDA_STATIC_RUNTIME})
1035+
rapids_cuda_set_runtime(cudftest_default_stream USE_STATIC ON)
10401036

10411037
add_library(cudf::cudftest_default_stream ALIAS cudftest_default_stream)
10421038

@@ -1067,7 +1063,7 @@ if(CUDF_BUILD_TESTUTIL)
10671063
cudftestutil INTERFACE "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}>"
10681064
"$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/src>"
10691065
)
1070-
rapids_cuda_set_runtime(cudftestutil USE_STATIC ${CUDA_STATIC_RUNTIME})
1066+
rapids_cuda_set_runtime(cudftestutil USE_STATIC ON)
10711067
add_library(cudf::cudftestutil ALIAS cudftestutil)
10721068

10731069
add_library(cudftestutil_impl INTERFACE)
@@ -1114,12 +1110,10 @@ endif()
11141110

11151111
# * build cudf_identify_stream_usage --------------------------------------------------------------
11161112
if(CUDF_BUILD_STREAMS_TEST_UTIL)
1117-
if(CUDA_STATIC_RUNTIME)
1118-
message(
1119-
FATAL_ERROR
1120-
"Stream identification cannot be used with a static CUDA runtime. Please set CUDA_STATIC_RUNTIME=OFF or CUDF_BUILD_STREAMS_TEST_UTIL=OFF."
1121-
)
1122-
endif()
1113+
message(
1114+
FATAL_ERROR
1115+
"Stream identification is not supported because it requires dynamic CUDA runtime linking. Please set CUDF_BUILD_STREAMS_TEST_UTIL=OFF."
1116+
)
11231117

11241118
# Libraries for stream-related testing. We build the library twice, one with STREAM_MODE_TESTING
11251119
# on and one with it set to off. Each test will then be configured to use the appropriate library
@@ -1147,7 +1141,7 @@ if(CUDF_BUILD_STREAMS_TEST_UTIL)
11471141
target_include_directories(${_tgt} PRIVATE "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/include>")
11481142
target_link_libraries(${_tgt} PUBLIC CUDA::cudart rmm::rmm)
11491143

1150-
rapids_cuda_set_runtime(${_tgt} USE_STATIC ${CUDA_STATIC_RUNTIME})
1144+
rapids_cuda_set_runtime(${_tgt} USE_STATIC ON)
11511145
add_library(cudf::${_tgt} ALIAS ${_tgt})
11521146

11531147
if("${_mode}" STREQUAL "testing")

cpp/cmake/Modules/JitifyPreprocessKernels.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
add_executable(jitify_preprocess "${JITIFY_INCLUDE_DIR}/jitify2_preprocess.cpp")
1010

1111
target_compile_definitions(jitify_preprocess PRIVATE "_FILE_OFFSET_BITS=64")
12-
rapids_cuda_set_runtime(jitify_preprocess USE_STATIC ${CUDA_STATIC_RUNTIME})
12+
rapids_cuda_set_runtime(jitify_preprocess USE_STATIC ON)
1313
target_link_libraries(jitify_preprocess PUBLIC ${CMAKE_DL_LIBS})
1414

1515
# Take a list of files to JIT-compile and run them through jitify_preprocess.

cpp/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function(ConfigureTest CMAKE_TEST_NAME)
6060
${CMAKE_TEST_NAME} PRIVATE cudf::cudftestutil_objects nvtx3::nvtx3-cpp
6161
$<TARGET_NAME_IF_EXISTS:conda_env> "${_CUDF_TEST_EXTRA_LIBS}"
6262
)
63-
rapids_cuda_set_runtime(${CMAKE_TEST_NAME} USE_STATIC ${CUDA_STATIC_RUNTIME})
63+
rapids_cuda_set_runtime(${CMAKE_TEST_NAME} USE_STATIC ON)
6464
rapids_test_add(
6565
NAME ${CMAKE_TEST_NAME}
6666
COMMAND ${CMAKE_TEST_NAME}

java/README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,13 @@ If you decide to build without Docker and the build script, examining the cmake
7979
settings in the [Java CI build script](ci/build-in-docker.sh) can be helpful if you are
8080
encountering difficulties during the build.
8181

82-
## Statically Linking the CUDA Runtime
83-
84-
If you use the default cmake options libcudart will be dynamically linked to libcudf and libcudfjni.
85-
To build with a static CUDA runtime, build libcudf with the `-DCUDA_STATIC_RUNTIME=ON` as a cmake
86-
parameter, and similarly build with `-DCUDA_STATIC_RUNTIME=ON` when building the Java bindings
87-
with Maven.
88-
8982
### Building with a libcudf Archive
9083

91-
When statically linking the CUDA runtime, it is recommended to build cuDF as an archive rather than
92-
a shared library, as this allows the Java bindings to only have a single shared library that uses
93-
the CUDA runtime. To build libcudf as an archive, specify `-DBUILD_SHARED_LIBS=OFF` as a cmake
94-
parameter when building libcudf, then specify `-DCUDF_JNI_LIBCUDF_STATIC=ON` when building the Java
95-
bindings with Maven.
84+
When building the Java bindings against a static libcudf, it is recommended to build cuDF as an
85+
archive rather than a shared library, as this allows the Java bindings to only have a single shared
86+
library that uses the CUDA runtime. To build libcudf as an archive, specify `-DBUILD_SHARED_LIBS=OFF`
87+
as a cmake parameter when building libcudf, then specify `-DCUDF_JNI_LIBCUDF_STATIC=ON` when building
88+
the Java bindings with Maven.
9689

9790
## Per-thread Default Stream
9891

java/ci/build-in-docker.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ gcc --version
1010

1111
SKIP_JAVA_TESTS=${SKIP_JAVA_TESTS:-true}
1212
BUILD_CPP_TESTS=${BUILD_CPP_TESTS:-OFF}
13-
ENABLE_CUDA_STATIC_RUNTIME=${ENABLE_CUDA_STATIC_RUNTIME:-ON}
1413
ENABLE_PTDS=${ENABLE_PTDS:-ON}
1514
RMM_LOGGING_LEVEL=${RMM_LOGGING_LEVEL:-OFF}
1615
ENABLE_NVTX=${ENABLE_NVTX:-ON}
@@ -27,7 +26,6 @@ OUT_PATH="$WORKSPACE/$OUT"
2726
echo "SIGN_FILE: $SIGN_FILE,\
2827
SKIP_JAVA_TESTS: $SKIP_JAVA_TESTS,\
2928
BUILD_CPP_TESTS: $BUILD_CPP_TESTS,\
30-
ENABLE_CUDA_STATIC_RUNTIME: $ENABLE_CUDA_STATIC_RUNTIME,\
3129
ENABLED_PTDS: $ENABLE_PTDS,\
3230
ENABLE_NVTX: $ENABLE_NVTX,\
3331
ENABLE_GDS: $ENABLE_GDS,\
@@ -47,7 +45,6 @@ mkdir -p "$LIBCUDF_BUILD_PATH"
4745
cd "$LIBCUDF_BUILD_PATH"
4846
cmake .. -G"${CMAKE_GENERATOR}" \
4947
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
50-
-DCUDA_STATIC_RUNTIME="$ENABLE_CUDA_STATIC_RUNTIME" \
5148
-DUSE_NVTX="$ENABLE_NVTX" \
5249
-DCUDF_LARGE_STRINGS_DISABLED=ON \
5350
-DCUDF_USE_ARROW_STATIC=ON \
@@ -71,7 +68,6 @@ BUILD_ARG=(
7168
"-Dmaven.repo.local=$WORKSPACE/.m2"
7269
"-DskipTests=$SKIP_JAVA_TESTS"
7370
"-DCUDF_USE_PER_THREAD_DEFAULT_STREAM=$ENABLE_PTDS"
74-
"-DCUDA_STATIC_RUNTIME=$ENABLE_CUDA_STATIC_RUNTIME"
7571
"-DCUDF_JNI_LIBCUDF_STATIC=ON"
7672
"-DUSE_GDS=$ENABLE_GDS"
7773
"-Dtest=*,!CuFileTest,!CudaFatalTest,!ColumnViewNonEmptyNullsTest"

java/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
<skipNativeCopy>false</skipNativeCopy>
154154
<cxx.flags/>
155155
<CMAKE_EXPORT_COMPILE_COMMANDS>OFF</CMAKE_EXPORT_COMPILE_COMMANDS>
156-
<CUDA_STATIC_RUNTIME>OFF</CUDA_STATIC_RUNTIME>
157156
<CUDF_USE_PER_THREAD_DEFAULT_STREAM>OFF</CUDF_USE_PER_THREAD_DEFAULT_STREAM>
158157
<USE_GDS>OFF</USE_GDS>
159158
<CMAKE_CUDA_ARCHITECTURES>RAPIDS</CMAKE_CUDA_ARCHITECTURES>
@@ -484,7 +483,6 @@
484483
<env key="CUDF_CPP_BUILD_DIR" value="${CUDF_CPP_BUILD_DIR}"/>
485484
<arg value="${basedir}/src/main/native"/>
486485
<arg line="${cmake.ccache.opts}"/>
487-
<arg value="-DCUDA_STATIC_RUNTIME=${CUDA_STATIC_RUNTIME}" />
488486
<arg value="-DCUDF_USE_PER_THREAD_DEFAULT_STREAM=${CUDF_USE_PER_THREAD_DEFAULT_STREAM}" />
489487
<arg value="-DUSE_GDS=${USE_GDS}" />
490488
<arg value="-DCMAKE_CXX_FLAGS=${cxx.flags}"/>

java/src/main/native/CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ option(USE_NVTX "Build with NVTX support" ON)
2929
option(BUILD_SHARED_LIBS "Build cuDF JNI shared libraries" ON)
3030
option(BUILD_TESTS "Configure CMake to build tests" ON)
3131
option(CUDF_USE_PER_THREAD_DEFAULT_STREAM "Build with per-thread default stream" OFF)
32-
option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF)
3332
option(USE_GDS "Build with GPUDirect Storage (GDS)/cuFile support" OFF)
3433
option(CUDF_JNI_LIBCUDF_STATIC "Link with libcudf.a" OFF)
3534
option(CUDF_JNI_ENABLE_PROFILING "Build with profiling support" ON)
@@ -41,7 +40,6 @@ message(VERBOSE "CUDF_JNI: Configure CMake to build tests: ${BUILD_TESTS}")
4140
message(VERBOSE
4241
"CUDF_JNI: Build with per-thread default stream: ${CUDF_USE_PER_THREAD_DEFAULT_STREAM}"
4342
)
44-
message(VERBOSE "CUDF_JNI: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}")
4543
message(VERBOSE "CUDF_JNI: Build with GPUDirect Storage support: ${USE_GDS}")
4644
message(VERBOSE "CUDF_JNI: Link with libcudf statically: ${CUDF_JNI_LIBCUDF_STATIC}")
4745

@@ -274,16 +272,9 @@ target_link_libraries(
274272

275273
# ##################################################################################################
276274
# * cudart options --------------------------------------------------------------------------------
277-
# cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic
278-
# linking
275+
# cudart is always statically linked
279276

280-
if(CUDA_STATIC_RUNTIME)
281-
# Tell CMake what CUDA language runtime to use
282-
set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Static)
283-
else()
284-
# Tell CMake what CUDA language runtime to use
285-
set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Shared)
286-
endif()
277+
set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Static)
287278

288279
# ##################################################################################################
289280
# * install shared libraries ----------------------------------------------------------------------

python/libcudf/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ if(NOT USE_NVCOMP_RUNTIME_WHEEL)
6464
endif()
6565
endif()
6666

67-
set(CUDA_STATIC_RUNTIME ON)
68-
6967
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
7068

7169
add_subdirectory(../../cpp cudf-cpp)

0 commit comments

Comments
 (0)