From 4a29c8c77771917bb67a6151f8c7fd82a1764b56 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 29 Jan 2024 05:32:23 -0500 Subject: [PATCH] fix: install CU11 PyTorch in the CU11 docker image (#3198) The default one from PyPI is for CU12. --------- Signed-off-by: Jinzhe Zeng --- source/install/docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/install/docker/Dockerfile b/source/install/docker/Dockerfile index 793272ae6a..1e25fbb6d3 100644 --- a/source/install/docker/Dockerfile +++ b/source/install/docker/Dockerfile @@ -6,7 +6,8 @@ RUN python -m venv /opt/deepmd-kit ENV PATH="/opt/deepmd-kit/bin:$PATH" # Install package COPY dist /dist -RUN pip install "$(ls /dist/deepmd_kit${VARIANT}-*manylinux*_x86_64.whl)[gpu,cu${CUDA_VERSION},lmp,ipi,torch]" \ +RUN if [ "${CUDA_VERSION}" = 11 ]; then pip install torch --index-url https://download.pytorch.org/whl/cu118; fi \ + && pip install "$(ls /dist/deepmd_kit${VARIANT}-*manylinux*_x86_64.whl)[gpu,cu${CUDA_VERSION},lmp,ipi,torch]" \ && dp -h \ && lmp -h \ && dp_ipi \