diff --git a/ubuntu-20.04/opencv-4.9.0/cuda-12.3.1/Dockerfile b/ubuntu-20.04/opencv-4.9.0/cuda-12.3.1/Dockerfile new file mode 100644 index 0000000..ba72f80 --- /dev/null +++ b/ubuntu-20.04/opencv-4.9.0/cuda-12.3.1/Dockerfile @@ -0,0 +1,69 @@ +FROM nvidia/cuda:12.3.1-devel-ubuntu20.04 + +ARG DEBIAN_FRONTEND=noninteractive +ARG OPENCV_VERSION=4.9.0 + +RUN apt-get update && apt-get upgrade -y &&\ + # Install build tools, build dependencies and python + apt-get install -y \ + python3-pip \ + build-essential \ + cmake \ + git \ + wget \ + unzip \ + yasm \ + pkg-config \ + libswscale-dev \ + libtbb2 \ + libtbb-dev \ + libjpeg-dev \ + libpng-dev \ + libtiff-dev \ + libavformat-dev \ + libpq-dev \ + libxine2-dev \ + libglew-dev \ + libtiff5-dev \ + zlib1g-dev \ + libjpeg-dev \ + libavcodec-dev \ + libavformat-dev \ + libavutil-dev \ + libpostproc-dev \ + libswscale-dev \ + libeigen3-dev \ + libtbb-dev \ + libgtk2.0-dev \ + pkg-config \ + ## Python + python3-dev \ + python3-numpy \ + && rm -rf /var/lib/apt/lists/* + +RUN cd /opt/ &&\ + # Download and unzip OpenCV and opencv_contrib and delte zip files + wget https://github.com/opencv/opencv/archive/$OPENCV_VERSION.zip &&\ + unzip $OPENCV_VERSION.zip &&\ + rm $OPENCV_VERSION.zip &&\ + wget https://github.com/opencv/opencv_contrib/archive/$OPENCV_VERSION.zip &&\ + unzip ${OPENCV_VERSION}.zip &&\ + rm ${OPENCV_VERSION}.zip &&\ + # Create build folder and switch to it + mkdir /opt/opencv-${OPENCV_VERSION}/build && cd /opt/opencv-${OPENCV_VERSION}/build &&\ + # Cmake configure + cmake \ + -DOPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-${OPENCV_VERSION}/modules \ + -DWITH_CUDA=ON \ + -DCUDA_ARCH_BIN=7.5,8.0,8.6 \ + -DCMAKE_BUILD_TYPE=RELEASE \ + # Install path will be /usr/local/lib (lib is implicit) + -DCMAKE_INSTALL_PREFIX=/usr/local \ + .. &&\ + # Make + make -j"$(nproc)" && \ + # Install to /usr/local/lib + make install && \ + ldconfig &&\ + # Remove OpenCV sources and build folder + rm -rf /opt/opencv-${OPENCV_VERSION} && rm -rf /opt/opencv_contrib-${OPENCV_VERSION} diff --git a/ubuntu-22.04/opencv-4.9.0/cuda-12.3.1/Dockerfile b/ubuntu-22.04/opencv-4.9.0/cuda-12.3.1/Dockerfile new file mode 100644 index 0000000..8c6a3d4 --- /dev/null +++ b/ubuntu-22.04/opencv-4.9.0/cuda-12.3.1/Dockerfile @@ -0,0 +1,69 @@ +FROM nvidia/cuda:12.3.1-devel-ubuntu22.04 + +ARG DEBIAN_FRONTEND=noninteractive +ARG OPENCV_VERSION=4.9.0 + +RUN apt-get update && apt-get upgrade -y &&\ + # Install build tools, build dependencies and python + apt-get install -y \ + python3-pip \ + build-essential \ + cmake \ + git \ + wget \ + unzip \ + yasm \ + pkg-config \ + libswscale-dev \ + libtbb2 \ + libtbb-dev \ + libjpeg-dev \ + libpng-dev \ + libtiff-dev \ + libavformat-dev \ + libpq-dev \ + libxine2-dev \ + libglew-dev \ + libtiff5-dev \ + zlib1g-dev \ + libjpeg-dev \ + libavcodec-dev \ + libavformat-dev \ + libavutil-dev \ + libpostproc-dev \ + libswscale-dev \ + libeigen3-dev \ + libtbb-dev \ + libgtk2.0-dev \ + pkg-config \ + ## Python + python3-dev \ + python3-numpy \ + && rm -rf /var/lib/apt/lists/* + +RUN cd /opt/ &&\ + # Download and unzip OpenCV and opencv_contrib and delte zip files + wget https://github.com/opencv/opencv/archive/$OPENCV_VERSION.zip &&\ + unzip $OPENCV_VERSION.zip &&\ + rm $OPENCV_VERSION.zip &&\ + wget https://github.com/opencv/opencv_contrib/archive/$OPENCV_VERSION.zip &&\ + unzip ${OPENCV_VERSION}.zip &&\ + rm ${OPENCV_VERSION}.zip &&\ + # Create build folder and switch to it + mkdir /opt/opencv-${OPENCV_VERSION}/build && cd /opt/opencv-${OPENCV_VERSION}/build &&\ + # Cmake configure + cmake \ + -DOPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-${OPENCV_VERSION}/modules \ + -DWITH_CUDA=ON \ + -DCUDA_ARCH_BIN=7.5,8.0,8.6 \ + -DCMAKE_BUILD_TYPE=RELEASE \ + # Install path will be /usr/local/lib (lib is implicit) + -DCMAKE_INSTALL_PREFIX=/usr/local \ + .. &&\ + # Make + make -j"$(nproc)" && \ + # Install to /usr/local/lib + make install && \ + ldconfig &&\ + # Remove OpenCV sources and build folder + rm -rf /opt/opencv-${OPENCV_VERSION} && rm -rf /opt/opencv_contrib-${OPENCV_VERSION}