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:
@@ -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.
|
||||
"""
|
||||
|
||||
@@ -142,8 +142,7 @@ def try_official_vulkan_build() -> str | None:
|
||||
tag = release.get("tag_name", "unknown")
|
||||
print(f" Official release: {tag}")
|
||||
|
||||
# Priority: vulkan > noavx (cpu-only, no CUDA deps) > skip CUDA entirely
|
||||
vulkan_asset = None
|
||||
# Priority: CPU build (no GPU deps needed)
|
||||
cpu_asset = None
|
||||
for asset in release.get("assets", []):
|
||||
name = asset["name"].lower()
|
||||
@@ -152,28 +151,22 @@ def try_official_vulkan_build() -> str | None:
|
||||
# Must be Windows
|
||||
if "win" not in name and "x64" not in name:
|
||||
continue
|
||||
# Absolutely skip CUDA builds - they won't work on AMD
|
||||
if "cuda" in name:
|
||||
# Skip GPU builds entirely
|
||||
if "cuda" in name or "vulkan" in name or "openblas" in name:
|
||||
continue
|
||||
if "vulkan" in name:
|
||||
vulkan_asset = asset
|
||||
break
|
||||
if "noavx" not in name and "openblas" not in name:
|
||||
if "noavx" not in name:
|
||||
cpu_asset = asset
|
||||
break
|
||||
|
||||
chosen = vulkan_asset or cpu_asset
|
||||
if not chosen:
|
||||
print(" No Vulkan or CPU-only build found in official releases")
|
||||
if not cpu_asset:
|
||||
print(" No CPU build found in official releases")
|
||||
print(" Available assets:")
|
||||
for asset in release.get("assets", []):
|
||||
print(f" - {asset['name']}")
|
||||
return None
|
||||
|
||||
if vulkan_asset:
|
||||
print(f" Found official Vulkan build: {chosen['name']}")
|
||||
else:
|
||||
print(f" No Vulkan build in official release, using CPU build: {chosen['name']}")
|
||||
print(f" (Will work but without GPU acceleration)")
|
||||
print(f" Found CPU build: {cpu_asset['name']}")
|
||||
chosen = cpu_asset
|
||||
|
||||
zip_path = 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:
|
||||
"""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"
|
||||
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}")
|
||||
return str(whisper_exe)
|
||||
print(f" whisper-cli.exe already exists at {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()
|
||||
if 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(" Manual install: https://github.com/ggml-org/whisper.cpp/releases")
|
||||
print(" Build from source with: cmake -DGGML_VULKAN=1")
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user