123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
- RUN apt-get clean && apt-get update && apt-get install -y locales
- RUN locale-gen en_US.UTF-8
- ENV LANG en_US.UTF-8
- ENV LANGUAGE en_US:en
- ENV LC_ALL en_US.UTF-8
- # Install all dependencies for OpenCV
- RUN apt-get -y update && \
- apt-get -y install \
- python3 \
- python3-dev \
- git \
- wget \
- unzip \
- cmake \
- build-essential \
- pkg-config \
- libatlas-base-dev \
- gfortran \
- libgtk-3-dev \
- libavcodec-dev \
- libavformat-dev \
- libswscale-dev \
- libjpeg-dev \
- libpng-dev \
- libtiff-dev \
- libv4l-dev \
- && \
- # install python dependencies
- wget https://bootstrap.pypa.io/get-pip.py && \
- python3 get-pip.py && \
- rm get-pip.py && \
- pip3 install numpy && \
- pip3 install matplotlib && \
- pip3 install Pillow && \
- pip3 install glob2 && \
- pip3 install scikit-image && \
- pip3 install numba && \
- pip3 install vtk && \
- pip3 install pyCUDA && \
- # Install OpenCV
- git clone https://github.com/opencv/opencv.git && \
- cd opencv && \
- git checkout 4.2.0 && \
- cd .. && \
- git clone https://github.com/opencv/opencv_contrib.git && \
- cd opencv_contrib && \
- git checkout 4.2.0 && \
- cd .. && \
- cd opencv && \
- # Prepare build
- mkdir build && cd build && \
- cmake -D CMAKE_BUILD_TYPE=RELEASE \
- -D BUILD_PYTHON_SUPPORT=ON \
- -D CMAKE_INSTALL_PREFIX=/usr/local \
- -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
- -D BUILD_EXAMPLES=OFF \
- -D PYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 \
- -D BUILD_opencv_python3=ON \
- -D BUILD_opencv_python2=OFF \
- -D WITH_IPP=OFF \
- -D WITH_FFMPEG=ON \
- -D WITH_CUDA=ON \
- -DCUDA_ARCH=35 \
- -DCUDA_ARCH_BIN=6.1,7.0,7.5 \
- -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.1 \
- -D WITH_CUBLAS=ON \
- -D WITH_V4L=ON .. \
- && \
- # Install
- make -j$(nproc) && \
- make install && \
- ldconfig \
- && \
- # Clean
- apt-get -y remove \
- python3-dev \
- libatlas-base-dev \
- gfortran \
- libgtk-3-dev \
- libavcodec-dev \
- libavformat-dev \
- libswscale-dev \
- libjpeg-dev \
- libpng-dev \
- libtiff-dev \
- libv4l-dev \
- && \
- apt-get clean && \
- rm -rf /opencv /opencv_contrib /var/lib/apt/lists/*
- COPY lossy_image_cuda.py /
- COPY vtk_test.py /
- CMD [ "python3", "./lossy_image_cuda.py" ]
|