Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] add support for docker #84

Merged
merged 16 commits into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
ARG CUDA_TAG=9.2-devel
FROM nvidia/cuda:$CUDA_TAG
LABEL maintainer="AliceVision Team alicevision@googlegroups.com"

# use CUDA_TAG to select the image version to use
# see https://hub.docker.com/r/nvidia/cuda/
#
# For example to create a ubuntu 16.04 with cuda 8.0 for development, use
# CUDA_TAG=8.0-devel
# docker build --build-arg CUDA_TAG=$CUDA_TAG --tag cctag:$CUDA_TAG .
#
# then execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
# docker run -it --runtime=nvidia cctag

# OS/Version (FILE): cat /etc/issue.net
# Cuda version (ENV): $CUDA_VERSION

# System update
RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
wget \
unzip \
yasm \
pkg-config \
libtool \
nasm \
automake \
libpng12-dev \
libjpeg-turbo8-dev \
libboost-all-dev \
ffmpeg \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libeigen3-dev \
libavresample-dev \
libtbb-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt
ENV OPENCV_VERSION="3.4.1"
RUN wget https://github.com/opencv/opencv/archive/"${OPENCV_VERSION}".zip \
&& unzip ${OPENCV_VERSION}.zip

WORKDIR /opt/opencv-${OPENCV_VERSION}/cmake_binary \
RUN cmake -j -DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DWITH_CUDA=OFF \
-DENABLE_AVX=ON \
-DWITH_OPENGL=ON \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RELEASE .. \
&& make -j install \
&& rm /opt/${OPENCV_VERSION}.zip \
&& rm -r /opt/opencv-${OPENCV_VERSION}


COPY . /opt/cctag
WORKDIR /opt/cctag/build
RUN cmake .. -DWITH_CUDA:BOOL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DOpenCV_DIR:PATH=/usr/local/share/OpenCV && make install -j
27 changes: 22 additions & 5 deletions BUILD.md → INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
CCTag library
===================
# CCTag library

## Building instructions

----------------------
Building instructions
----------------------

Required tools:
* CMake >= 3.4 to build the code
Expand Down Expand Up @@ -81,3 +79,22 @@ Several CUB functions are known to fail with a few NVidia cards including our re
the GTX 980 Ti.
The CUB that is included with CUDA 7.5 does not solve this problem.

----------

## Docker Image

A docker image can be built using the Ubuntu based [Dockerfile](Dockerfile),which is based on nvidia/cuda image (https://hub.docker.com/r/nvidia/cuda/)

A parameter `CUDA_TAG` can be passed when building the image to select the ubuntu and cuda version.
For example to create a ubuntu 16.04 with cuda 8.0 for development, use
```
docker build --build-arg CUDA_TAG=8.0-devel --tag cctag .
```

The complete list of available tags can be found on the nvidia [dockerhub page](https://hub.docker.com/r/nvidia/cuda/)
In order to run the image nvidia docker is needed: see the installation instruction here https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0)
Once installed, the docker can be run, e.g., in interactive mode with

```
docker run -it --runtime=nvidia cctag
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Check your graphic card CUDA compatibility [here](https://github.com/tpruvot/ccm
Building
--------

See [BUILD](BUILD.md) text file.
See [INSTALL](INSTALL.md) text file.

Continuous integration:
- [![Build Status](https://travis-ci.org/alicevision/CCTag.svg?branch=master)](https://travis-ci.org/alicevision/CCTag) master branch.
Expand Down