forked from Unity-Technologies/ind-bermuda-opensfm
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.gpu
74 lines (62 loc) · 3.01 KB
/
Dockerfile.gpu
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
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04
ARG DEBIAN_FRONTEND=noninteractive
# Install apt-getable dependencies
RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
git \
libeigen3-dev \
libopencv-dev \
libceres-dev \
python3-dev \
python3-numpy \
python3-opencv \
python3-pip \
python3-pyproj \
python3-scipy \
python3-yaml \
curl \
ninja-build \
libboost-all-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ARG TORCH_CUDA_ARCH_LIST="Maxwell;Maxwell+Tegra;Pascal;Volta;Turing" # Kepler support has been dropped in compute 3.x
ENV TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST}"
RUN mkdir /app
RUN pip install packaging setuptools>=49.4.0
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
# ==================================================================================================
# Flash Attention version 1.0.9. Latest version to support Tesla GPU. For Ampere GPU, use the latest version.
# ==================================================================================================
WORKDIR /app
RUN git clone https://github.com/Dao-AILab/flash-attention.git
RUN cd flash-attention && git checkout 6d48e14a6c2f551db96f0badc658a6279a929df3 && python3 setup.py install
# ==================================================================================================
# LightGlue. Optionally uses Flash Attention to speed up the process. Patched to work with pre-normalized feature coordinates
# ==================================================================================================
WORKDIR /app
RUN git clone https://github.com/cvg/LightGlue.git
RUN cd LightGlue && git checkout 5a9e87d85905a6770547b86a79fa0ae227d59f36
COPY ./lightglue.patch /app/LightGlue
RUN cd LightGlue && git apply lightglue.patch && pip install -e .
# ==================================================================================================
# pypopsift. GPU accelerated SIFT. needs libboost-all-dev
# ==================================================================================================
WORKDIR /app
RUN git clone --recurse-submodules https://github.com/OpenDroneMap/pypopsift
RUN cd pypopsift && mkdir build && cd build && cmake .. -DPYBIND11_PYTHON_VERSION=3.8
RUN cd pypopsift/build && make -j8
RUN cd pypopsift && pip install -e .
# ==================================================================================================
# ALIKED Feature detector
# ==================================================================================================
WORKDIR /app
RUN git clone --recurse-submodules https://github.com/Shiaoming/ALIKED.git
RUN cd /app/ALIKED && pip install -r requirements.txt
RUN cd /app/ALIKED/custom_ops && sh build.sh
COPY . /source/OpenSfM
WORKDIR /source/OpenSfM
RUN pip3 install -r requirements.txt && \
python3 setup.py build
ENV PYTHONPATH=/app/ALIKED:$PYTHONPATH