-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·72 lines (57 loc) · 2.29 KB
/
Dockerfile
File metadata and controls
executable file
·72 lines (57 loc) · 2.29 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
# FriendlySplat Dockerfile
# Base image: NVIDIA CUDA 12.1 + cuDNN8 (required for PyTorch CUDA extensions)
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
# Adjust this to match your GPU (e.g., 8.6 for RTX 30xx, 8.9 for RTX 40xx)
ARG TORCH_CUDA_ARCH_LIST="8.9"
ENV TORCH_CUDA_ARCH_LIST=${TORCH_CUDA_ARCH_LIST}
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
wget \
curl \
ca-certificates \
libgl1-mesa-glx \
libglib2.0-0 \
python3.10 \
python3-pip \
python3.10-dev \
python-is-python3 \
libomp-dev \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fLs https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C /usr/local/bin --strip-components=1
# Set project directory as working directory
WORKDIR /app/FriendlySplat
# Copy dependency metadata first to leverage Docker layer caching
COPY setup.py pyproject.toml ./
# Install torch and extras separately for cache
RUN uv pip install --system --no-cache-dir "setuptools>=61" wheel \
ninja \
safetensors \
torch==2.4.0 torchvision==0.19.0 --extra-index-url https://download.pytorch.org/whl/cu121 \
&& uv cache clean
# Install additional SFM dependencies (required for hloc)
RUN git clone --recursive https://github.com/AshadowZ/Hierarchical-Localization.git /app/hloc \
&& cd /app/hloc \
&& uv pip install --system --no-cache-dir . \
&& uv cache clean
COPY . .
# Install FriendlySplat extras
# --no-build-isolation is required because some dependencies (e.g., fused-ssim) rely on torch during build but do not declare it properly.
RUN uv pip install --system --no-cache-dir --no-build-isolation -e ".[train,viewer,mesh,segment,sfm,priors]"
# This ensures the file can be restored later even if the mounted source directory overwrites it
RUN mkdir -p /opt/artifacts/gsplat \
&& cp /app/FriendlySplat/gsplat/csrc.so /opt/artifacts/gsplat/csrc.so
# Copy entrypoint script into the image
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set the container entrypoint
ENTRYPOINT ["/entrypoint.sh"]
# Add project to PATH for CLI access
ENV PATH="/app/FriendlySplat:${PATH}"
# Expose port for viewer
EXPOSE 8080
# Default shell
CMD ["/bin/bash"]