-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (61 loc) · 3.48 KB
/
Copy pathDockerfile
File metadata and controls
72 lines (61 loc) · 3.48 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
FROM nvcr.io/nvidia/pytorch:25.11-py3
ARG TARGETARCH
ARG DEBIAN_FRONTEND=noninteractive
# Core build tooling and runtime libs needed by scikit-sparse / OpenCV / fused-ssim
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential cmake ninja-build git wget ca-certificates xz-utils \
libgoogle-glog-dev libgflags-dev libatlas-base-dev libeigen3-dev \
libsuitesparse-dev libmetis-dev liblapack-dev libblas-dev \
libboost-filesystem-dev libboost-graph-dev libboost-program-options-dev \
libboost-system-dev libfreeimage-dev libflann-dev liblz4-dev \
libopenimageio-dev openimageio-tools libopencv-dev libsqlite3-dev libcgal-dev libglew-dev libgl1 libgl1-mesa-dev libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Build and install Ceres Solver (needed by pyceres)
ARG CERES_VERSION=2.1.0
RUN wget -q http://ceres-solver.org/ceres-solver-${CERES_VERSION}.tar.gz \
&& tar --no-same-owner -zxf ceres-solver-${CERES_VERSION}.tar.gz \
&& mkdir ceres-build \
&& cd ceres-build \
&& cmake ../ceres-solver-${CERES_VERSION} -GNinja \
-DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON \
-DMINIGLOG=OFF -DSUITESPARSE=OFF -DCXSPARSE=OFF \
&& ninja install \
&& cd / \
&& rm -rf ceres-build ceres-solver-${CERES_VERSION} ceres-solver-${CERES_VERSION}.tar.gz
# Build and install COLMAP from source instead of using the distro package.
ARG COLMAP_VERSION=main
ARG COLMAP_CUDA_ARCHITECTURES=80;86;89;90;110
RUN git clone --branch ${COLMAP_VERSION} --depth 1 https://github.com/colmap/colmap.git /tmp/colmap \
&& cmake -S /tmp/colmap -B /tmp/colmap/build -GNinja \
-DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_CUDA_ARCHITECTURES=${COLMAP_CUDA_ARCHITECTURES}" \
-DGUI_ENABLED=OFF \
-DOPENGL_ENABLED=OFF \
&& cmake --build /tmp/colmap/build \
&& cmake --install /tmp/colmap/build \
&& ldconfig \
&& colmap help >/dev/null \
&& rm -rf /tmp/colmap
# Install cuDSS via pip for CUDA 13
RUN pip install --no-cache-dir "nvidia-cudss-cu13<=0.7.1.6"
ENV CUDA_HOME=/usr/local/cuda
ENV FUSED_SSIM_FORCE_CUDA=1
ENV TORCH_CUDA_ARCH_LIST="8.0;9.0;8.6;8.9;11.0"
WORKDIR /workspace/InstantSfM
# Install Python deps separately so code edits don't bust the cache.
COPY pyproject.toml README.md ./
RUN set -euo pipefail \
&& python -c "import tomllib, pathlib; py=tomllib.loads(pathlib.Path('pyproject.toml').read_text()); reqs=[r for r in py['project']['dependencies'] if not r.startswith('fused-ssim @ ')]; pathlib.Path('/tmp/requirements.txt').write_text('\\n'.join(reqs) + '\\n')" \
&& pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /tmp/requirements.txt \
&& git clone --depth=1 https://github.com/rahul-goel/fused-ssim /tmp/fused-ssim \
&& python -c "from pathlib import Path; p=Path('/tmp/fused-ssim/setup.py'); t=p.read_text(); t=t.replace('elif torch.mps.is_available():','elif False and torch.mps.is_available():'); t=t.replace('elif hasattr(torch, \\'xpu\\'):', 'elif False and hasattr(torch, \\'xpu\\'):'); p.write_text(t)" \
&& pip install --no-cache-dir --no-build-isolation /tmp/fused-ssim \
&& MAX_JOBS=$(nproc) pip install --no-cache-dir --no-build-isolation git+https://github.com/zitongzhan/bae.git
# Install the project itself (editable, no deps) after source copy.
COPY instantsfm instantsfm
COPY demo.py demo.py
RUN pip install --no-cache-dir -e . --no-deps
# Bring in the rest of the project (assets, configs, etc.)
COPY . .
CMD ["/bin/bash"]