feat: switch to CPU-only whisper build (no GPU on this machine)
- setup_whisper.py: descarcă build CPU din release-urile oficiale, sare peste Vulkan/CUDA/OpenBLAS - run.bat: elimină env var GGML_VK_PREFER_HOST_MEMORY și check-ul Vulkan SDK - transcribe.py: --no-gpu era deja setat Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
19
run.bat
19
run.bat
@@ -2,8 +2,6 @@
|
|||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
|
||||||
:: Prevent Vulkan from exhausting VRAM — overflow to system RAM instead of crashing
|
|
||||||
set "GGML_VK_PREFER_HOST_MEMORY=ON"
|
|
||||||
|
|
||||||
echo ============================================================
|
echo ============================================================
|
||||||
echo NLP Master - Download + Transcribe Pipeline
|
echo NLP Master - Download + Transcribe Pipeline
|
||||||
@@ -126,21 +124,6 @@ if exist "%WHISPER_MODEL%" (
|
|||||||
set "NEED_MODEL=1"
|
set "NEED_MODEL=1"
|
||||||
)
|
)
|
||||||
|
|
||||||
:: --- Vulkan GPU support ---
|
|
||||||
set "VULKAN_FOUND="
|
|
||||||
where vulkaninfo >nul 2>&1
|
|
||||||
if not errorlevel 1 (
|
|
||||||
set "VULKAN_FOUND=1"
|
|
||||||
echo [OK] Vulkan SDK Installed
|
|
||||||
) else (
|
|
||||||
if exist "%VULKAN_SDK%\Bin\vulkaninfo.exe" (
|
|
||||||
set "VULKAN_FOUND=1"
|
|
||||||
echo [OK] Vulkan SDK %VULKAN_SDK%
|
|
||||||
) else (
|
|
||||||
echo [!!] Vulkan SDK Not detected (whisper.cpp may use CPU fallback^)
|
|
||||||
echo Install from: https://vulkan.lunarg.com/sdk/home
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
:: --- Disk space ---
|
:: --- Disk space ---
|
||||||
echo.
|
echo.
|
||||||
@@ -193,7 +176,7 @@ if exist "ffmpeg-bin\ffmpeg.exe" (
|
|||||||
|
|
||||||
if defined NEED_WHISPER (
|
if defined NEED_WHISPER (
|
||||||
echo ============================================================
|
echo ============================================================
|
||||||
echo Auto-downloading whisper.cpp (Vulkan build^)...
|
echo Auto-downloading whisper.cpp (CPU build^)...
|
||||||
echo ============================================================
|
echo ============================================================
|
||||||
python setup_whisper.py whisper
|
python setup_whisper.py whisper
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Auto-download and setup whisper.cpp (Vulkan) + model for Windows.
|
Auto-download and setup whisper.cpp (CPU build) + model for Windows.
|
||||||
Called by run.bat when prerequisites are missing.
|
Called by run.bat when prerequisites are missing.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -142,8 +142,7 @@ def try_official_vulkan_build() -> str | None:
|
|||||||
tag = release.get("tag_name", "unknown")
|
tag = release.get("tag_name", "unknown")
|
||||||
print(f" Official release: {tag}")
|
print(f" Official release: {tag}")
|
||||||
|
|
||||||
# Priority: vulkan > noavx (cpu-only, no CUDA deps) > skip CUDA entirely
|
# Priority: CPU build (no GPU deps needed)
|
||||||
vulkan_asset = None
|
|
||||||
cpu_asset = None
|
cpu_asset = None
|
||||||
for asset in release.get("assets", []):
|
for asset in release.get("assets", []):
|
||||||
name = asset["name"].lower()
|
name = asset["name"].lower()
|
||||||
@@ -152,28 +151,22 @@ def try_official_vulkan_build() -> str | None:
|
|||||||
# Must be Windows
|
# Must be Windows
|
||||||
if "win" not in name and "x64" not in name:
|
if "win" not in name and "x64" not in name:
|
||||||
continue
|
continue
|
||||||
# Absolutely skip CUDA builds - they won't work on AMD
|
# Skip GPU builds entirely
|
||||||
if "cuda" in name:
|
if "cuda" in name or "vulkan" in name or "openblas" in name:
|
||||||
continue
|
continue
|
||||||
if "vulkan" in name:
|
if "noavx" not in name:
|
||||||
vulkan_asset = asset
|
|
||||||
break
|
|
||||||
if "noavx" not in name and "openblas" not in name:
|
|
||||||
cpu_asset = asset
|
cpu_asset = asset
|
||||||
|
break
|
||||||
|
|
||||||
chosen = vulkan_asset or cpu_asset
|
if not cpu_asset:
|
||||||
if not chosen:
|
print(" No CPU build found in official releases")
|
||||||
print(" No Vulkan or CPU-only build found in official releases")
|
|
||||||
print(" Available assets:")
|
print(" Available assets:")
|
||||||
for asset in release.get("assets", []):
|
for asset in release.get("assets", []):
|
||||||
print(f" - {asset['name']}")
|
print(f" - {asset['name']}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if vulkan_asset:
|
print(f" Found CPU build: {cpu_asset['name']}")
|
||||||
print(f" Found official Vulkan build: {chosen['name']}")
|
chosen = cpu_asset
|
||||||
else:
|
|
||||||
print(f" No Vulkan build in official release, using CPU build: {chosen['name']}")
|
|
||||||
print(f" (Will work but without GPU acceleration)")
|
|
||||||
|
|
||||||
zip_path = Path(chosen["name"])
|
zip_path = Path(chosen["name"])
|
||||||
download_file(chosen["browser_download_url"], zip_path, chosen["name"])
|
download_file(chosen["browser_download_url"], zip_path, chosen["name"])
|
||||||
@@ -182,29 +175,12 @@ def try_official_vulkan_build() -> str | None:
|
|||||||
|
|
||||||
|
|
||||||
def setup_whisper_bin() -> str | None:
|
def setup_whisper_bin() -> str | None:
|
||||||
"""Download whisper.cpp Vulkan release. Returns path to whisper-cli.exe."""
|
"""Download whisper.cpp CPU release. Returns path to whisper-cli.exe."""
|
||||||
whisper_exe = WHISPER_DIR / "whisper-cli.exe"
|
whisper_exe = WHISPER_DIR / "whisper-cli.exe"
|
||||||
if whisper_exe.exists():
|
if whisper_exe.exists():
|
||||||
# Check if it's a CUDA build (has CUDA DLLs but no Vulkan DLL)
|
|
||||||
has_cuda = (WHISPER_DIR / "ggml-cuda.dll").exists()
|
|
||||||
has_vulkan = (WHISPER_DIR / "ggml-vulkan.dll").exists()
|
|
||||||
if has_cuda and not has_vulkan:
|
|
||||||
print(f" WARNING: Existing install is a CUDA build (won't work on AMD GPU)")
|
|
||||||
print(f" Removing and re-downloading Vulkan build...")
|
|
||||||
import shutil
|
|
||||||
shutil.rmtree(WHISPER_DIR)
|
|
||||||
else:
|
|
||||||
print(f" whisper-cli.exe already exists at {whisper_exe}")
|
print(f" whisper-cli.exe already exists at {whisper_exe}")
|
||||||
return str(whisper_exe)
|
return str(whisper_exe)
|
||||||
|
|
||||||
# Strategy: try community Vulkan build first (reliable for AMD),
|
|
||||||
# then fall back to official release
|
|
||||||
exe_path = try_community_vulkan_build()
|
|
||||||
if exe_path:
|
|
||||||
print(f"\n whisper-cli.exe ready at: {exe_path} (Vulkan)")
|
|
||||||
return exe_path
|
|
||||||
|
|
||||||
print("\n Community build failed, trying official release...")
|
|
||||||
exe_path = try_official_vulkan_build()
|
exe_path = try_official_vulkan_build()
|
||||||
if exe_path:
|
if exe_path:
|
||||||
print(f"\n whisper-cli.exe ready at: {exe_path}")
|
print(f"\n whisper-cli.exe ready at: {exe_path}")
|
||||||
@@ -212,7 +188,6 @@ def setup_whisper_bin() -> str | None:
|
|||||||
|
|
||||||
print("\n ERROR: Could not download whisper.cpp")
|
print("\n ERROR: Could not download whisper.cpp")
|
||||||
print(" Manual install: https://github.com/ggml-org/whisper.cpp/releases")
|
print(" Manual install: https://github.com/ggml-org/whisper.cpp/releases")
|
||||||
print(" Build from source with: cmake -DGGML_VULKAN=1")
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user