-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (58 loc) · 1.78 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
FROM nvidia/cuda:8.0-cudnn5-devel
LABEL maintainer="will.price94+docker@gmail.com"
ARG VERSION=2.4.13.5
ARG CUDA_ARCH_PTX="5.0 5.2 6.0 6.1"
ARG CUDA_ARCH_BIN="5.0 5.2 6.0 6.1"
RUN apt-get update && \
apt-get install -y wget
RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
git \
libgtk2.0-dev \
pkg-config \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
python-dev \
python-numpy \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libjasper-dev \
libdc1394-22-dev
RUN mkdir /src
WORKDIR /src
RUN wget "https://github.com/opencv/opencv/archive/$VERSION.zip" -O opencv-$VERSION.zip
RUN apt-get update && \
apt-get install -y unzip
RUN unzip opencv-$VERSION
RUN mkdir -p opencv_build && \
cd opencv_build && \
cmake \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_CUDA=ON \
-D WITH_CUBLAS=1 \
-D CUDA_FAST_MATH=1 \
-D CUDA_ARCH_PTX="$CUDA_ARCH_PTX" \
-D CUDA_ARCH_BIN="$CUDA_ARCH_BIN" \
-D ENABLE_FAST_MATH=1 \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF \
-D BUILD_DOCS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_TESTS=OFF \
-D CMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs \
../opencv-$VERSION && \
make -j $(nproc) && \
make install
# Mitigate issue with programs not being able to compile without
# static linking of cuda: -D CUDA_USE_STATIC_CUDA_RUNTIME=OFF
# See https://github.com/opencv/opencv/issues/6542 for more
RUN ln -s /usr/local/cuda/lib64/libcudart.so \
/usr/local/lib/libopencv_dep_cudart.so