2021-04-12 09:17:10 +03:00
|
|
|
FROM nvcr.io/nvidia/pytorch:20.12-py3
|
|
|
|
|
2021-06-16 11:47:52 +03:00
|
|
|
# OS:
|
|
|
|
# - Ubuntu: 20.04
|
2021-09-01 13:40:43 +03:00
|
|
|
# - OpenMPI: 4.0.5
|
2021-09-01 11:35:00 +03:00
|
|
|
# - Docker Client: 20.10.8
|
2021-06-16 11:47:52 +03:00
|
|
|
# NVIDIA:
|
|
|
|
# - CUDA: 11.1.1
|
|
|
|
# - cuDNN: 8.0.5
|
2022-02-08 12:59:48 +03:00
|
|
|
# - NCCL: v2.10.3-1
|
2021-06-16 11:47:52 +03:00
|
|
|
# Mellanox:
|
|
|
|
# - OFED: 5.2-2.2.3.0
|
|
|
|
# - HPC-X: v2.8.3
|
|
|
|
# - NCCL RDMA SHARP plugins: 7cccbc1
|
2021-12-13 08:47:42 +03:00
|
|
|
# Intel:
|
|
|
|
# - mlc: v3.9a
|
2021-06-16 11:47:52 +03:00
|
|
|
|
2021-04-12 09:17:10 +03:00
|
|
|
LABEL maintainer="SuperBench"
|
|
|
|
|
2021-06-16 11:47:52 +03:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2021-04-12 09:17:10 +03:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2021-06-16 11:47:52 +03:00
|
|
|
autoconf \
|
|
|
|
automake \
|
2022-12-29 15:19:38 +03:00
|
|
|
bc \
|
2021-04-12 09:17:10 +03:00
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
dmidecode \
|
2021-06-16 11:47:52 +03:00
|
|
|
git \
|
2022-09-06 13:06:05 +03:00
|
|
|
iproute2 \
|
2021-06-16 11:47:52 +03:00
|
|
|
jq \
|
|
|
|
libaio-dev \
|
|
|
|
libcap2 \
|
2021-10-30 06:19:09 +03:00
|
|
|
libnuma-dev \
|
2021-06-16 11:47:52 +03:00
|
|
|
libpci-dev \
|
|
|
|
libtinfo5 \
|
2021-04-12 09:17:10 +03:00
|
|
|
libtool \
|
2021-06-16 11:47:52 +03:00
|
|
|
lshw \
|
2021-04-12 09:17:10 +03:00
|
|
|
net-tools \
|
|
|
|
openssh-client \
|
|
|
|
openssh-server \
|
|
|
|
pciutils \
|
2022-09-06 13:06:05 +03:00
|
|
|
sudo \
|
2021-06-16 11:47:52 +03:00
|
|
|
util-linux \
|
|
|
|
vim \
|
|
|
|
wget \
|
|
|
|
&& \
|
|
|
|
apt-get autoremove && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /opt/cmake-3.14.6-Linux-x86_64
|
2021-04-12 09:17:10 +03:00
|
|
|
|
2022-02-08 12:59:48 +03:00
|
|
|
ARG NUM_MAKE_JOBS=
|
|
|
|
|
2021-09-01 11:35:00 +03:00
|
|
|
# Install Docker
|
|
|
|
ENV DOCKER_VERSION=20.10.8
|
|
|
|
RUN cd /tmp && \
|
2022-07-06 13:31:41 +03:00
|
|
|
wget -q https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
|
2021-09-01 11:35:00 +03:00
|
|
|
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
|
|
|
|
rm docker.tgz
|
|
|
|
|
2021-09-02 16:38:59 +03:00
|
|
|
# Update system config
|
2021-04-12 09:17:10 +03:00
|
|
|
RUN mkdir -p /root/.ssh && \
|
|
|
|
touch /root/.ssh/authorized_keys && \
|
|
|
|
mkdir -p /var/run/sshd && \
|
|
|
|
sed -i "s/[# ]*PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config && \
|
2021-09-02 16:38:59 +03:00
|
|
|
sed -i "s/[# ]*PermitUserEnvironment no/PermitUserEnvironment yes/" /etc/ssh/sshd_config && \
|
2021-04-12 09:17:10 +03:00
|
|
|
sed -i "s/[# ]*Port.*/Port 22/" /etc/ssh/sshd_config && \
|
2022-06-24 17:14:00 +03:00
|
|
|
echo "* soft nofile 1048576\n* hard nofile 1048576" >> /etc/security/limits.conf && \
|
|
|
|
echo "root soft nofile 1048576\nroot hard nofile 1048576" >> /etc/security/limits.conf
|
2021-04-12 09:17:10 +03:00
|
|
|
|
|
|
|
# Install OFED
|
2021-06-16 11:47:52 +03:00
|
|
|
ENV OFED_VERSION=5.2-2.2.3.0
|
2021-04-12 09:17:10 +03:00
|
|
|
RUN cd /tmp && \
|
|
|
|
wget -q http://content.mellanox.com/ofed/MLNX_OFED-${OFED_VERSION}/MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu20.04-x86_64.tgz && \
|
|
|
|
tar xzf MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu20.04-x86_64.tgz && \
|
|
|
|
MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu20.04-x86_64/mlnxofedinstall --user-space-only --without-fw-update --force --all && \
|
|
|
|
rm -rf /tmp/MLNX_OFED_LINUX-${OFED_VERSION}*
|
|
|
|
|
2021-06-16 11:47:52 +03:00
|
|
|
# Install HPC-X
|
|
|
|
RUN cd /opt && \
|
|
|
|
wget -q https://azhpcstor.blob.core.windows.net/azhpc-images-store/hpcx-v2.8.3-gcc-MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu20.04-x86_64.tbz && \
|
|
|
|
tar xf hpcx-v2.8.3-gcc-MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu20.04-x86_64.tbz && \
|
|
|
|
ln -s hpcx-v2.8.3-gcc-MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu20.04-x86_64 hpcx && \
|
|
|
|
rm hpcx-v2.8.3-gcc-MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu20.04-x86_64.tbz
|
|
|
|
|
|
|
|
# Install NCCL RDMA SHARP plugins
|
|
|
|
RUN cd /tmp && \
|
|
|
|
git clone https://github.com/Mellanox/nccl-rdma-sharp-plugins.git && \
|
|
|
|
cd nccl-rdma-sharp-plugins && \
|
|
|
|
git reset --hard 7cccbc1 && \
|
|
|
|
./autogen.sh && \
|
|
|
|
./configure --prefix=/usr/local --with-cuda=/usr/local/cuda && \
|
2022-02-08 12:59:48 +03:00
|
|
|
make -j ${NUM_MAKE_JOBS} && \
|
2021-06-16 11:47:52 +03:00
|
|
|
make install && \
|
|
|
|
cd /tmp && \
|
|
|
|
rm -rf nccl-rdma-sharp-plugins
|
|
|
|
|
|
|
|
# Install NCCL patch
|
|
|
|
RUN cd /tmp && \
|
2022-02-08 12:59:48 +03:00
|
|
|
git clone -b v2.10.3-1 https://github.com/NVIDIA/nccl.git && \
|
2021-06-16 11:47:52 +03:00
|
|
|
cd nccl && \
|
2022-02-08 12:59:48 +03:00
|
|
|
make -j ${NUM_MAKE_JOBS} src.build && \
|
2021-06-16 11:47:52 +03:00
|
|
|
make install && \
|
|
|
|
cd /tmp && \
|
|
|
|
rm -rf nccl
|
|
|
|
|
2021-12-13 08:47:42 +03:00
|
|
|
# Install Intel MLC
|
|
|
|
RUN cd /tmp && \
|
2022-07-06 13:31:41 +03:00
|
|
|
wget -q https://downloadmirror.intel.com/736634/mlc_v3.9a.tgz -O mlc.tgz && \
|
|
|
|
tar xzf mlc.tgz Linux/mlc && \
|
2021-12-13 08:47:42 +03:00
|
|
|
cp ./Linux/mlc /usr/local/bin/ && \
|
2022-06-15 08:07:57 +03:00
|
|
|
rm -rf ./Linux mlc.tgz
|
2021-12-13 08:47:42 +03:00
|
|
|
|
2021-07-16 09:51:56 +03:00
|
|
|
ENV PATH="${PATH}" \
|
2021-06-16 11:47:52 +03:00
|
|
|
LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" \
|
2022-06-15 08:07:57 +03:00
|
|
|
SB_HOME=/opt/superbench \
|
|
|
|
SB_MICRO_PATH=/opt/superbench \
|
|
|
|
ANSIBLE_DEPRECATION_WARNINGS=FALSE \
|
|
|
|
ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
|
2021-04-12 09:17:10 +03:00
|
|
|
|
2022-06-24 11:35:20 +03:00
|
|
|
RUN echo PATH="$PATH" > /etc/environment && \
|
|
|
|
echo LD_LIBRARY_PATH="$LD_LIBRARY_PATH" >> /etc/environment && \
|
|
|
|
echo SB_MICRO_PATH="$SB_MICRO_PATH" >> /etc/environment
|
|
|
|
|
2023-02-13 23:34:37 +03:00
|
|
|
# Install AOCC compiler
|
|
|
|
RUN cd /tmp && \
|
|
|
|
wget https://download.amd.com/developer/eula/aocc-compiler/aocc-compiler-4.0.0_1_amd64.deb && \
|
|
|
|
apt install -y ./aocc-compiler-4.0.0_1_amd64.deb && \
|
|
|
|
rm -rf aocc-compiler-4.0.0_1_amd64.deb
|
|
|
|
|
2023-03-21 19:44:08 +03:00
|
|
|
# Install AMD BLIS
|
|
|
|
RUN cd /tmp && \
|
|
|
|
wget https://download.amd.com/developer/eula/blis/blis-4-0/aocl-blis-linux-aocc-4.0.tar.gz && \
|
|
|
|
tar xzf aocl-blis-linux-aocc-4.0.tar.gz && \
|
|
|
|
mv amd-blis /opt/AMD && \
|
|
|
|
rm -rf aocl-blis-linux-aocc-4.0.tar.gz
|
|
|
|
|
2022-07-13 11:42:53 +03:00
|
|
|
# Add config files
|
|
|
|
ADD dockerfile/etc /opt/microsoft/
|
|
|
|
|
2021-04-12 09:17:10 +03:00
|
|
|
WORKDIR ${SB_HOME}
|
2021-05-17 16:34:15 +03:00
|
|
|
|
2021-06-16 11:47:52 +03:00
|
|
|
ADD third_party third_party
|
2022-06-15 08:07:57 +03:00
|
|
|
RUN make -C third_party cuda
|
2021-06-16 11:47:52 +03:00
|
|
|
|
|
|
|
ADD . .
|
2022-10-31 05:44:41 +03:00
|
|
|
RUN python3 -m pip install --no-cache-dir .[nvworker] && \
|
2022-05-31 20:11:28 +03:00
|
|
|
make cppbuild && \
|
2022-10-31 05:44:41 +03:00
|
|
|
make postinstall && \
|
|
|
|
rm -rf .git
|