diff --git a/gpu/gpu.go b/gpu/gpu.go index 9b3d51b6..57cf7d5d 100644 --- a/gpu/gpu.go +++ b/gpu/gpu.go @@ -39,6 +39,7 @@ var CudaLinuxGlobs = []string{ "/usr/lib/x86_64-linux-gnu/libnvidia-ml.so*", "/usr/lib/wsl/lib/libnvidia-ml.so*", "/opt/cuda/lib64/libnvidia-ml.so*", + "/opt/cuda/targets/x86_64-linux/lib/stubs/libnvidia-ml.so*", "/usr/lib*/libnvidia-ml.so*", "/usr/local/lib*/libnvidia-ml.so*", "/usr/lib/aarch64-linux-gnu/nvidia/current/libnvidia-ml.so*", diff --git a/llm/generate/gen_linux.sh b/llm/generate/gen_linux.sh index f5085bda..0fcf1356 100755 --- a/llm/generate/gen_linux.sh +++ b/llm/generate/gen_linux.sh @@ -108,11 +108,16 @@ else echo "Skipping CPU generation step as requested" fi -if [ -z "${CUDA_LIB_DIR}" ]; then - # Try the default location in case it exists +# If needed, look for the default CUDA toolkit location +if [ -z "${CUDA_LIB_DIR}" ] && [ -d /usr/local/cuda/lib64 ]; then CUDA_LIB_DIR=/usr/local/cuda/lib64 fi +# If needed, look for CUDA on Arch Linux +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 + if [ -d "${CUDA_LIB_DIR}" ]; then echo "CUDA libraries detected - building dynamic CUDA library" init_vars