From a80dfa5c103eb82681fc274e0d1b40345b379fe0 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sun, 8 Jun 2025 01:11:42 +0800 Subject: [PATCH] various minor fixes --- Makefile | 57 +++++++++++++++++++++++++++++++++++++++------------- colab.ipynb | 4 ++-- koboldcpp.sh | 4 ++-- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 33a626739..e762f9327 100644 --- a/Makefile +++ b/Makefile @@ -714,19 +714,31 @@ ifeq ($(OS),Windows_NT) @echo 'Vulkan Shaders Rebuilt for Windows...' else @echo 'Now rebuilding vulkan shaders for Linux...' + @chmod +x vulkan-shaders-gen @echo 'Checking if system glslc-linux binary is usable...' @GLSLC_BIN=$$( \ - if command -v glslc >/dev/null 2>&1 && glslc --version 2>/dev/null | grep -q "glslang"; then \ - echo "glslc"; \ - elif [ -x ./glslc-linux ]; then \ + if [ -n "$$LLAMA_USE_BUNDLED_GLSLC" ]; then \ chmod +x ./glslc-linux; \ - if ./glslc-linux --version 2>/dev/null | grep -q "glslang"; then \ + if [ -x ./glslc-linux ] && ./glslc-linux --version 2>/dev/null | grep -q "glslang"; then \ echo "./glslc-linux"; \ + elif command -v glslc >/dev/null 2>&1; then \ + echo "glslc"; \ else \ echo ""; \ fi; \ else \ - echo ""; \ + if command -v glslc >/dev/null 2>&1 && glslc --version 2>/dev/null | grep -q "glslang"; then \ + echo "glslc"; \ + elif [ -x ./glslc-linux ]; then \ + chmod +x ./glslc-linux; \ + if ./glslc-linux --version 2>/dev/null | grep -q "glslang"; then \ + echo "./glslc-linux"; \ + else \ + echo ""; \ + fi; \ + else \ + echo ""; \ + fi; \ fi); \ if [ -z "$$GLSLC_BIN" ]; then \ echo "Error: No usable glslc found. Vulkan shaders cannot be compiled!"; \ @@ -746,15 +758,32 @@ ifeq ($(OS),Windows_NT) @echo 'Vulkan Shaders (no extensions) Rebuilt for Windows...' else @echo 'Now rebuilding vulkan shaders (no extensions) for Linux...' - @chmod +x vulkan-shaders-gen-noext glslc-linux - @echo 'Checking if bundled glslc-linux binary is usable...' - @GLSLC_BIN=$$(if ./glslc-linux --version >/dev/null 2>&1; then \ - echo "./glslc-linux"; \ - elif command -v glslc >/dev/null 2>&1; then \ - echo "glslc"; \ - else \ - echo ""; \ - fi); \ + @chmod +x vulkan-shaders-gen-noext + @echo 'Checking if system glslc-linux binary is usable...' + @GLSLC_BIN=$$( \ + if [ -n "$$LLAMA_USE_BUNDLED_GLSLC" ]; then \ + chmod +x ./glslc-linux; \ + if [ -x ./glslc-linux ] && ./glslc-linux --version 2>/dev/null | grep -q "glslang"; then \ + echo "./glslc-linux"; \ + elif command -v glslc >/dev/null 2>&1; then \ + echo "glslc"; \ + else \ + echo ""; \ + fi; \ + else \ + if command -v glslc >/dev/null 2>&1 && glslc --version 2>/dev/null | grep -q "glslang"; then \ + echo "glslc"; \ + elif [ -x ./glslc-linux ]; then \ + chmod +x ./glslc-linux; \ + if ./glslc-linux --version 2>/dev/null | grep -q "glslang"; then \ + echo "./glslc-linux"; \ + else \ + echo ""; \ + fi; \ + else \ + echo ""; \ + fi; \ + fi); \ if [ -z "$$GLSLC_BIN" ]; then \ echo "Error: No usable glslc found. Vulkan shaders (no extensions) cannot be compiled!"; \ else \ diff --git a/colab.ipynb b/colab.ipynb index d56deac47..05d6d1278 100644 --- a/colab.ipynb +++ b/colab.ipynb @@ -53,7 +53,7 @@ "ContextSize = 4096 #@param [4096,8192] {allow-input: true}\n", "FlashAttention = True #@param {type:\"boolean\"}\n", "Multiplayer = False #@param {type:\"boolean\"}\n", - "DeleteExistingModels = False #@param {type:\"boolean\"}\n", + "DeleteExistingModels = True #@param {type:\"boolean\"}\n", "FACommand = \"\"\n", "MPCommand = \"\"\n", "#@markdown
\n", @@ -146,7 +146,7 @@ "\n", "if DeleteExistingModels:\n", " print(\"Deleting all cached models to redownload...\")\n", - " patterns = ['*.gguf', '*.bin']\n", + " patterns = ['*.gguf', '*.bin', '*.ggml']\n", " for pattern in patterns:\n", " for file_path in glob.glob(pattern):\n", " try:\n", diff --git a/koboldcpp.sh b/koboldcpp.sh index 8b6144c20..456be4da5 100755 --- a/koboldcpp.sh +++ b/koboldcpp.sh @@ -40,9 +40,9 @@ if [ -n "$ARCHES_CU12" ]; then fi if [ "$KCPP_CUDA" = "rocm" ]; then - bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_HIPBLAS=1 LLAMA_PORTABLE=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX2_FLAG $ARCHES_FLAG + bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_HIPBLAS=1 LLAMA_PORTABLE=1 LLAMA_USE_BUNDLED_GLSLC=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX2_FLAG $ARCHES_FLAG else - bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_CUBLAS=1 LLAMA_PORTABLE=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX2_FLAG $ARCHES_FLAG + bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_CUBLAS=1 LLAMA_PORTABLE=1 LLAMA_USE_BUNDLED_GLSLC=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX2_FLAG $ARCHES_FLAG fi if [ $? -ne 0 ]; then