forked from BachiLi/redner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpu.Dockerfile
executable file
·91 lines (79 loc) · 2.86 KB
/
gpu.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
curl \
ca-certificates \
libjpeg-dev \
libpng-dev \
libtbb-dev \
pkg-config \
libopenexr-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
#-----------------------------------------------------
# Download CMake
RUN curl -L -O https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2-Linux-x86_64.tar.gz && \
tar -xvzf cmake-3.15.2-Linux-x86_64.tar.gz && \
rm cmake-3.15.2-Linux-x86_64.tar.gz
ENV PATH /cmake-3.15.2-Linux-x86_64/bin:$PATH
#-----------------------------------------------------
# Upgrade to gcc 7
# https://gist.github.com/jlblancoc/99521194aba975286c80f93e47966dc5
RUN apt-get update && apt-get install -y software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt update \
&& apt install g++-7 -y \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-7 \
&& update-alternatives --config gcc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
#-----------------------------------------------------
# Install Miniconda and Python
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh \
&& chmod +x ~/miniconda.sh \
&& ~/miniconda.sh -b -p /opt/conda \
&& rm ~/miniconda.sh
ENV PATH /opt/conda/bin:$PATH
RUN conda install -y \
python=$PYTHON_VERSION \
pyyaml=5.1 \
scipy=1.2.1 \
numpy=1.16.4 \
ipython=7.5 \
mkl=2019.4 \
mkl-include=2019.4 \
cython=0.29.10 \
typing=3.6.4 \
ffmpeg=4.0 \
scikit-image=0.15.0 \
pybind11=2.2.4 \
&& pip install ninja==1.9.0.post1 \
&& pip install tensorflow-gpu==1.14.0 \
&& conda install --yes pytorch=1.1.0 torchvision=0.3.0 -c pytorch \
&& /opt/conda/bin/conda clean -ya
#---------------------------------------------------
# Copy Redner app to container
COPY . /app
WORKDIR /app
RUN chmod -R a+w /app
#---------------------------------------------------
# Setup runtime
ARG OPTIX_VERSION=5.1.0
ENV LD_LIBRARY_PATH /usr/local/lib:/app/NVIDIA-OptiX-SDK-${OPTIX_VERSION}-linux64/lib64:${LD_LIBRARY_PATH}
#---------------------------------------------------
# Copy Redner app to container
COPY . /app
WORKDIR /app
RUN chmod -R a+w /app
#-----------------------------------------------------
# Build Redner C++ code
WORKDIR /app
RUN if [ -d "build" ]; then rm -rf build; fi \
&& mkdir build \
&& cd build \
&& cmake .. -DEMBREE_ISPC_SUPPORT=false -DEMBREE_TUTORIALS=false -DOptiX_INSTALL_DIR=/app/NVIDIA-OptiX-SDK-${OPTIX_VERSION}-linux64 \
&& make install -j24 \
&& cd / \
&& rm -rf /app/build/