aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/patches/qwentts.cpp.patch
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/patches/qwentts.cpp.patch')
-rw-r--r--vendor/patches/qwentts.cpp.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/vendor/patches/qwentts.cpp.patch b/vendor/patches/qwentts.cpp.patch
new file mode 100644
index 0000000..fea7dec
--- /dev/null
+++ b/vendor/patches/qwentts.cpp.patch
@@ -0,0 +1,41 @@
+diff --git a/buildall.sh b/buildall.sh
+index 8ce58a6..a461d07 100755
+--- a/buildall.sh
++++ b/buildall.sh
+@@ -4,7 +4,15 @@ rm -rf build
+ mkdir build
+ cd build
+
+-export PATH=/usr/local/cuda/bin:$PATH
++# Find nvcc: honor CUDACXX/PATH, then fall back to common install locations
++NVCC="${CUDACXX:-$(command -v nvcc)}"
++if [ -z "$NVCC" ]; then
++ for c in /opt/cuda/bin/nvcc /usr/local/cuda/bin/nvcc; do
++ [ -x "$c" ] && NVCC="$c" && break
++ done
++fi
++# Make sure the detected CUDA bin dir is on PATH for the rest of the toolkit
++[ -n "$NVCC" ] && export PATH="$(dirname "$NVCC"):$PATH"
+
+-cmake .. -DGGML_CPU_ALL_VARIANTS=ON -DGGML_CUDA=ON -DGGML_VULKAN=ON -DGGML_BACKEND_DL=ON
++cmake .. -DGGML_CPU_ALL_VARIANTS=ON -DGGML_CUDA=ON -DGGML_VULKAN=ON -DGGML_BACKEND_DL=ON ${NVCC:+-DCMAKE_CUDA_COMPILER="$NVCC"}
+ cmake --build . --config Release -j "$(nproc)"
+diff --git a/buildcuda.sh b/buildcuda.sh
+index 67f711f..242bb39 100755
+--- a/buildcuda.sh
++++ b/buildcuda.sh
+@@ -4,5 +4,13 @@ rm -rf build
+ mkdir build
+ cd build
+
+-cmake .. -DGGML_CUDA=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
++# Find nvcc: honor CUDACXX/PATH, then fall back to common install locations
++NVCC="${CUDACXX:-$(command -v nvcc)}"
++if [ -z "$NVCC" ]; then
++ for c in /opt/cuda/bin/nvcc /usr/local/cuda/bin/nvcc; do
++ [ -x "$c" ] && NVCC="$c" && break
++ done
++fi
++
++cmake .. -DGGML_CUDA=ON ${NVCC:+-DCMAKE_CUDA_COMPILER="$NVCC"}
+ cmake --build . --config Release -j "$(nproc)"