Skip to content

Commit

Permalink
cuda: search for shared libs in the right dir on Linux
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
  • Loading branch information
cebtenzzre committed May 7, 2024
1 parent 2417105 commit ea6e118
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gpt4all-backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ foreach(BUILD_VARIANT IN LISTS BUILD_VARIANTS)
endif()

if (BUILD_VARIANT STREQUAL cuda)
set(CUDAToolkit_BIN_DIR ${CUDAToolkit_BIN_DIR} PARENT_SCOPE)
set(CUDA_SHARED_LIB_DIR ${CUDA_SHARED_LIB_DIR} PARENT_SCOPE)
endif()
endforeach()

Expand Down
6 changes: 5 additions & 1 deletion gpt4all-backend/llama.cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ function(include_ggml SUFFIX)
endif()

find_package(CUDAToolkit REQUIRED)
set(CUDAToolkit_BIN_DIR ${CUDAToolkit_BIN_DIR} PARENT_SCOPE)
if (WIN32)
set(CUDA_SHARED_LIB_DIR ${CUDAToolkit_BIN_DIR} PARENT_SCOPE)
else()
set(CUDA_SHARED_LIB_DIR ${CUDAToolkit_LIBRARY_DIR} PARENT_SCOPE)
endif()

set(GGML_HEADERS_CUDA ${DIRECTORY}/ggml-cuda.h)

Expand Down
2 changes: 1 addition & 1 deletion gpt4all-chat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ else()
TARGETS llamamodel-mainline-cuda DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}
RUNTIME_DEPENDENCIES PRE_EXCLUDE_REGEXES "^(nvcuda|api-ms-.*)\\.dll$"
POST_INCLUDE_REGEXES "(^|[/\\\\])(lib)?(cuda|cublas)" POST_EXCLUDE_REGEXES .
DIRECTORIES "${CUDAToolkit_BIN_DIR}" # needed on Windows (with MSVC at least)
DIRECTORIES "${CUDA_SHARED_LIB_DIR}"
)
endif()

Expand Down

0 comments on commit ea6e118

Please sign in to comment.