cuda11.1.1.dockerfile 4.71 KB
Newer Older
1
2
FROM nvcr.io/nvidia/pytorch:20.12-py3

3
4
# OS:
#   - Ubuntu: 20.04
5
#   - OpenMPI: 4.0.5
6
#   - Docker Client: 20.10.8
7
8
9
# NVIDIA:
#   - CUDA: 11.1.1
#   - cuDNN: 8.0.5
10
#   - NCCL: v2.10.3-1
11
12
13
14
# Mellanox:
#   - OFED: 5.2-2.2.3.0
#   - HPC-X: v2.8.3
#   - NCCL RDMA SHARP plugins: 7cccbc1
15
# Intel:
16
#   - mlc: v3.11
17

18
19
LABEL maintainer="SuperBench"

20
ENV DEBIAN_FRONTEND=noninteractive
21
22
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
23
24
    autoconf \
    automake \
25
    bc \
26
27
28
    build-essential \
    curl \
    dmidecode \
29
    ffmpeg \
30
    git \
31
    iproute2 \
32
33
    jq \
    libaio-dev \
34
35
36
    libavcodec-dev \
    libavformat-dev \
    libavutil-dev \
37
    libcap2 \
38
    libnuma-dev \
39
    libpci-dev \
40
    libswresample-dev \
41
    libtinfo5 \
42
    libtool \
43
    lshw \
44
    python3-mpi4py \
45
46
47
48
    net-tools \
    openssh-client \
    openssh-server \
    pciutils \
49
    sudo \
50
51
52
53
54
55
56
    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
57

58
59
ARG NUM_MAKE_JOBS=

60
61
62
# Install Docker
ENV DOCKER_VERSION=20.10.8
RUN cd /tmp && \
63
    wget -q https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
64
65
66
    tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
    rm docker.tgz

67
# Update system config
68
69
70
71
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 && \
72
    sed -i "s/[# ]*PermitUserEnvironment no/PermitUserEnvironment yes/" /etc/ssh/sshd_config && \
73
    sed -i "s/[# ]*Port.*/Port 22/" /etc/ssh/sshd_config && \
74
75
    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
76
77

# Install OFED
78
ENV OFED_VERSION=5.2-2.2.3.0
79
80
81
82
83
84
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}*

85
# Install HPC-X
86
ENV HPCX_VERSION=v2.9.0
87
RUN cd /opt && \
88
89
90
91
92
    rm -rf hpcx && \
    wget -q https://content.mellanox.com/hpc/hpc-x/${HPCX_VERSION}/hpcx-${HPCX_VERSION}-gcc-inbox-ubuntu20.04-x86_64.tbz -O hpcx.tbz && \
    tar xf hpcx.tbz && \
    mv hpcx-${HPCX_VERSION}-gcc-inbox-ubuntu20.04-x86_64 hpcx && \
    rm hpcx.tbz
93
94
95
96
97
98
99
100

# 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 && \
101
    make -j ${NUM_MAKE_JOBS} && \
102
103
104
105
106
107
    make install && \
    cd /tmp && \
    rm -rf nccl-rdma-sharp-plugins

# Install NCCL patch
RUN cd /tmp && \
108
    git clone -b v2.10.3-1 https://github.com/NVIDIA/nccl.git && \
109
    cd nccl && \
110
    make -j ${NUM_MAKE_JOBS} src.build && \
111
112
113
114
    make install && \
    cd /tmp && \
    rm -rf nccl

115
116
# Install Intel MLC
RUN cd /tmp && \
117
    wget -q https://downloadmirror.intel.com/793041/mlc_v3.11.tgz -O mlc.tgz && \
118
    tar xzf mlc.tgz Linux/mlc && \
119
    cp ./Linux/mlc /usr/local/bin/ && \
120
    rm -rf ./Linux mlc.tgz
121

122
ENV PATH="${PATH}" \
123
    LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" \
124
125
126
127
    SB_HOME=/opt/superbench \
    SB_MICRO_PATH=/opt/superbench \
    ANSIBLE_DEPRECATION_WARNINGS=FALSE \
    ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
128

129
130
131
132
RUN echo PATH="$PATH" > /etc/environment && \
    echo LD_LIBRARY_PATH="$LD_LIBRARY_PATH" >> /etc/environment && \
    echo SB_MICRO_PATH="$SB_MICRO_PATH" >> /etc/environment

rafsalas19's avatar
rafsalas19 committed
133
134
135
136
137
138
# 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

rafsalas19's avatar
rafsalas19 committed
139
140
141
142
143
144
145
# 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

Yifan Xiong's avatar
Yifan Xiong committed
146
147
148
# Add config files
ADD dockerfile/etc /opt/microsoft/

149
WORKDIR ${SB_HOME}
150

151
ADD third_party third_party
152
RUN make -C third_party cuda -o nvbandwidth
153
154

ADD . .
155
RUN python3 -m pip install --upgrade setuptools==65.7 importlib_metadata==6.8.0 && \
156
    python3 -m pip install --no-cache-dir .[nvworker] && \
157
    make cppbuild && \
158
159
    make postinstall && \
    rm -rf .git