Hey everyone, I got whisper.cpp running as a dockerized STT server on the DGX Spark and wanted to share the full process since there are a few non-obvious gotchas specific to this platform.
System
-
Lenovo ThinkStation PGX / NVIDIA DGX Spark
-
GB10 Blackwell Superchip, SM 12.1
-
CUDA 13.0, Ubuntu 24.04 (DGX OS)
-
whisper.cpp v1.8.4
Step 1: Clone the repo
There are no pre-built ARM64+CUDA binaries in the whisper.cpp releases, so you need to build from source inside Docker.
bash
git clone --depth 1 --branch v1.8.4 https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
Step 2: Download a model
bash
wget -P ./models \
https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo.bin
large-v3-turbo is a great choice — same encoder quality as large-v3 but with a much faster 4-layer decoder. For lower latency use cases, small or medium also work well.
Step 3: Set up .dockerignore
whisper.cpp ships with a .dockerignore that blocks the build directory. Replace it to keep the build context clean:
bash
cat > .dockerignore << 'EOF'
.git
.hermes
models
build
*.bin
*.log
EOF
Step 4: Create the Dockerfile
Several gotchas specific to the DGX Spark:
-
Don’t use
nvcr.io/nvidia/cuda— ARM64 tags aren’t available there. Usedocker.io/nvidia/cudainstead. -
Use Ubuntu 24.04, not 22.04. The DGX OS ships with GLIBC 2.38; Ubuntu 22.04 containers only have GLIBC 2.35 and will fail with
version GLIBC_2.38 not found. -
Build inside the container — copying host-compiled binaries into a container will fail with
CUDA error: no kernel image is available for execution on the device. -
Target both
120and121— the GB10 is SM 12.1. Using only120compiles forsm_120awhich is not compatible. You must specify"120;121". -
Only build the
whisper-servertarget — building everything fails becauselibcuda.so.1is a driver library not available at image build time. -
Use CUDA stubs for linking at build time.
dockerfile
FROM nvidia/cuda:13.0.3-devel-ubuntu24.04
RUN apt-get update && apt-get install -y \
build-essential cmake git libgomp1 ffmpeg && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN rm -rf build && \
cmake -B build \
-DGGML_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES="120;121" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/cuda/lib64/stubs -lcuda" && \
cmake --build build --target whisper-server -j$(nproc)
COPY models/ggml-large-v3-turbo.bin ./models/
EXPOSE 9000
ENTRYPOINT ["./build/bin/whisper-server"]
bash
docker build -f Dockerfile.whisper -t whisper-server .
Step 5: Docker Compose
Use the deploy.resources style for GPU access — runtime: nvidia throws unknown or invalid runtime name: nvidia on DGX OS:
yaml
services:
whisper-server:
image: whisper-server
container_name: whisper-server
environment:
- NVIDIA_VISIBLE_DEVICES=all
ports:
- "9000:9000"
command: >
--model /app/models/ggml-large-v3-turbo.bin
--host 0.0.0.0
--port 9000
--flash-attn
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
bash
docker compose up -d whisper-server
curl http://localhost:9000/health
Expected output on success
ggml_cuda_init: found 1 CUDA devices (Total VRAM: 122502 MiB):
Device 0: NVIDIA GB10, compute capability 12.1, VMM: yes
whisper_model_load: CUDA0 total size = 1623.92 MB
whisper_backend_init_gpu: using CUDA0 backend
whisper_init_with_params_no_state: flash attn = 1
whisper server listening at http://0.0.0.0:9000
Step 6: Test it
From the DGX itself:
bash
curl http://localhost:9000/inference \
-F "file=@/home/admin/whisper.cpp/samples/jfk.wav" \
-F "language=en" \
-F "response_format=json"
From any machine on the network using Python — no need to copy files to the DGX, just stream them directly:
python
import requests
url = "http://<DGX-LAN-IP>:9000/inference" # e.g. 192.168.2.148
with open("audio.wav", "rb") as f:
response = requests.post(
url,
files={"file": ("audio.wav", f, "audio/wav")},
data={
"language": "en", # or "ja" for Japanese etc.
"response_format": "json",
}
)
print(response.json()["text"])
Summary of gotchas
| Issue | Fix |
|---|---|
| No ARM64 pre-built binaries | Build from source inside Docker |
nvcr.io has no ARM64 tags |
Use docker.io/nvidia/cuda |
| GLIBC 2.38 mismatch | Use ubuntu24.04 base image |
CUDA error: no kernel image |
Build inside container, target "120;121" not just "120" |
libcuda.so.1 not found at build time |
Use --target whisper-server + CUDA stubs |
.dockerignore blocks build context |
Replace .dockerignore before building |
runtime: nvidia not recognized |
Use deploy.resources in compose |
Hope this saves someone a few hours. Happy to answer questions!