forked from NVIDIA/DALI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
71 lines (55 loc) · 2.34 KB
/
Dockerfile
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
60
61
62
63
64
65
66
67
68
69
70
71
#########################################################################################
## Stage 2: build DALI wheels on top of the dependencies image built in Stage 1
#########################################################################################
ARG DEPS_IMAGE_NAME
FROM ${DEPS_IMAGE_NAME}
ARG PYVER=2.7
ARG PYV=27
ARG DALI_BUILD_DIR=build-docker-release
ENV PYVER=${PYVER} PYV=${PYV} PYTHONPATH=/opt/python/v
ENV PYBIN=${PYTHONPATH}/bin \
PYLIB=${PYTHONPATH}/lib
ENV PATH=${PYBIN}:${PATH} \
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:/opt/dali/${DALI_BUILD_DIR}:${PYLIB}:${LD_LIBRARY_PATH}
RUN ln -s /opt/python/cp${PYV}* /opt/python/v
RUN pip install future numpy setuptools wheel && \
rm -rf /root/.cache/pip/
RUN if [ ${PYV} != "37" ] ; then \
pip install tensorflow-gpu==1.7 && \
pip install tensorflow-gpu==1.11 --target /tensorflow/1_11 && \
pip install tensorflow-gpu==1.12rc2 --target /tensorflow/1_12 && \
pip install tf-nightly-gpu --target /tensorflow/nightly; \
else \
# only nightly buidl of TF supports python 3.7 at that time
pip install tf-nightly-gpu; \
fi && \
rm -rf /root/.cache/pip/
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
ldconfig
WORKDIR /opt/dali
COPY . .
WORKDIR /opt/dali/${DALI_BUILD_DIR}
ARG CC
ARG CXX
ENV CC=${CC}
ENV CXX=${CXX}
RUN LD_LIBRARY_PATH="${PWD}:${LD_LIBRARY_PATH}" && \
cmake ../ -DCMAKE_INSTALL_PREFIX=. \
-DBUILD_TEST=ON -DBUILD_BENCHMARK=ON -DBUILD_PYTHON=ON \
-DBUILD_LMDB=ON -DBUILD_TENSORFLOW=ON -DWERROR=ON && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)"
ARG NVIDIA_BUILD_ID
ENV NVIDIA_BUILD_ID ${NVIDIA_BUILD_ID:-0}
RUN pip wheel -v dali/python \
--build-option --python-tag=$(basename /opt/python/cp${PYV}-*) \
--build-option --plat-name=manylinux1_x86_64 \
--build-option --build-number=${NVIDIA_BUILD_ID} && \
../dali/python/bundle-wheel.sh nvidia_dali-*.whl && \
UNZIP_PATH="$(mktemp -d)" && \
unzip /wheelhouse/nvidia_dali-*.whl -d $UNZIP_PATH && \
python ../tools/test_bundled_libs.py $(find $UNZIP_PATH -iname *.so* | tr '\n' ' ') && \
rm -rf $UNZIP_PATH
RUN pushd dali/python/tf_plugin/ && \
python setup.py sdist && \
mv dist/nvidia-dali-tf-plugin-*.tar.gz /wheelhouse/ && \
popd