File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,15 @@ add_subdirectory(${xgboost_SOURCE_DIR}/plugin)
232
232
233
233
if (PLUGIN_RMM )
234
234
find_package (rmm REQUIRED )
235
+
236
+ # Patch the rmm targets so they reference the static cudart
237
+ # Remove this patch once RMM stops specifying cudart requirement
238
+ # (since RMM is a header-only library, it should not specify cudart in its CMake config)
239
+ get_target_property (rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES )
240
+ list (REMOVE_ITEM rmm_link_libs CUDA::cudart )
241
+ list (APPEND rmm_link_libs CUDA::cudart_static )
242
+ set_target_properties (rmm::rmm PROPERTIES INTERFACE_LINK_LIBRARIES "${rmm_link_libs} " )
243
+ get_target_property (rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES )
235
244
endif (PLUGIN_RMM )
236
245
237
246
#-- library
Original file line number Diff line number Diff line change @@ -177,7 +177,8 @@ function(xgboost_set_cuda_flags target)
177
177
set_target_properties (${target} PROPERTIES
178
178
CUDA_STANDARD 17
179
179
CUDA_STANDARD_REQUIRED ON
180
- CUDA_SEPARABLE_COMPILATION OFF )
180
+ CUDA_SEPARABLE_COMPILATION OFF
181
+ CUDA_RUNTIME_LIBRARY Static )
181
182
endfunction (xgboost_set_cuda_flags )
182
183
183
184
macro (xgboost_link_nccl target )
@@ -279,6 +280,7 @@ macro(xgboost_target_link_libraries target)
279
280
280
281
if (USE_CUDA )
281
282
xgboost_set_cuda_flags (${target} )
283
+ target_link_libraries (${target} PUBLIC CUDA::cudart_static )
282
284
endif (USE_CUDA )
283
285
284
286
if (PLUGIN_RMM )
You can’t perform that action at this time.
0 commit comments