Skip to content

Commit

Permalink
Fixed missing cuda driver dependency error. (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcgu-amd authored Feb 18, 2025
1 parent 0debd16 commit 669fc3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions HIP-Basic/runtime_compilation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ if(GPU_RUNTIME STREQUAL "CUDA")
# In this example we also need to link nvrtc CUDA library
find_package(CUDAToolkit)
list(APPEND link_libs "CUDA::nvrtc")

find_library(CUDA_DRIVER_LIB cuda)
if(NOT CUDA_DRIVER_LIB)
message(
FATAL_ERROR
"Could not find CUDA Driver library (libcuda.so). Please ensure that the NVIDIA drivers are installed."
)
endif()
list(APPEND link_libs "${CUDA_DRIVER_LIB}")
endif()

target_link_libraries(${example_name} ${link_libs})
Expand Down

0 comments on commit 669fc3e

Please sign in to comment.