Skip to content

Commit

Permalink
Merge pull request #120 from tensorush/master
Browse files Browse the repository at this point in the history
Add VS Code Dev Container 🐳
  • Loading branch information
Tom94 committed Feb 8, 2022
2 parents eef9618 + 8111fde commit 892933b
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
FROM nvidia/cuda:10.2-devel-ubuntu18.04

ENV COLMAP_VERSION=3.7
ENV CMAKE_VERSION=3.21.0
ENV PYTHON_VERSION=3.7.0
ENV OPENCV_VERSION=4.5.5.62
ENV CERES_SOLVER_VERSION=2.0.0

RUN echo "Installing apt packages..." \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt -y update --no-install-recommends \
&& apt -y install --no-install-recommends \
git \
wget \
ffmpeg \
tk-dev \
libxi-dev \
libc6-dev \
libbz2-dev \
libffi-dev \
libomp-dev \
libssl-dev \
zlib1g-dev \
libcgal-dev \
libgdbm-dev \
libglew-dev \
python3-dev \
python3-pip \
qtbase5-dev \
checkinstall \
libglfw3-dev \
libeigen3-dev \
libgflags-dev \
libxrandr-dev \
libopenexr-dev \
libsqlite3-dev \
libxcursor-dev \
build-essential \
libcgal-qt5-dev \
libxinerama-dev \
libboost-all-dev \
libfreeimage-dev \
libncursesw5-dev \
libatlas-base-dev \
libqt5opengl5-dev \
libgoogle-glog-dev \
libsuitesparse-dev \
python3-setuptools \
libreadline-gplv2-dev \
&& apt autoremove -y \
&& apt clean -y \
&& export DEBIAN_FRONTEND=dialog

RUN echo "Installing Python ver. ${PYTHON_VERSION}..." \
&& cd /opt \
&& wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
&& tar xzf Python-${PYTHON_VERSION}.tgz \
&& cd ./Python-${PYTHON_VERSION} \
&& ./configure --enable-optimizations \
&& make \
&& checkinstall

COPY ./requirements.txt ./

RUN echo "Installing pip packages..." \
&& python3 -m pip install -U pip \
&& pip3 --no-cache-dir install -r ./requirements.txt \
&& pip3 --no-cache-dir install cmake==${CMAKE_VERSION} opencv-python==${OPENCV_VERSION} \
&& rm ./requirements.txt

RUN echo "Installing Ceres Solver ver. ${CERES_SOLVER_VERSION}..." \
&& cd /opt \
&& git clone https://github.com/ceres-solver/ceres-solver \
&& cd ./ceres-solver \
&& git checkout ${CERES_SOLVER_VERSION} \
&& mkdir ./build \
&& cd ./build \
&& cmake ../ -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF \
&& make -j \
&& make install

RUN echo "Installing COLMAP ver. ${COLMAP_VERSION}..." \
&& cd /opt \
&& git clone https://github.com/colmap/colmap \
&& cd ./colmap \
&& git checkout ${COLMAP_VERSION} \
&& mkdir ./build \
&& cd ./build \
&& cmake ../ \
&& make -j \
&& make install \
&& colmap -h
18 changes: 18 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## VS Code Dev Container

> Basic dev container for running Instant Neural Graphics Primitives without GUI.
### Requirements

- #### **[Docker](https://www.docker.com/get-started)**

- #### **[VS Code](https://code.visualstudio.com/Download)**

- #### **[Docker VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)**

### How to build

```sh
cmake -DNGP_BUILD_WITH_GUI=off ./ -B ./build
cmake --build build --config RelWithDebInfo -j 16
```
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Instant NGP Dev Container",
"build": {
"context": "..",
"dockerfile": "Dockerfile",
},
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"mutantdino.resourcemonitor",
"ms-azuretools.vscode-docker",
"nvidia.nsight-vscode-edition",
],
}

0 comments on commit 892933b

Please sign in to comment.