From 35c9fa14de95910cc517734941a7040b4caef150 Mon Sep 17 00:00:00 2001 From: BadStorm Developer Date: Sat, 12 Sep 2026 23:25:56 +0200 Subject: [PATCH] fix(omnivoice): join internal network and fix GPU detection race --- containers/omnivoice/entrypoint.sh | 12 ++++++++++++ containers/omnivoice/omnivoice.container | 1 + 2 files changed, 13 insertions(+) diff --git a/containers/omnivoice/entrypoint.sh b/containers/omnivoice/entrypoint.sh index 8e5f4cb..25e302b 100755 --- a/containers/omnivoice/entrypoint.sh +++ b/containers/omnivoice/entrypoint.sh @@ -2,6 +2,18 @@ # Starts the FastAPI server; model weights download on first request into /app/models set -e +# wait for GPU: torch.cuda.is_available() caches its first (possibly premature) result +if [ -e /dev/kfd ]; then + echo "ROCm device detected, waiting for GPU to become available..." + for i in $(seq 1 15); do + if python3 -c "import sys, torch; sys.exit(0 if torch.cuda.is_available() else 1)" 2>/dev/null; then + echo "GPU is available." + break + fi + sleep 1 + done +fi + echo "=== OmniVoice Server ===" echo diff --git a/containers/omnivoice/omnivoice.container b/containers/omnivoice/omnivoice.container index 47982ae..1dfb19d 100644 --- a/containers/omnivoice/omnivoice.container +++ b/containers/omnivoice/omnivoice.container @@ -6,6 +6,7 @@ Wants=network-online.target [Container] Image=localhost/omnivoice:latest ContainerName=omnivoice +Network=internal.network # CPU-only container #Memory=8g