8000 Cleaned up docker readme and scripts by ahojnnes · Pull Request #1852 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cleaned up docker readme and scripts #1852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM nvidia/cuda:11.7.0-devel-ubuntu22.04

ARG COLMAP_VERSION=dev
ARG CUDA_ARCHITECTURES=native
ENV QT_XCB_GL_INTEGRATION=xcb_egl

# Prevent stop building ubuntu at time zone selection.
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
69 changes: 32 additions & 37 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,58 @@
# How to build COLMAP using Docker

## Requirements
- A linux based host machine with at least one NVIDIA GPU<sup>[1](#f1)</sup>.

## Quick Start:
- Host machine with at least one NVIDIA GPU/CUDA support and installed drivers
(to support dense reconstruction).
- Docker (for CUDA support 19.03+).

1. Check that Docker >=19.03<sup>[2](#f2)</sup> installed on your host machine:
## Quick Start

`docker --version`
1. Check that Docker >=19.03 installed on your host machine:

2. Check that you have an NVIDIA driver installed on your host machine<sup>[5](#f5)</sup>:
```
docker --version
```

`nvidia-smi`
2. Check that you have an NVIDIA driver installed on your host machine:

3. Setup the nvidia-toolkit on your host machine<sup>[3](#f3)</sup>:
```
nvidia-smi
```

For Ubuntu host machines: `./setup-ubuntu.sh`
3. Setup the nvidia-toolkit on your host machine:

For CentOS host machines: `./setup-centos.sh`
For Ubuntu host machines: `./setup-ubuntu.sh`
For CentOS host machines: `./setup-centos.sh`

4. Run the *quick-start* script, using the *full local path* to your prefered
local working directory (a folder with your input files/images, etc.):
4. Run the *run* script, using the *full local path* to your prefered local
working directory (a folder with your input files/images, etc.):

`./quick-start.sh /path/where/your/working/folder/is`
```
./run.sh /path/where/your/working/folder/is
```

This will put you in a directory (inside the Docker container) mounted to the
local path you specified. Now you can run COLMAP binaries<sup>[4](#f4)</sup>
on your own inputs like this:
This will put you in a directory (inside the Docker container) mounted to
the local path you specified. Now you can run COLMAP binaries on your own
inputs like this:

`colmap automatic_reconstructor --image_path ./images --workspace_path .`
```
colmap automatic_reconstructor --image_path ./images --workspace_path .
```

## Build from Scratch

After completing steps 1-3, you can alternatively build the docker image from
scratch based on the **Dockerfile** (e.g., with your own modifications) using:

`./build.sh /path/where/your/working/folder/is`

## Notes

Running COLMAP binaries can use a lot of memory (depending on the size of your
data set / imagery). Docker has a relatively small default memory setting
(2Gb on Mac). You will probably want to increase this before you run any larger
workflows. From Docker desktop on Mac for example, just open the Docker GUI, go
to the *Advanced* tab and increase via the slider:

![](docker-memory-settings.png?raw=true)

<a name="f1">1</a>: COLMAP needs NVIDA GPU compute hardware for dense reconstruction (as of 12/10/2019), and is optional for feature extraction and matching.

<a name="f2">2</a>: This is because Docker 19.03+ natively supports NVIDIA GPUs.

<a name="f3">3</a>: You should get a similar output to what you get when you ran step 2 on your host, since the docker container is detecting the same GPU(s). If you have trouble, you may want to read the [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) webpage, as the scripts `./setup-ubuntu.sh` and `./setup-centos.sh` are based on instructions posted there and may change over time.
```
./build.sh
./run.sh /path/where/your/working/folder/is
```

<a name="f4">4</a>: Right now this workflow is designed to build the latest release of COLMAP. To build a specific release, open up the Dockerfile and append '--branch *RELEASE_TAG*' as indicated in the Dockerfile, with *RELEASE_TAG* being the specific release you want to build.
## Troubleshooting

<a name="f5">5</a>: If it is not yet installed, install an NVIDIA driver and NVIDIA container runtime:
Install an NVIDIA driver and NVIDIA container runtime:

```
sudo apt install ubuntu-drivers-common
Expand All @@ -69,5 +66,3 @@ ubuntu-drivers devices
e.g.
sudo apt install nvidia-driver-455
```

ref: “https://collabnix.com/introducing-new-docker-cli-api-support-for-nvidia-gpus-under-docker-engine-19-03-0-beta-release/”
3 changes: 2 additions & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
docker build -t="colmap:latest" .
docker run --gpus all -w /working -v $1:/working -it colmap:latest
# In some cases, you may have to explicitly specify the compute architecture:
# docker build -t="colmap:latest" --build-arg CUDA_ARCHITECTURES=75 .
Binary file removed docker/docker-memory-settings.png
Binary file not shown.
9 changes: 9 additions & 0 deletions docker/run-gui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
docker pull colmap/colmap:latest
docker run \
-e QT_XCB_GL_INTEGRATION=xcb_egl \
-e DISPLAY=:0 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--gpus all \
--privileged \
-it colmap/colmap:latest \
colmap gui
File renamed without changes.
0