This commit is contained in:
Sergio Bromberg 2024-10-31 22:16:19 +09:00 committed by GitHub
commit cd57181cf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 65 additions and 0 deletions

47
Dockerfile Normal file
View File

@ -0,0 +1,47 @@
# Use the base image with PyTorch and CUDA support
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
# NOTE:
# Building the libraries for this repository requires cuda *DURING BUILD PHASE*, therefore:
# - The default-runtime for container should be set to "nvidia" in the deamon.json file. See this: https://github.com/NVIDIA/nvidia-docker/issues/1033
# - For the above to work, the nvidia-container-runtime should be installed in your host. Tested with version 1.14.0-rc.2
# - Make sure NVIDIA's drivers are updated in the host machine. Tested with 525.125.06
ENV DEBIAN_FRONTEND=noninteractive
# Update and install tzdata separately
RUN apt update && apt install -y tzdata
# Install necessary packages
RUN apt install -y git && \
apt install -y libglew-dev libassimp-dev libboost-all-dev libgtk-3-dev libopencv-dev libglfw3-dev libavdevice-dev libavcodec-dev libeigen3-dev libxxf86vm-dev libembree-dev && \
apt clean && apt install wget && rm -rf /var/lib/apt/lists/*
# Create a workspace directory and clone the repository
WORKDIR /workspace
RUN git clone https://github.com/graphdeco-inria/gaussian-splatting --recursive
# Create a Conda environment and activate it
WORKDIR /workspace/gaussian-splatting
RUN conda env create --file environment.yml && conda init bash && exec bash && conda activate gaussian_splatting
# Make gaussian_splatting the default environment on start
RUN echo "conda activate gaussian_splatting" >> /root/.bashrc
# Tweak the CMake file for matching the existing OpenCV version. Fix the naming of FindEmbree.cmake
WORKDIR /workspace/gaussian-splatting/SIBR_viewers/cmake/linux
RUN sed -i 's/find_package(OpenCV 4\.5 REQUIRED)/find_package(OpenCV 4.2 REQUIRED)/g' dependencies.cmake
RUN sed -i 's/find_package(embree 3\.0 )/find_package(EMBREE)/g' dependencies.cmake
RUN mv /workspace/gaussian-splatting/SIBR_viewers/cmake/linux/Modules/FindEmbree.cmake /workspace/gaussian-splatting/SIBR_viewers/cmake/linux/Modules/FindEMBREE.cmake
# Fix the naming of the embree library in the rayscaster's cmake
RUN sed -i 's/\bembree\b/embree3/g' /workspace/gaussian-splatting/SIBR_viewers/src/core/raycaster/CMakeLists.txt
# Ready to build the viewer now.
WORKDIR /workspace/gaussian-splatting/SIBR_viewers
RUN cmake -Bbuild . -DCMAKE_BUILD_TYPE=Release && \
cmake --build build -j24 --target install
WORKDIR /workspace/gaussian-splatting

View File

@ -52,6 +52,23 @@ Jonathan Stephens made a fantastic step-by-step tutorial for setting up Gaussian
User [camenduru](https://github.com/camenduru) was kind enough to provide a Colab template that uses this repo's source (status: August 2023!) for quick and easy access to the method. Please check it out [here](https://github.com/camenduru/gaussian-splatting-colab).
## Docker
Use the Dockerfile to build an (Ubuntu 22.04) image with this repository. In order to build the image succesfully make sure that:
- NVIDIA's drivers are updated in the host machine (tested with 525.125.06)
- The default-runtime for docker is set to `nvidia` in the `/etc/docker/daemon.json` file. See [this](https://github.com/NVIDIA/nvidia-docker/issues/1033).
- For the above to work, the [nvidia-container-toolkit](https://gitlab.com/nvidia/container-toolkit/container-toolkit) should be installed in your host (tested with version 1.14.0-rc.2).
Build your docker image from the Dockerfile by downloading the [Dockerfile](https://github.com/sergiobd/gaussian-splatting-docker/blob/docker/Dockerfile) and placing it in an empty folder. You can do this manually or by using `wget`. Then, build the docker image and run it with GPU enabled.
```
mkdir gaussian_splatting
cd gaussian_splatting
wget https://raw.githubusercontent.com/sergiobd/gaussian-splatting-docker/docker/Dockerfile
docker build -t gaussian_splatting .
docker run -it --gpus all --name gaussian_splatting --shm-size=64g -v /your/local/shared/folder:/workspace/data gaussian_splatting:latest bash
```
Please refer to [Docker's documentation](https://docs.docker.com/) for specific docker instructions.
## Cloning the Repository
The repository contains submodules, thus please check it out with
@ -337,6 +354,7 @@ cd SIBR_viewers
cmake -Bbuild . -DCMAKE_BUILD_TYPE=Release # add -G Ninja to build faster
cmake --build build -j24 --target install
```
Alternatively, you can build a docker image using the Dockerfile mentioned above.
#### Ubuntu 20.04
Backwards compatibility with Focal Fossa is not fully tested, but building SIBR with CMake should still work after invoking