-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdocker-compose.gpu.yml
More file actions
48 lines (46 loc) · 1.9 KB
/
docker-compose.gpu.yml
File metadata and controls
48 lines (46 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# docker-compose.gpu.yml
# Optional overlay for GPU acceleration (NVIDIA)
#
# This overlay enables GPU runtime for celery-worker on systems with NVIDIA GPUs.
# It is automatically detected and loaded by opentr.sh when NVIDIA Container Toolkit
# is available.
#
# Usage:
# ./opentr.sh start dev # Auto-detects GPU and applies if available
# OR manually:
# docker compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.gpu.yml up
#
# Note: This file is automatically included by opentr.sh when NVIDIA GPU is detected.
# On macOS or systems without NVIDIA GPU, this file is not loaded, allowing the base
# docker-compose.yml to work on CPU-only systems.
#
# Configuration:
# GPU_DEVICE_ID - GPU device for AI work in normal mode (default: 0)
# GPU_SCALE_DEVICE_ID - GPU device for AI work in --gpu-scale mode (default: 2)
# Set in .env file: GPU_DEVICE_ID=1
services:
celery-worker:
# Enable NVIDIA runtime for GPU acceleration
# Note: deploy.resources.reservations is preferred over runtime: nvidia
# in newer Docker versions (20.10+) for better compatibility
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
device_ids: ['${GPU_DEVICE_ID:-0}']
celery-cpu-worker:
# GPU access for nvidia-smi stats collection and CUDA-accelerated clustering.
# Uses 'count: all' so it can query ANY GPU device — this is needed because:
# 1. In --gpu-scale mode the active AI GPU is GPU_SCALE_DEVICE_ID (e.g. 2)
# which differs from GPU_DEVICE_ID (e.g. 0)
# 2. Speaker clustering uses GPU_CLUSTERING_DEVICE (falls back to GPU_DEVICE_ID)
# for PyTorch fp16 similarity matrix computation + AHC clustering
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
count: all