Files
VoiceStudio/deploy/docker-compose.yml
669ed5ef0d fix(xpu): route integrated Intel Arc unified memory to TTS release (#4480)
* fix(xpu): route integrated Intel Arc unified memory to TTS release

Detect a single integrated Intel Arc XPU by its tiny local_mem_size and
treat it as unified memory, so offload_tts_for_asr() releases the TTS model
via _offload_unified_memory() instead of relocating it CPU<->XPU with
_relocate_shared_model(). Discrete Arc, CUDA, NPU, multi-XPU and unreadable
property cases keep the dedicated path.

The forced clone-reference release is gated on that same detection, so
non-integrated unified hosts (Apple Silicon, CPU-only) keep the old
headroom window; only the integrated Intel Arc case becomes unconditional.

Also wrap the clone-reference auto-transcribe path with
offload_tts_for_asr()/restore_tts_after_asr() so a clone upload no longer
cold-loads WhisperX beside a resident XPU TTS model.

Tests: 20 targeted tests in host; 722 passed and 1 unrelated failure in
the XPU container's full backend suite (the failure is a repo-wide
torch.load audit tripped by untracked .scratch/_appimage trees). Live
two-run verification: POST /profiles clone upload returned 200 in 33 s
twice, logged "Unified memory tight ... releasing the TTS model", host
stayed up.

* docs: record integrated Intel Arc XPU unified-memory fix

* fix(xpu): detect integrated Arc by is_integrated_gpu, serialize unified release and clone ASR restore

* fix(xpu): hold placement through clone reference ASR, skip it when release is refused, document is_integrated_gpu minimum

* fix(xpu): reference-count the clone reference ASR placement hold

* fix(xpu): wait for in-flight TTS load/unload before reference ASR, drop hold on failed release

* test(xpu): release every reference-ASR hold a test takes, and fail any test that leaks one

A forced-release test never restored, so its hold kept exclusive placement and
every later TTS load in the session waited, stalling the Windows suite until
its timeout. The hold reset now runs for every test in the file, and a
backend/tests guard fails and clears any leaked hold, placement or in-flight
TTS op.

---------

Co-authored-by: gottabstrong <312960339+gottabstrong@users.noreply.github.com>
Co-authored-by: debpalash <4178343+debpalash@users.noreply.github.com>
2026-11-26 11:18:31 -08:00

162 lines
6.9 KiB
YAML

