Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a better error message when CUDA::cuda_driver not found #8794

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,22 @@ if(CUDA_STATIC_RUNTIME)
# Tell CMake what CUDA language runtime to use
set_target_properties(cudf PROPERTIES CUDA_RUNTIME_LIBRARY Static)
# Make sure to export to consumers what runtime we used
target_link_libraries(cudf PUBLIC CUDA::cudart_static CUDA::cuda_driver)
target_link_libraries(cudf PUBLIC CUDA::cudart_static)
else()
# Tell CMake what CUDA language runtime to use
set_target_properties(cudf PROPERTIES CUDA_RUNTIME_LIBRARY Shared)
# Make sure to export to consumers what runtime we used
target_link_libraries(cudf PUBLIC CUDA::cudart CUDA::cuda_driver)
target_link_libraries(cudf PUBLIC CUDA::cudart)
endif()

# The CUDA::cuda_driver is needed due to JITIFY sources which
# directly call the cuda driver API
if(NOT TARGET CUDA::cuda_driver)
message(FATAL_ERROR "Building libcudf requires `libcuda.so` to be present.
This error often occurs when trying to build libcudf from a container without the NVIDIA runtime loaded.")
endif()
target_link_libraries(cudf PRIVATE CUDA::cuda_driver)

# Add cuFile interface if available
if(TARGET cuFile::cuFile_interface)
target_link_libraries(cudf PRIVATE cuFile::cuFile_interface)
Expand Down