Skip to content

Commit

Permalink
Merge pull request ollama#1849 from mraiser/main
Browse files Browse the repository at this point in the history
Accomodate split cuda lib dir
  • Loading branch information
dhiltgen committed Feb 6, 2024
2 parents b9f91a0 + c3f9538 commit 27aa2d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llm/generate/gen_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ if [ -z "${CUDA_LIB_DIR}" ] && [ -d /opt/cuda/targets/x86_64-linux/lib ]; then
CUDA_LIB_DIR=/opt/cuda/targets/x86_64-linux/lib
fi

# Allow override in case libcudart is in the wrong place
if [ -z "${CUDART_LIB_DIR}" ]; then
CUDART_LIB_DIR="${CUDA_LIB_DIR}"
fi

if [ -d "${CUDA_LIB_DIR}" ]; then
echo "CUDA libraries detected - building dynamic CUDA library"
init_vars
Expand All @@ -151,6 +156,8 @@ if [ -d "${CUDA_LIB_DIR}" ]; then
cp "${CUDA_LIB_DIR}/${DEP}" "${BUILD_DIR}/lib/"
elif [ -e "${CUDA_LIB_DIR}/${lib}.${CUDA_MAJOR}" ]; then
cp "${CUDA_LIB_DIR}/${lib}.${CUDA_MAJOR}" "${BUILD_DIR}/lib/"
elif [ -e "${CUDART_LIB_DIR}/${lib}" ]; then
cp -d ${CUDART_LIB_DIR}/${lib}* "${BUILD_DIR}/lib/"
else
cp -d "${CUDA_LIB_DIR}/${lib}*" "${BUILD_DIR}/lib/"
fi
Expand Down

0 comments on commit 27aa2d4

Please sign in to comment.