-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.amd64_gpu
59 lines (49 loc) · 2.06 KB
/
Dockerfile.amd64_gpu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM carml/base:amd64-gpu-latest
LABEL maintainer="pearson@illinois.edu"
# Install mxnet
ENV MXNET_CUDNN_AUTOTUNE_DEFAULT=0
ENV MXNET_ROOT=/mxnet
WORKDIR /
RUN git clone --single-branch --depth 1 --branch v0.11.0 --recursive https://github.com/apache/incubator-mxnet "$MXNET_ROOT"
RUN cd "$MXNET_ROOT" && \
mkdir -p "$MXNET_ROOT" && \
cp make/config.mk . && \
echo "USE_BLAS=openblas" >>config.mk && \
echo "USE_OPENCV=0" >>config.mk && \
echo "ADD_CFLAGS=-I/usr/include/openblas -Wno-strict-aliasing -Wno-sign-compare -ftrack-macro-expansion=0 -Wno-misleading-indentation" >>config.mk && \
echo "USE_CUDA=1" >>config.mk && \
echo "USE_CUDA_PATH=/usr/local/cuda" >>config.mk && \
echo "USE_CUDNN=1" >>config.mk && \
echo "NVCCFLAGS=-lineinfo" >>config.mk && \
nice -n20 make -j`nproc` ADD_LDFLAGS=-L/usr/local/cuda/lib64/stubs PREFIX=/opt/frameworks/mxnet
RUN ln -s "$MXNET_ROOT/lib/libmxnet.so" /usr/lib/libmxnet.so
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH "$MXNET_ROOT/lib":$LD_LIBRARY_PATH
ENV LIBRARY_PATH "$MXNET_ROOT/lib":$LIBRARY_PATH
# Install PIP
RUN apt-get update && apt-get install -y --no-install-recommends \
python-pip python-setuptools python3-pip python3-setuptools \
time \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip3 install --upgrade pip
# Install MXNet python bindings, then remove so only prereqs remain
ENV MXNET_SRC_ROOT=/mxnet
RUN nice -n20 make -j`nproc` -C $MXNET_SRC_ROOT
RUN pip install --user -e $MXNET_SRC_ROOT/python \
&& pip uninstall -y mxnet
# Install data-generation prerequisites
RUN pip3 install --user numpy scikit-image
# Add evaluation scripts to docker image
ENV SCRIPTS_DIR="/eval-scripts"
COPY scripts ${SCRIPTS_DIR}
# Generate data
ENV DATA_ROOT="/fashion-mnist"
RUN "${SCRIPTS_DIR}"/generate-data.py "$DATA_ROOT"
RUN rm "${SCRIPTS_DIR}"/generate-data.py
# Add saved models to docker image
ENV MODELS_DIR="/models"
COPY models ${MODELS_DIR}
# Add support source code to docker image
ENV ECE408_SRC_DIR="/ece408_src"
COPY ece408_src ${ECE408_SRC_DIR}