Enable GPU: LLM + Whisper on the RTX 5050, pick qwen3:8b
Some checks failed
Release / semantic-release (push) Successful in 19s
tests / Unit tests (Linux, Python 3.11) (push) Successful in 9m54s
Release / build-linux (push) Failing after 7m14s
Release / build-windows (push) Has been cancelled
Release / build-macos (arm64, macos-latest) (push) Has been cancelled
Release / build-macos (x64, macos-15-intel) (push) Has been cancelled
Release / release-main (push) Has been cancelled
Release / release-develop (push) Has been cancelled
Some checks failed
Release / semantic-release (push) Successful in 19s
tests / Unit tests (Linux, Python 3.11) (push) Successful in 9m54s
Release / build-linux (push) Failing after 7m14s
Release / build-windows (push) Has been cancelled
Release / build-macos (arm64, macos-latest) (push) Has been cancelled
Release / build-macos (x64, macos-15-intel) (push) Has been cancelled
Release / release-main (push) Has been cancelled
Release / release-develop (push) Has been cancelled
GPU acceleration is now on by default and verified end-to-end on the Blackwell RTX 5050 (sm_120): - Ollama offloads 100% to GPU (log: library=CUDA compute=12.0, BLACKWELL_NATIVE_FP4=1). compose passes GPU via CDI (devices: nvidia.com/gpu=all) to both ollama and javis. - Whisper STT on GPU: faster-whisper>=1.1.0 + nvidia-cublas/cudnn cu12, LD_LIBRARY_PATH baked into the image. Verified float16 transcribe on sm_120; bridge auto-falls back to CPU when no GPU is present. - Model: default chat model -> qwen3:8b (best 8GB-VRAM tool-calling, ~5GB Q4). Embed stays nomic-embed-text. - README documents the host one-time setup (nvidia-container-toolkit + `nvidia-ctk cdi generate`) and GPU on/off. Verified: image builds; GPU visible in both containers via compose; ollama ps = 100% GPU; faster-whisper cuda OK + CPU fallback OK; bridge /health 200.
This commit is contained in:
@@ -5,12 +5,19 @@
|
||||
|
||||
# --- Brain runtime (imported when the reply engine loads) ---
|
||||
python-dotenv==1.0.1
|
||||
faster-whisper==1.0.3
|
||||
# >=1.1.0 pulls a ctranslate2 with Blackwell (sm_120) CUDA kernels.
|
||||
faster-whisper>=1.1.0
|
||||
mcp==1.13.1
|
||||
numpy<2.0.0
|
||||
rapidfuzz==3.6.1
|
||||
requests==2.32.3
|
||||
|
||||
# --- CUDA libraries for GPU-accelerated Whisper (RTX 5050 / sm_120) ---
|
||||
# ctranslate2 dlopens these at transcribe time; LD_LIBRARY_PATH is set in the
|
||||
# Dockerfile to point at them. Verified working on Blackwell sm_120.
|
||||
nvidia-cublas-cu12
|
||||
nvidia-cudnn-cu12
|
||||
|
||||
# --- Bridge HTTP service ---
|
||||
flask>=3.0.0
|
||||
|
||||
|
||||
@@ -90,7 +90,16 @@ def _ensure_brain():
|
||||
)
|
||||
device = os.environ.get("WHISPER_DEVICE", "auto")
|
||||
compute = os.environ.get("WHISPER_COMPUTE_TYPE", "auto")
|
||||
whisper = WhisperModel(cfg.whisper_model, device=device, compute_type=compute)
|
||||
try:
|
||||
whisper = WhisperModel(cfg.whisper_model, device=device, compute_type=compute)
|
||||
except Exception as ge:
|
||||
# GPU not available / unsupported -> fall back to CPU so the
|
||||
# bridge still works without a GPU passed to the container.
|
||||
if device != "cpu":
|
||||
print(f"[bridge] whisper device='{device}' failed ({ge}); falling back to CPU", flush=True)
|
||||
whisper = WhisperModel(cfg.whisper_model, device="cpu", compute_type="int8")
|
||||
else:
|
||||
raise
|
||||
|
||||
_cfg, _db, _dialogue_memory, _whisper = cfg, db, dialogue_memory, whisper
|
||||
print(f"[bridge] brain ready (chat={cfg.ollama_chat_model}, whisper={cfg.whisper_model})", flush=True)
|
||||
|
||||
Reference in New Issue
Block a user