Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Update nccl installation in Dockerfile.build.centos7 #18441

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions ci/docker/Dockerfile.build.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,32 @@ RUN cd /usr/local/src && \
cd /usr/local/src && \
rm -rf ccache

# NCCL is missing on CentOS7 images https://gitlab.com/nvidia/container-images/cuda/-/issues/68
# Install manually if this is a GPU image; different Cuda versions require different NCCL versions
# https://wiki.bash-hackers.org/syntax/pe#search_and_replace
# We need to redeclare ARG due to
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG BASE_IMAGE
RUN export SHORT_CUDA_VERSION=${CUDA_VERSION%.*} && \
if [[ "$BASE_IMAGE" == *"nvidia/cuda"* ]]; then \
if [[ ${SHORT_CUDA_VERSION} == 9.2 ]]; then \
export NCCL_VERSION=2.4.8; \
elif [[ ${SHORT_CUDA_VERSION} == 10.* ]]; then \
export NCCL_VERSION=2.6.4; \
else \
echo "ERROR: Cuda ${SHORT_CUDA_VERSION} not yet supported in Dockerfile.build.centos7"; \
exit 1; \
fi && \
curl -fsSL https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm -O && \
rpm -i nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm && \
yum -y check-update || true && \
yum -y install \
libnccl-${NCCL_VERSION}-1+cuda${SHORT_CUDA_VERSION} \
libnccl-devel-${NCCL_VERSION}-1+cuda${SHORT_CUDA_VERSION} \
libnccl-static-${NCCL_VERSION}-1+cuda${SHORT_CUDA_VERSION} && \
yum clean all; \
fi

# Python dependencies
RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir pylint cython numpy requests h5py scipy==1.2.3 wheel \
Expand Down Expand Up @@ -121,29 +147,3 @@ ENV LC_NUMERIC=en_DK.UTF-8
WORKDIR /work/mxnet

COPY runtime_functions.sh /work/

####################################################################################################
# Specialize base image to install more gpu specific dependencies.
# The target built by docker can be selected via "--target" option or docker-compose.yml
####################################################################################################
FROM base as gpu
# NCCL is missing on CentOS7 images https://gitlab.com/nvidia/container-images/cuda/-/issues/68
# Install manually; different Cuda versions require different NCCL versions
# https://wiki.bash-hackers.org/syntax/pe#search_and_replace
RUN export SHORT_CUDA_VERSION=${CUDA_VERSION%.*} && \
if [[ ${SHORT_CUDA_VERSION} == 9.2 ]]; then \
export NCCL_VERSION=2.4.8; \
elif [[ ${SHORT_CUDA_VERSION} == 10.* ]]; then \
export NCCL_VERSION=2.6.4; \
else \
echo "ERROR: Cuda ${SHORT_CUDA_VERSION} not yet supported in Dockerfile.build.centos7"; \
exit 1; \
fi && \
curl -fsSL https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm -O && \
rpm -i nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm && \
yum -y check-update || true && \
yum -y install \
libnccl-${NCCL_VERSION}-1+cuda${SHORT_CUDA_VERSION} \
libnccl-devel-${NCCL_VERSION}-1+cuda${SHORT_CUDA_VERSION} \
libnccl-static-${NCCL_VERSION}-1+cuda${SHORT_CUDA_VERSION} && \
yum clean all
8 changes: 4 additions & 4 deletions ci/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
build:
context: .
dockerfile: Dockerfile.build.centos7
target: gpu
target: base
args:
BASE_IMAGE: nvidia/cuda:9.2-cudnn7-devel-centos7
cache_from:
Expand All @@ -56,7 +56,7 @@ services:
build:
context: .
dockerfile: Dockerfile.build.centos7
target: gpu
target: base
args:
BASE_IMAGE: nvidia/cuda:10.0-cudnn7-devel-centos7
cache_from:
Expand All @@ -66,7 +66,7 @@ services:
build:
context: .
dockerfile: Dockerfile.build.centos7
target: gpu
target: base
args:
BASE_IMAGE: nvidia/cuda:10.1-cudnn7-devel-centos7
cache_from:
Expand All @@ -76,7 +76,7 @@ services:
build:
context: .
dockerfile: Dockerfile.build.centos7
target: gpu
target: base
args:
BASE_IMAGE: nvidia/cuda:10.2-cudnn7-devel-centos7
cache_from:
Expand Down