cuda11.1.1.dockerfile 3.85 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
16
# Intel:
#   - mlc: v3.9a
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
26
27
    build-essential \
    curl \
    dmidecode \
28
29
30
31
    git \
    jq \
    libaio-dev \
    libcap2 \
32
    libnuma-dev \
33
34
    libpci-dev \
    libtinfo5 \
35
    libtool \
36
    lshw \
37
38
39
40
    net-tools \
    openssh-client \
    openssh-server \
    pciutils \
41
42
43
44
45
46
47
    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
48

49
50
ARG NUM_MAKE_JOBS=

51
52
53
54
55
56
57
# Install Docker
ENV DOCKER_VERSION=20.10.8
RUN cd /tmp && \
    wget 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

58
# Update system config
59
60
61
62
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 && \
63
    sed -i "s/[# ]*PermitUserEnvironment no/PermitUserEnvironment yes/" /etc/ssh/sshd_config && \
64
    sed -i "s/[# ]*Port.*/Port 22/" /etc/ssh/sshd_config && \
65
66
    echo -e "* soft nofile 1048576\n* hard nofile 1048576" >> /etc/security/limits.conf && \
    echo -e "root soft nofile 1048576\nroot hard nofile 1048576" >> /etc/security/limits.conf
67
68

# Install OFED
69
ENV OFED_VERSION=5.2-2.2.3.0
70
71
72
73
74
75
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}*

76
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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 && \
90
    make -j ${NUM_MAKE_JOBS} && \
91
92
93
94
95
96
    make install && \
    cd /tmp && \
    rm -rf nccl-rdma-sharp-plugins

# Install NCCL patch
RUN cd /tmp && \
97
    git clone -b v2.10.3-1 https://github.com/NVIDIA/nccl.git && \
98
    cd nccl && \
99
    make -j ${NUM_MAKE_JOBS} src.build && \
100
101
102
103
    make install && \
    cd /tmp && \
    rm -rf nccl

104
105
# Install Intel MLC
RUN cd /tmp && \
106
107
    curl https://www.intel.com/content/dam/develop/external/us/en/documents/mlc_v3.9a.tgz -o mlc.tgz && \
    tar xzvf mlc.tgz Linux/mlc && \
108
    cp ./Linux/mlc /usr/local/bin/ && \
109
    rm -rf ./Linux mlc.tgz
110

111
ENV PATH="${PATH}" \
112
    LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" \
113
114
115
116
    SB_HOME=/opt/superbench \
    SB_MICRO_PATH=/opt/superbench \
    ANSIBLE_DEPRECATION_WARNINGS=FALSE \
    ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
117
118

WORKDIR ${SB_HOME}
119

120
ADD third_party third_party
121
RUN make -C third_party cuda
122
123

ADD . .
124
RUN python3 -m pip install .[nvidia,torch,ort] && \
125
126
    make cppbuild && \
    make postinstall