fix: install cuda-compat stubs for build-time PaddlePaddle import

paddlepaddle-gpu needs libcuda.so.1 at import time, but the real NVIDIA
driver is only injected at runtime by the container toolkit. Install
cuda-compat-12-6 which provides forward-compat stubs that satisfy the
dlopen without a real GPU. Also force CPU mode via env vars in the
download script.
This commit is contained in:
Siddharth Kumar Sah
2026-04-10 11:35:50 +08:00
parent b4b59a7500
commit d31d66556e
+9
View File
@@ -118,6 +118,15 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
RUN /opt/venv/bin/pip install seam-carving==1.1.0
# Install CUDA forward-compat stubs for build-time model downloads.
# paddlepaddle-gpu needs libcuda.so.1 to import, but the real driver is
# only injected at runtime by nvidia-container-toolkit. The compat package
# provides a stub that satisfies the dlopen without a real GPU.
RUN if [ "$TARGETARCH" = "amd64" ]; then \
apt-get update && apt-get install -y --no-install-recommends cuda-compat-12-6 && \
rm -rf /var/lib/apt/lists/* \
; fi
# Pre-download and verify all ML models
COPY docker/download_models.py /tmp/download_models.py
RUN /opt/venv/bin/python3 /tmp/download_models.py && rm -f /tmp/download_models.py