-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
165 lines (139 loc) · 5.6 KB
/
Dockerfile
File metadata and controls
165 lines (139 loc) · 5.6 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# From https://github.com/ufoym/deepo/blob/master/docker/Dockerfile.pytorch-py36-cu90
# From https://github.com/TRAILab/PDV/blob/main/docker/Dockerfile
# ==================================================================
# module list
# ------------------------------------------------------------------
# python 3.8 (apt)
# pytorch 1.9 (pip)
# ==================================================================
FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04
RUN rm -rf /var/lib/apt/lists/* \
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
rm -rf /var/lib/apt/lists/* \
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update
# ==================================================================
# tools
# ------------------------------------------------------------------
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
wget \
git \
vim \
nano \
libx11-dev \
fish \
libsparsehash-dev \
software-properties-common \
libsm6 \
libxext6 \
libxrender-dev \
libssl-dev
# ==================================================================
# python
# ------------------------------------------------------------------
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
python3.8 \
python3.8-dev \
python3-distutils \
python3-apt \
python3-pip \
python3-setuptools
RUN ln -s /usr/bin/python3.8 /usr/local/bin/python3
RUN ln -s /usr/bin/python3.8 /usr/local/bin/python
# ==================================================================
# conda
# ------------------------------------------------------------------
#RUN mkdir -p /opt/conda
ENV CONDA_DIR /opt/conda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda
ENV PATH=$CONDA_DIR/bin:$PATH
RUN rm -rf ~/miniconda.sh
ENV PATH /opt/conda/envs/ssl/bin:$PATH
RUN /opt/conda/bin/conda init bash \
&& . ~/.bashrc \
&& conda create -n ssl python=3.8 \
&& conda activate ssl
RUN echo "source activate ssl" > ~/.bashrc
# Make RUN commands use the new environment:
SHELL ["conda", "run", "--no-capture-output", "-n", "ssl", "/bin/bash", "-c"]
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
RUN ldconfig && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
# Install cmake v3.21.3
RUN apt-get purge -y cmake && \
mkdir /root/temp && \
cd /root/temp && \
wget https://cmake.org/files/v3.21/cmake-3.21.3.tar.gz && \
tar -xzvf cmake-3.21.3.tar.gz && \
cd cmake-3.21.3 && \
bash ./bootstrap && \
make && \
make install && \
cmake --version && \
rm -rf /root/temp
WORKDIR /root
# Install Boost geometry
RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.68.0/source/boost_1_68_0.tar.gz
RUN tar xzvf boost_1_68_0.tar.gz
RUN cp -r ./boost_1_68_0/boost /usr/include
RUN rm -rf ./boost_1_68_0
RUN rm -rf ./boost_1_68_0.tar.gz
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
# ==================================================================
# DepthContrast Framework
# ------------------------------------------------------------------
WORKDIR /DepthContrast
#cuda home env needed for minkowski
ENV CUDA_HOME="/usr/local/cuda-11.1"
COPY requirements.txt requirements.txt
RUN apt-get update && apt-get install -y libgl1
RUN apt-get update -y
RUN apt-get install -y libeigen3-dev
RUN pip install pip==22.1.2
RUN python -m pip --no-cache-dir install -r requirements.txt
COPY third_party third_party
ENV TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"
ENV PYTHONPATH="/usr/lib/python3.8/site-packages/:${PYTHONPATH}"
WORKDIR /DepthContrast
RUN conda install openblas-devel -c anaconda
RUN python -m pip --no-cache-dir install torch==1.9.0+cu111 torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
RUN apt install libopenblas-dev -y
RUN pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps --install-option="--blas_include_dirs=${CONDA_PREFIX}/include" --install-option="--blas=openblas" --install-option="--force_cuda"
# RUN pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps --install-option="--blas_include_dirs=${CONDA_PREFIX}/include" --install-option="--blas=openblas"
RUN conda install -c conda-forge/label/gcc7 qhull
RUN conda install -c conda-forge -c davidcaron pclpy
RUN pip install torch-scatter==2.0.9 -f https://data.pyg.org/whl/torch-1.9.0+cu111.html
RUN pip install nuscenes-devkit
RUN pip install opencv-python==4.3.0.36
RUN mkdir checkpoints && \
mkdir configs && \
mkdir criterions && \
mkdir data && \
mkdir datasets && \
mkdir models && \
mkdir tools && \
mkdir utils && \
mkdir output