From d31d66556ef0aa7c20a73a94f5d95b54b99fbb8a Mon Sep 17 00:00:00 2001 From: Siddharth Kumar Sah Date: Fri, 10 Apr 2026 11:35:50 +0800 Subject: [PATCH] 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. --- docker/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9ccbe018..51efc6a9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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