colmap icon indicating copy to clipboard operation
colmap copied to clipboard

Colmap on linux without display and with GPU

Open pratibhashinde opened this issue 4 years ago • 18 comments

Hello everyone,

I am new to colmap. I installed it using "conda install -c conda-forge colmap". When the installation is done, I tried to run colmap automatic reconstructor. But it is giving an error : qt:qpa:plugin: could not connect to display. I cannot connect to the display as I am on the server and already having 2 GPU to run.

Can anyone tell me how to use colmap on linux server with gpu and without display?

Thanks.

pratibhashinde avatar Feb 18 '22 17:02 pratibhashinde

You can call the individual stages manually as they can run without an attached display. See https://colmap.github.io/cli.html for examples.

tsattler avatar Feb 24 '22 10:02 tsattler

Is there a special flag to force this behavior? Either during installation or running? I'm experiencing the same issue with a Linux server that I'm trying to run COLMAP on remotely.

I run the following (changing DATASET_PATH correctly):

$  conda install -c conda-forge colmap

$ DATASET_PATH=/path/to/project

$ colmap automatic_reconstructor \
    --workspace_path $DATASET_PATH \
    --image_path $DATASET_PATH/images

But I get the following error:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

So I try and run the CLI step by step:

$ colmap feature_extractor \
   --database_path $DATASET_PATH/database.db \
   --image_path $DATASET_PATH/images

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

Am I doing something wrong? Should I install via a different method?

marc-micatka avatar May 10 '22 20:05 marc-micatka

I'm having the same issue and I also installed colmap using conda.

nicktasios avatar Aug 02 '22 14:08 nicktasios

I solved the issue, as it were, by using The docker environment provided and running the gui locally to see the results.

marc-micatka avatar Aug 02 '22 16:08 marc-micatka

I solved the issue, as it were, by using The docker environment provided and running the gui locally to see the results.

Could you please explain in detail how to solve it?

tb2-sy avatar Aug 07 '22 08:08 tb2-sy

I couldn't get COLMAP to install with GUI support on a server. Instead, I'm using the docker environment provided in this repo to run COLMAP and output the dense reconstruction. So there's not many steps involved in the solution. The link here explains how to do it.

marc-micatka avatar Aug 08 '22 15:08 marc-micatka

experiencing same problem as @marc-micatka

did you use the official image?

I try to build it myself, with CUDA enable, GUI must be enabled, then the xcb problem persists

if it make with GUI disabled, CUDA build fails :(

DeoLeung avatar Aug 11 '22 10:08 DeoLeung

@DeoLeung have you tried the docker image linked? Are you able to run the automatic reconstruction via the image?

marc-micatka avatar Aug 11 '22 13:08 marc-micatka

pulling the latest colmap/colmap:latest works :)

but the problem persists if I download the tar.gz from 3.7 tag and build it following the related Dockerfile

and it seems the tar shows colmap version 3.8, maybe sth wrong with the tag?

DeoLeung avatar Aug 15 '22 02:08 DeoLeung

Using the colmap/colmap:latest Docker image works to run it headless on Linux, but it doesn't use the GPU.

constantm avatar Nov 09 '22 03:11 constantm

I was to build and run without a GUI by making the following changes:

  1. In CMakeLists.txt change this option to be "OFF" option(GUI_ENABLED "Whether to enable the graphical UI" OFF)

  2. In colmap/src/feature/sift.cc remove the include guard on 39 and 41 to include GL/glew.h #if !defined(GUI_ENABLED) && !defined(CUDA_ENABLED)

This currently in a PR here: https://github.com/colmap/colmap/pull/1654

mtwardowski avatar Dec 09 '22 11:12 mtwardowski

@mtwardowski would you please explain the second step in details? remove all from 39 to 41? Thank you!

zhouqm2008 avatar Dec 23 '22 08:12 zhouqm2008

I believe he meant to do comment lines 39 and 41. And also I would comment "endif" block. Result should look like this (I have commented lines 39, 41, 44, 45): image

I did installation without GUI on Google Colab folowing comment from @mtwardowski and it worked for me. Also it is possible to set cmake variables in the command line directly without changing 'CMakeLists.txt: !cmake -B build -GNinja -DGUI_ENABLED=OFF

Sirorezka avatar Feb 26 '24 22:02 Sirorezka