forked from NVIDIA/DALI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.deps
138 lines (122 loc) · 5.77 KB
/
Dockerfile.deps
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#########################################################################################
## Stage 1: build DALI dependencies
## DALI is based on "manylinux3", which is our modification of manylinux1
## (CentOS 5 derivative). For building this docker image, manylinux3 has to
## be manually built. It is also possible to use other distros, but we don't
## officially support them.
## For instructions, how to build manylinux3 with our patch see:
## //DALI/docker/build.sh#L16
#########################################################################################
ARG FROM_IMAGE_NAME=gitlab-master.nvidia.com:5005/dl/dali/manylinux:manylinux3_x86_64
ARG USE_CUDA_VERSION=9
FROM ${FROM_IMAGE_NAME} as base
# CUDA
FROM base as cuda-9
RUN CUDA_VERSION=9.0 && \
CUDA_BUILD=9.0.176_384.81 && \
curl -LO https://developer.nvidia.com/compute/cuda/${CUDA_VERSION}/Prod/local_installers/cuda_${CUDA_BUILD}_linux-run && \
chmod +x cuda_${CUDA_BUILD}_linux-run && \
./cuda_${CUDA_BUILD}_linux-run --silent --no-opengl-libs --toolkit && \
rm -f cuda_${CUDA_BUILD}_linux-run; \
# nvJpeg
NVJPEG_VERSION=0.2.0 && \
NVJPEG_BUILD=9.0-v${NVJPEG_VERSION} && \
curl -L https://developer.download.nvidia.com/compute/redist/libnvjpeg/cuda-linux64-nvjpeg-${NVJPEG_BUILD}.tar.gz | tar -xzf - && \
cd /cuda-linux64-nvjpeg/ && \
mv lib64/libnvjpeg*.a* /usr/local/cuda/lib64/ && \
mv include/nvjpeg.h /usr/local/cuda/include/ && \
rm -rf /cuda-linux64-nvjpeg;
FROM base as cuda-10
RUN CUDA_VERSION=10.0 && \
CUDA_BUILD=10.0.130_410.48 && \
curl -LO https://developer.nvidia.com/compute/cuda/${CUDA_VERSION}/Prod/local_installers/cuda_${CUDA_BUILD}_linux && \
chmod +x cuda_${CUDA_BUILD}_linux && \
./cuda_${CUDA_BUILD}_linux --silent --no-opengl-libs --toolkit && \
rm -f cuda_${CUDA_BUILD}_linux;
FROM cuda-${USE_CUDA_VERSION} as cuda
# Actual image
FROM base
# Install yum Dependencies
RUN yum install -y zip wget yasm
# Don't want the short-unicode version for Python 2.7
RUN rm -f /opt/python/cp27-cp27m
# Boost
RUN BOOST_VERSION=1.66.0 && \
cd /usr/local && \
curl -L https://dl.bintray.com/boostorg/release/1.66.0/source/boost_${BOOST_VERSION//./_}.tar.gz | tar -xzf - && \
ln -s ../boost_${BOOST_VERSION//./_}/boost include/boost
# CMake
RUN CMAKE_VERSION=3.5 && \
CMAKE_BUILD=3.5.0 && \
curl -L https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_BUILD}.tar.gz | tar -xzf - && \
cd /cmake-${CMAKE_BUILD} && \
./bootstrap --parallel=$(grep ^processor /proc/cpuinfo | wc -l) && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" install && \
rm -rf /cmake-${CMAKE_BUILD}
# protobuf v3.5.1
RUN PROTOBUF_VERSION=3.5.1 && \
curl -L https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz | tar -xzf - && \
cd /protobuf-${PROTOBUF_VERSION} && \
./autogen.sh && \
./configure CXXFLAGS="-fPIC" --prefix=/usr/local --disable-shared 2>&1 > /dev/null && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" install 2>&1 > /dev/null && \
rm -rf /protobuf-${PROTOBUF_VERSION}
# LMDB
COPY docker/Makefile-lmdb.patch /tmp
RUN LMDB_VERSION=0.9.22 && \
git clone -b LMDB_${LMDB_VERSION} --single-branch https://github.com/LMDB/lmdb && \
cd /lmdb/libraries/liblmdb && \
patch -p3 < /tmp/Makefile-lmdb.patch && \
rm -f /tmp/Makefile-lmdb.patch && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" install && \
rm -rf /lmdb
# libjpeg-turbo
RUN JPEG_TURBO_VERSION=1.5.3 && \
curl -L https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_TURBO_VERSION}.tar.gz | tar -xzf - && \
cd /libjpeg-turbo-${JPEG_TURBO_VERSION} && \
autoreconf -fiv && \
./configure --enable-shared --prefix=/usr/local 2>&1 >/dev/null && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" install 2>&1 >/dev/null && \
rm -rf /libjpeg-turbo-${JPEG_TURBO_VERSION}
# OpenCV
RUN OPENCV_VERSION=3.4.3 && \
curl -L https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz | tar -xzf - && \
cd /opencv-${OPENCV_VERSION} && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_CUDA=OFF -DWITH_1394=OFF -DWITH_IPP=OFF -DWITH_OPENCL=OFF -DWITH_GTK=OFF \
-DBUILD_JPEG=OFF -DWITH_JPEG=ON \
-DBUILD_DOCS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_PNG=ON \
-DBUILD_opencv_cudalegacy=OFF -DBUILD_opencv_stitching=OFF .. && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" install && \
rm -rf /opencv-${OPENCV_VERSION}
# Clang
RUN CLANG_VERSION=6.0.1 && \
cd /usr/local && \
wget http://releases.llvm.org/${CLANG_VERSION}/clang+llvm-${CLANG_VERSION}-x86_64-linux-sles11.3.tar.xz && \
tar -xJf clang+llvm-${CLANG_VERSION}-x86_64-linux-sles11.3.tar.xz --strip 1 && \
rm clang+llvm-${CLANG_VERSION}-x86_64-linux-sles11.3.tar.xz
ENV NVIDIA_DRIVER_CAPABILITIES=video,compute,utility
# FMpeg
RUN FFMPEG_VERSION=3.4.2 && \
cd /tmp && wget https://developer.download.nvidia.com/compute/redist/nvidia-dali/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
tar xf ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
rm ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
cd ffmpeg-$FFMPEG_VERSION && \
./configure \
--prefix=/usr/local \
--disable-static \
--disable-all \
--disable-autodetect \
--disable-iconv \
--enable-shared \
--enable-avformat \
--enable-avcodec \
--enable-avfilter \
--enable-protocol=file \
--enable-demuxer=mov,matroska \
--enable-bsf=h264_mp4toannexb,hevc_mp4toannexb && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" && make install && \
cd /tmp && rm -rf ffmpeg-$FFMPEG_VERSION
# CUDA
COPY --from=cuda /usr/local/cuda /usr/local/cuda