Switch nvidia and rocm Dockerfiles from onnxruntime to torch

Nvidia: install torch+torchvision from PyTorch cu130 index, drop
onnxruntime-gpu. ROCm: use local torch wheel with rocm6.4 index for
torchvision, clean up nvidia remnants from the venv.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 16:13:41 +01:00
parent bb78f4ea80
commit 17b19999de
2 changed files with 8 additions and 3 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ COPY VERSION ./
RUN uv venv .venv && \ RUN uv venv .venv && \
. .venv/bin/activate && \ . .venv/bin/activate && \
uv pip install -e . && \ UV_HTTP_TIMEOUT=600 uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu130 && \
uv pip install --no-deps onnxruntime-gpu uv pip install -e .
ENV PATH="/app/.venv/bin:$PATH" ENV PATH="/app/.venv/bin:$PATH"
ENV VIRTUAL_ENV="/app/.venv" ENV VIRTUAL_ENV="/app/.venv"
+6 -1
View File
@@ -18,10 +18,15 @@ COPY kb/ kb/
COPY main.py ./ COPY main.py ./
COPY VERSION ./ COPY VERSION ./
COPY torch-*.whl /tmp/
RUN uv venv .venv && \ RUN uv venv .venv && \
. .venv/bin/activate && \ . .venv/bin/activate && \
uv pip install /tmp/torch-*.whl --extra-index-url https://download.pytorch.org/whl/rocm6.4 && \
uv pip install torchvision --index-url https://download.pytorch.org/whl/rocm6.4 && \
uv pip install -e . && \ uv pip install -e . && \
uv pip install --no-deps onnxruntime-rocm rm /tmp/torch-*.whl && \
rm -rf .venv/lib/python3.12/site-packages/nvidia
# Stage 2: Runtime — minimal ROCm runtime libs only # Stage 2: Runtime — minimal ROCm runtime libs only
FROM ubuntu:24.04 FROM ubuntu:24.04