From 9226ea1c6c48e09eacf87fb936ef18bb2c547a55 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 29 Jan 2024 01:52:44 -0500 Subject: [PATCH 1/4] install cu11 pytorch in the cu11 image --- 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..64c0b7f365 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 export PIP_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 \ From 30fa1e76cd879ca09624001f4cdf12db823a539f Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 29 Jan 2024 02:21:56 -0500 Subject: [PATCH 2/4] add missing \ --- source/install/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/install/docker/Dockerfile b/source/install/docker/Dockerfile index 64c0b7f365..413454742b 100644 --- a/source/install/docker/Dockerfile +++ b/source/install/docker/Dockerfile @@ -6,7 +6,7 @@ RUN python -m venv /opt/deepmd-kit ENV PATH="/opt/deepmd-kit/bin:$PATH" # Install package COPY dist /dist -RUN if [ ${CUDA_VERSION} = 11 ]; then export PIP_INDEX_URL=https://download.pytorch.org/whl/cu118; fi +RUN if [ ${CUDA_VERSION} = 11 ]; then export PIP_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 \ From 3e13cbabf799d3850e2548c34d74287264b0981b Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 29 Jan 2024 02:25:17 -0500 Subject: [PATCH 3/4] add a quote --- source/install/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/install/docker/Dockerfile b/source/install/docker/Dockerfile index 413454742b..59017c4dc6 100644 --- a/source/install/docker/Dockerfile +++ b/source/install/docker/Dockerfile @@ -6,7 +6,7 @@ RUN python -m venv /opt/deepmd-kit ENV PATH="/opt/deepmd-kit/bin:$PATH" # Install package COPY dist /dist -RUN if [ ${CUDA_VERSION} = 11 ]; then export PIP_INDEX_URL=https://download.pytorch.org/whl/cu118; fi \ +RUN if [ "${CUDA_VERSION}" = 11 ]; then export PIP_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 \ From 75dc2a267bab39ea95703cf3974bf7e58c268362 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 29 Jan 2024 02:46:16 -0500 Subject: [PATCH 4/4] it looks `--index-url` will override the original one Signed-off-by: Jinzhe Zeng --- source/install/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/install/docker/Dockerfile b/source/install/docker/Dockerfile index 59017c4dc6..1e25fbb6d3 100644 --- a/source/install/docker/Dockerfile +++ b/source/install/docker/Dockerfile @@ -6,7 +6,7 @@ RUN python -m venv /opt/deepmd-kit ENV PATH="/opt/deepmd-kit/bin:$PATH" # Install package COPY dist /dist -RUN if [ "${CUDA_VERSION}" = 11 ]; then export PIP_INDEX_URL=https://download.pytorch.org/whl/cu118; fi \ +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 \