# ──────────────────────────────────────────────────────────────
# VoiceStudio — Docker Compose
#
# Quick start:
# docker compose -f deploy/docker-compose.yml --profile cpu up # CPU mode
# docker compose -f deploy/docker-compose.yml --profile gpu up # NVIDIA GPU
# docker compose -f deploy/docker-compose.yml --profile rocm up # AMD GPU (ROCm)
#
# Intel Arc XPU: no compose profile or image exists (published images are
# CPU/CUDA/ROCm); run VoiceStudio natively on Intel Arc hosts.
#
# The Studio services publish the UI on loopback and the authenticated TLS
#
# First run downloads ~4 GB of models. Progress is shown in logs.
# Open http://localhost:3900 once the health check passes.
#
# Images: `:stable` / `:stable-rocm` are the latest tagged release; use
# `:latest` / `:rocm` to follow the rolling preview built from main.
#
# SECURITY: The port is bound to 127.0.0.1 by default — only this
# machine can reach the published API port. For host-managed Tailscale Serve,
# keep loopback publishing and follow docs/install/docker.md#private-remote-access-with-tailscale;
# no host CLI/socket mounts are needed. Direct LAN publishing instead needs
# an explicit mapping such as "0.0.0.0:3900:3900". Export a long random
# OMNIVOICE_API_KEY before starting a Studio profile; use HTTPS or an
# encrypted private overlay whenever traffic leaves a fully trusted LAN.
# ──────────────────────────────────────────────────────────────
services:
# ── CPU mode — activate with: docker compose --profile cpu up
omnivoice:
image: ghcr.io/debpalash/voicestudio:stable
# To build from source instead of pulling, comment out `image:` and
# uncomment the three lines below:
# build:
# context: ..
# dockerfile: deploy/Dockerfile
container_name: omnivoice-studio
profiles: ["cpu"]
ports:
- "127.0.0.1:3900:3900"
volumes:
- omnivoice-data:/app/omnivoice_data
environment:
- HF_HOME=/app/omnivoice_data/huggingface
- HF_TOKEN=${HF_TOKEN:-}
- OMNIVOICE_DATA_DIR=/app/omnivoice_data
- PYTHONPATH=/app/backend
- PYTHONUNBUFFERED=1
# The image's uvicorn ENTRYPOINT binds 0.0.0.0 *inside* the container so
# the host-side port mapping above can forward traffic in. The 127.0.0.1
# prefix on the `ports:` mapping is what enforces loopback-only on the
# host.
# Headless server: relax the desktop-only loopback origin gate so the
# web UI's /system/* and /api/settings/* routes work through Docker's
# NAT (issue #261). Already baked into the image; shown here so it's
# discoverable. If you front the container with your own auth proxy on
# loopback, set this to 0 to re-enable the strict gate.
- OMNIVOICE_SERVER_MODE=1
# Required for server-mode settings, diagnostics, and other admin
# mutations because Docker NAT cannot prove a browser is loopback.
- OMNIVOICE_API_KEY=${OMNIVOICE_API_KEY:?export a long random OMNIVOICE_API_KEY before starting a Studio profile}
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:3900/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
restart: unless-stopped
# ── GPU mode — activate with: docker compose --profile gpu up
omnivoice-gpu:
image: ghcr.io/debpalash/voicestudio:stable
# To build from source, swap `image:` for the commented `build:` lines.
# build:
# context: ..
# dockerfile: deploy/Dockerfile
container_name: omnivoice-studio-gpu
profiles: ["gpu"]
ports:
- "127.0.0.1:3900:3900"
volumes:
- omnivoice-data:/app/omnivoice_data
environment:
- HF_HOME=/app/omnivoice_data/huggingface
- HF_TOKEN=${HF_TOKEN:-}
- OMNIVOICE_DATA_DIR=/app/omnivoice_data
- PYTHONPATH=/app/backend
- PYTHONUNBUFFERED=1
# Container-internal 0.0.0.0 bind comes from the image ENTRYPOINT — same
# as the CPU service above. The host-side `127.0.0.1:3900:3900` mapping
# keeps LAN reachability off by default.
# See the CPU service above — relaxes the loopback origin gate for the
# headless Docker deployment (issue #261). Set to 0 to re-enable it.
- OMNIVOICE_SERVER_MODE=1
- OMNIVOICE_API_KEY=${OMNIVOICE_API_KEY:?export a long random OMNIVOICE_API_KEY before starting a Studio profile}
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:3900/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 180s
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
# ── AMD GPU (ROCm) mode — activate with: docker compose --profile rocm up
# Uses the dedicated `:rocm` image variant (#1165). The GPU is passed
# through as plain device nodes — no toolkit needed, the host only needs
# the amdgpu kernel driver (the ROCm userspace ships inside the image).
# Podman works with the same two --device flags (Quadlet: AddDevice=).
omnivoice-rocm:
image: ghcr.io/debpalash/voicestudio:stable-rocm
# To build from source instead of pulling, comment out `image:` and
# uncomment the lines below. BASE_IMAGE/GPU_FLAVOR are required — the
# Dockerfile's defaults build the CUDA variant.
# build:
# context: ..
# dockerfile: deploy/Dockerfile
# args:
# BASE_IMAGE: rocm/pytorch:rocm7.2.4_ubuntu24.04_py3.12_pytorch_release_2.10.0
# GPU_FLAVOR: rocm
container_name: omnivoice-studio-rocm
profiles: ["rocm"]
ports:
- "127.0.0.1:3900:3900"
devices:
- /dev/kfd
- /dev/dri
volumes:
- omnivoice-data:/app/omnivoice_data
environment:
- HF_HOME=/app/omnivoice_data/huggingface
- HF_TOKEN=${HF_TOKEN:-}
- OMNIVOICE_DATA_DIR=/app/omnivoice_data
- PYTHONPATH=/app/backend
- PYTHONUNBUFFERED=1
# See the CPU service above — relaxed loopback origin gate for the
# headless Docker deployment.
- OMNIVOICE_SERVER_MODE=1
- OMNIVOICE_API_KEY=${OMNIVOICE_API_KEY:?export a long random OMNIVOICE_API_KEY before starting a Studio profile}
# RDNA3 consumer cards (RX 7900 XTX/XT and friends, gfx1100): if the
# GPU is not detected, uncomment the override below. The backend
# auto-sets a same-generation value when the build lacks your card, so
# try without it first. Never set it on RX 9000 (RDNA4) cards.
# - HSA_OVERRIDE_GFX_VERSION=11.0.0
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:3900/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 180s
restart: unless-stopped
volumes:
omnivoice-data: