Skip to content

Commit f2f8a69

Browse files
ambsdclaude
andcommitted
build: Add CUDA devel image and compilers for torch.compile
- Switch from cuda runtime to devel image for Triton support - Add gcc/g++ compilers needed for Triton inductor backend - Add python3.11-dev for building native extensions - Add TORCHINDUCTOR_CACHE_DIR for kernel caching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d65cd1c commit f2f8a69

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN npm run build
2323
# =============================================================================
2424
# Stage 2: Final Image with Python + CUDA
2525
# =============================================================================
26-
FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
26+
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
2727

2828
# Prevent interactive prompts during package installation
2929
ENV DEBIAN_FRONTEND=noninteractive
@@ -32,10 +32,13 @@ ENV DEBIAN_FRONTEND=noninteractive
3232
RUN apt-get update && apt-get install -y --no-install-recommends \
3333
python3.11 \
3434
python3.11-venv \
35+
python3.11-dev \
3536
python3-pip \
3637
git \
3738
ffmpeg \
3839
libsndfile1 \
40+
gcc \
41+
g++ \
3942
&& rm -rf /var/lib/apt/lists/* \
4043
&& ln -sf /usr/bin/python3.11 /usr/bin/python3 \
4144
&& ln -sf /usr/bin/python3.11 /usr/bin/python
@@ -71,7 +74,8 @@ ENV PYTHONUNBUFFERED=1 \
7174
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
7275
HEARTMULA_4BIT=auto \
7376
HEARTMULA_SEQUENTIAL_OFFLOAD=auto \
74-
HF_HOME=/app/backend/models
77+
HF_HOME=/app/backend/models \
78+
TORCHINDUCTOR_CACHE_DIR=/app/backend/models/.torch_cache
7579

7680
# Expose port
7781
EXPOSE 8000

0 commit comments

Comments
 (0)