diff --git a/docker/Dockerfile b/docker/Dockerfile index 945c7fe3e3..3feff79beb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -162,6 +162,14 @@ RUN pip install multi-storage-client --no-deps COPY requirements.txt /tmp/requirements.txt RUN rm -rf /usr/lib/python3/dist-packages/jwt /usr/lib/python3/dist-packages/PyJWT* && pip install -r /tmp/requirements.txt +# The apt copy shadows the pip one in ldconfig and the loader interleaves the two, +# so transformer_engine gets a mixed set of libcudnn sub-libraries. The packages are +# held, hence --allow-change-held-packages. +RUN if [ "${ENABLE_CUDA_13}" = "1" ]; then CU=13; else CU=12; fi; \ + apt-get remove -y --purge --allow-change-held-packages \ + libcudnn9-cuda-${CU} libcudnn9-dev-cuda-${CU} libcudnn9-headers-cuda-${CU} \ + && rm -rf /var/lib/apt/lists/* + RUN if [ "${ENABLE_CUDA_13}" = "1" ]; then \ pip install nvidia-cudnn-cu13==9.22.0.52; \ else \