From cc31b87850f45869225661a9af8fb93862573dfd Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 3 Jun 2026 00:35:47 -0700 Subject: [PATCH] provision_llama_cuda: put Linux dirs first in PATH (WSL interop hygiene) When the installer is launched from a Windows shell, WSL interop leaks the Windows PATH (/mnt/c/... entries, with spaces) into the build environment, which can make cmake/gcc/git resolve to Windows tools or otherwise confuse the CUDA build. Prepend the CUDA toolkit + standard Linux dirs so the Linux toolchain always wins; keep the original PATH after so nvidia-smi etc. still resolve. Co-Authored-By: Claude Opus 4.8 --- studio/scripts/provision_llama_cuda.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/studio/scripts/provision_llama_cuda.sh b/studio/scripts/provision_llama_cuda.sh index fda37b445c..694979ab46 100644 --- a/studio/scripts/provision_llama_cuda.sh +++ b/studio/scripts/provision_llama_cuda.sh @@ -83,7 +83,12 @@ if [ -z "$NVCC" ]; then fi CUDA_HOME="$(dirname "$(dirname "$NVCC")")" -export PATH="$CUDA_HOME/bin:$PATH" +# Put the CUDA toolkit + standard Linux dirs FIRST so the build always uses the +# Linux cmake/gcc/git, never a Windows tool that leaked into PATH via WSL interop +# when the installer is launched from a Windows shell (those /mnt/c entries also +# contain spaces that can confuse the build). Original PATH kept after so things +# like nvidia-smi still resolve. +export PATH="$CUDA_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" export CUDAToolkit_ROOT="$CUDA_HOME" # 4. Host compiler: prefer gcc-14 / g++-14 (nvcc rejects 15).