2023-11-22 16:48:18 +03:00
|
|
|
FROM nvcr.io/nvidia/pytorch:23.10-py3
|
2022-12-29 15:19:38 +03:00
|
|
|
|
|
|
|
# OS:
|
2023-11-22 16:48:18 +03:00
|
|
|
# - Ubuntu: 22.04
|
|
|
|
# - OpenMPI: 4.1.5rc2
|
2022-12-29 15:19:38 +03:00
|
|
|
# - Docker Client: 20.10.8
|
|
|
|
# NVIDIA:
|
2023-11-22 16:48:18 +03:00
|
|
|
# - CUDA: 12.2.2
|
|
|
|
# - cuDNN: 8.9.5
|
2024-01-08 08:40:52 +03:00
|
|
|
# - NCCL: v2.18.3-1
|
2022-12-29 15:19:38 +03:00
|
|
|
# Mellanox:
|
2023-11-22 16:48:18 +03:00
|
|
|
# - OFED: 23.07-0.5.1.2
|
|
|
|
# - HPC-X: v2.16
|
2022-12-29 15:19:38 +03:00
|
|
|
# Intel:
|
2024-04-18 05:59:36 +03:00
|
|
|
# - mlc: v3.11
|
2022-12-29 15:19:38 +03:00
|
|
|
|
|
|
|
LABEL maintainer="SuperBench"
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
bc \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
dmidecode \
|
2023-08-22 13:56:33 +03:00
|
|
|
ffmpeg \
|
2022-12-29 15:19:38 +03:00
|
|
|
git \
|
|
|
|
iproute2 \
|
|
|
|
jq \
|
|
|
|
libaio-dev \
|
2023-08-22 13:56:33 +03:00
|
|
|
libavcodec-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavutil-dev \
|
2022-12-29 15:19:38 +03:00
|
|
|
libboost-program-options-dev \
|
|
|
|
libcap2 \
|
2023-12-07 14:57:28 +03:00
|
|
|
libcurl4-openssl-dev \
|
2022-12-29 15:19:38 +03:00
|
|
|
libnuma-dev \
|
|
|
|
libpci-dev \
|
2023-08-22 13:56:33 +03:00
|
|
|
libswresample-dev \
|
2022-12-29 15:19:38 +03:00
|
|
|
libtinfo5 \
|
|
|
|
libtool \
|
|
|
|
lshw \
|
2023-12-07 04:37:09 +03:00
|
|
|
python3-mpi4py \
|
2022-12-29 15:19:38 +03:00
|
|
|
net-tools \
|
2023-12-07 14:57:28 +03:00
|
|
|
nlohmann-json3-dev \
|
2022-12-29 15:19:38 +03:00
|
|
|
openssh-client \
|
|
|
|
openssh-server \
|
|
|
|
pciutils \
|
|
|
|
sudo \
|
|
|
|
util-linux \
|
|
|
|
vim \
|
|
|
|
wget \
|
|
|
|
&& \
|
|
|
|
apt-get autoremove && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/*
|
|
|
|
|
|
|
|
ARG NUM_MAKE_JOBS=
|
|
|
|
|
|
|
|
# Install Docker
|
|
|
|
ENV DOCKER_VERSION=20.10.8
|
|
|
|
RUN cd /tmp && \
|
|
|
|
wget -q https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
|
|
|
|
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
|
|
|
|
rm docker.tgz
|
|
|
|
|
|
|
|
# Update system config
|
|
|
|
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 && \
|
|
|
|
sed -i "s/[# ]*PermitUserEnvironment no/PermitUserEnvironment yes/" /etc/ssh/sshd_config && \
|
|
|
|
sed -i "s/[# ]*Port.*/Port 22/" /etc/ssh/sshd_config && \
|
|
|
|
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
|
|
|
|
|
|
|
|
# Install OFED
|
2023-11-22 16:48:18 +03:00
|
|
|
ENV OFED_VERSION=23.07-0.5.1.2
|
2022-12-29 15:19:38 +03:00
|
|
|
RUN cd /tmp && \
|
2023-11-22 16:48:18 +03:00
|
|
|
wget -q https://content.mellanox.com/ofed/MLNX_OFED-${OFED_VERSION}/MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu22.04-x86_64.tgz && \
|
|
|
|
tar xzf MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu22.04-x86_64.tgz && \
|
|
|
|
MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu22.04-x86_64/mlnxofedinstall --user-space-only --without-fw-update --without-ucx-cuda --force --all && \
|
2022-12-29 15:19:38 +03:00
|
|
|
rm -rf /tmp/MLNX_OFED_LINUX-${OFED_VERSION}*
|
|
|
|
|
|
|
|
# Install HPC-X
|
2023-11-22 16:48:18 +03:00
|
|
|
ENV HPCX_VERSION=v2.16
|
2022-12-29 15:19:38 +03:00
|
|
|
RUN cd /opt && \
|
|
|
|
rm -rf hpcx && \
|
2023-11-22 16:48:18 +03:00
|
|
|
wget -q https://content.mellanox.com/hpc/hpc-x/${HPCX_VERSION}/hpcx-${HPCX_VERSION}-gcc-mlnx_ofed-ubuntu22.04-cuda12-gdrcopy2-nccl2.18-x86_64.tbz -O hpcx.tbz && \
|
2023-04-14 15:57:55 +03:00
|
|
|
tar xf hpcx.tbz && \
|
2023-11-22 16:48:18 +03:00
|
|
|
mv hpcx-${HPCX_VERSION}-gcc-mlnx_ofed-ubuntu22.04-cuda12-gdrcopy2-nccl2.18-x86_64 hpcx && \
|
2023-04-14 15:57:55 +03:00
|
|
|
rm hpcx.tbz
|
2022-12-29 15:19:38 +03:00
|
|
|
|
|
|
|
# Install Intel MLC
|
|
|
|
RUN cd /tmp && \
|
2024-04-18 05:59:36 +03:00
|
|
|
wget -q https://downloadmirror.intel.com/793041/mlc_v3.11.tgz -O mlc.tgz && \
|
2022-12-29 15:19:38 +03:00
|
|
|
tar xzf mlc.tgz Linux/mlc && \
|
|
|
|
cp ./Linux/mlc /usr/local/bin/ && \
|
|
|
|
rm -rf ./Linux mlc.tgz
|
|
|
|
|
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
|
|
|
|
|
2024-01-08 08:40:52 +03:00
|
|
|
# Install NCCL 2.18.3
|
|
|
|
RUN cd /tmp && \
|
|
|
|
git clone -b v2.18.3-1 https://github.com/NVIDIA/nccl.git && \
|
|
|
|
cd nccl && \
|
|
|
|
make -j src.build && \
|
|
|
|
make install && \
|
|
|
|
rm -rf /tmp/nccl
|
2023-04-14 15:57:55 +03:00
|
|
|
|
|
|
|
ENV PATH="${PATH}" \
|
|
|
|
LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" \
|
|
|
|
SB_HOME=/opt/superbench \
|
|
|
|
SB_MICRO_PATH=/opt/superbench \
|
|
|
|
ANSIBLE_DEPRECATION_WARNINGS=FALSE \
|
|
|
|
ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
|
|
|
|
|
|
|
|
RUN echo PATH="$PATH" > /etc/environment && \
|
|
|
|
echo LD_LIBRARY_PATH="$LD_LIBRARY_PATH" >> /etc/environment && \
|
2024-03-21 18:05:55 +03:00
|
|
|
echo SB_MICRO_PATH="$SB_MICRO_PATH" >> /etc/environment && \
|
2024-08-13 19:35:01 +03:00
|
|
|
echo "source /opt/hpcx/hpcx-init.sh && hpcx_load" | tee -a /etc/bash.bashrc >> /etc/profile.d/10-hpcx.sh
|
2023-04-14 15:57:55 +03:00
|
|
|
|
2022-12-29 15:19:38 +03:00
|
|
|
# Add config files
|
|
|
|
ADD dockerfile/etc /opt/microsoft/
|
|
|
|
|
|
|
|
WORKDIR ${SB_HOME}
|
|
|
|
|
|
|
|
ADD third_party third_party
|
2023-12-07 14:57:28 +03:00
|
|
|
RUN make -C third_party cuda_with_msccl
|
2022-12-29 15:19:38 +03:00
|
|
|
|
|
|
|
ADD . .
|
2023-11-22 16:48:18 +03:00
|
|
|
RUN python3 -m pip install --upgrade setuptools==65.7 && \
|
|
|
|
python3 -m pip install --no-cache-dir .[nvworker] && \
|
2022-12-29 15:19:38 +03:00
|
|
|
make cppbuild && \
|
|
|
|
make postinstall && \
|
|
|
|
rm -rf .git
|