-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.cudaopencv4contrib.amd64
48 lines (42 loc) · 1.34 KB
/
Dockerfile.cudaopencv4contrib.amd64
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
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
RUN sed -i -e 's/http:\/\/security/mirror:\/\/mirrors/' -e 's/\/ubuntu\//\/mirrors.txt/' /etc/apt/sources.list && \
sed -i -e 's/http:\/\/archive/mirror:\/\/mirrors/' -e 's/\/ubuntu\//\/mirrors.txt/' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y \
build-essential \
ccache \
cmake \
gfortran \
git \
libatlas-base-dev \
libavcodec-dev \
libavformat-dev \
libeigen3-dev\
libgtk2.0-dev \
libhdf5-serial-dev \
libjpeg-dev \
libpng-dev \
libpq-dev \
libswscale-dev \
libtbb-dev \
libtiff-dev \
libv4l-dev \
pkg-config \
unzip \
wget \
yasm \
libprotobuf-dev \
ffmpeg \
bison \
flex
WORKDIR /opt/
RUN git clone --depth=1 https://github.com/opencv/opencv_contrib.git && \
git clone --depth=1 https://github.com/opencv/opencv.git && \
mkdir opencv/build && \
cd opencv/build && \
cmake -DWITH_CUDA=ON -DWITH_TBB=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules .. && \
make -j$((`nproc`+5)) && \
make install && \
cd .. && \
rm -rf opencv*
# OpenCV4 and CUDA installed