Skip to content

Commit 4d835d7

Browse files
committed
use better method to specify cuda libraries
1 parent 013f0c4 commit 4d835d7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cmake/utils.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,7 @@ function (define_gpu_extension_target GPU_MOD_NAME)
359359
# Don't use `TORCH_LIBRARIES` for CUDA since it pulls in a bunch of
360360
# dependencies that are not necessary and may not be installed.
361361
if (GPU_LANGUAGE STREQUAL "CUDA")
362-
if ("${CUDA_CUDA_LIB}" STREQUAL "")
363-
set(CUDA_CUDA_LIB "${CUDA_CUDA_LIBRARY}")
364-
endif()
365-
target_link_libraries(${GPU_MOD_NAME} PRIVATE ${CUDA_CUDA_LIB}
366-
${CUDA_LIBRARIES})
362+
target_link_libraries(${GPU_MOD_NAME} PRIVATE CUDA::cudart CUDA::cuda_driver)
367363
else()
368364
target_link_libraries(${GPU_MOD_NAME} PRIVATE ${TORCH_LIBRARIES})
369365
endif()

0 commit comments

Comments
 (0)