Colmap seems not using the GPU, very slow reconstruction

3773 views
Skip to first unread message

CrabMing

unread,
Aug 9, 2018, 11:32:45 PM8/9/18
to COLMAP
Hi everyone,

I am new to colmap, so it might be a very stupid question.

I downloaded the executable for windows (COLMAP-dev-windows.zip) and put 200 images for auto-reconstruction with medium quality and GPU selected . Now it has been run for more than 12 hours but it is still being "reconstructing". I noticed that my CPU is running at 50%-100%, but my GPU (GTX1060) is always 0% percent. It seems that the GPU is not helping at all thus such slow reconstruction.

For your information, I am using a laptop with GTX1060 dedicated graphic card and Intel HD 530 integrated graphic card. CPU is Intel i7-6700HQ. OS is windows 10. And I attached the screenshot of the automatic reconstruction as below.

Capture.JPG



I appreciate any advice in advance! Thanks!

Doan Anh Dung

unread,
Aug 10, 2018, 4:18:48 AM8/10/18
to col...@googlegroups.com
Have you installed CUDA? If you installed everything as pointed out in https://colmap.github.io/install.html#id3, you could double-check by only doing feature extraction and feature matching. If it runs fast (around 0.1s), you installed COLMAP properly.


--
You received this message because you are subscribed to the Google Groups "COLMAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/8bc4e05f-5a5a-44c5-9da7-136bebdb0fc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

devin....@gmail.com

unread,
Sep 7, 2018, 9:18:50 AM9/7/18
to COLMAP
I'm in a similar situation, new to Colmap, using the windows precompilled with CUDA version with a 1050, and showing CPU at 25% and GPU at 0% during feature matching and reconstruction, but another OS process (Windows Desktop Manager) is using 50-80% GPU. The instructions you linked to are dependencies to compile in Windows. Does the Windows with CUDA version also require external installation of CUDA?

feature matching is 5-20 sec per image

Doan Anh Dung

unread,
Sep 8, 2018, 4:38:51 AM9/8/18
to col...@googlegroups.com
For clarification, do you mean that while COLMAP is running (feature matching & reconstruction),  Windows Desktop Manager shows 50-80% GPU is consumed???? What is Windows version you are using? NVIDIA card model? version of NVIDIA driver? and CUDA version?

devin....@gmail.com

unread,
Sep 9, 2018, 11:03:33 AM9/9/18
to COLMAP
Windows 10 Pro N 1803
nVidia GeForce GTX 1050 2GB
driver 24.21.13.9793, 5/22/2018
I'm using the current pre-release Windows binaries for COLMAP 3.5 from https://github.com/colmap/colmap/releases which include CUDA 9.2.148

It looks like it's the way that Windows task manager reports usage. I'm running the COLMAP GUI, and inside task manager, COLMAP always shows 0% GPU, while Desktop Window Manager shows activity during feature matching. During reconstruction after matching there is no activity on the GPU.

During feature matching the GPU usage doesn't hit 100%, usually staying a little over 50% (again, under the Desktop Window Manager process), with 1.6 of 2 GB RAM occupied, while COLMAP stays at 25% CPU. I've got a 4 core CPU, so it looks like the GPU may be limited by a single threaded process to control or load the data to the GPU.

During reconstruction (after running matching), GPU is unused by any process. It starts by taking a few seconds to BA each image, but now I'm at image 530 and it looks like it's loading about 30 images at a time, then doing a series of bundle adjustments (4-5 sets of bundle adjustments, running increasing numbers of iterations as the process continues, around 15-20 on the first BA, then 10-12 for the next 3-4). Is this a normal pattern or is there a problem? Do I need to change settings? Should GPU be used in BA?

Thanks for your help,
Devin

Doan Anh Dung

unread,
Sep 9, 2018, 9:12:50 PM9/9/18
to col...@googlegroups.com
It seems that your COLMAP works properly in feature matching.

In the reconstruction, as I know, COLMAP hasn't had GPU support so far. Hope it will be added in the future. Bundle Adjustment (BA) process seems to be OK, because COLMAP does local and global BA interchangeably. But the default BA is Ceres solver, so it is slow when the number of images increase (due to the number of parameters for global BA increase). You could use PBA to leverage all of your GPU cores to perform BA (https://colmap.github.io/tutorial.html#sparse-reconstruction).

Hope my comment is helpful for you :)
Regards.


Doan Anh Dung

unread,
Sep 9, 2018, 9:13:58 PM9/9/18
to col...@googlegroups.com
Sorry, PBA leverages all of you CPU cores (not GPU) :)

seb...@gmail.com

unread,
Sep 29, 2018, 2:32:01 PM9/29/18
to COLMAP
Thanks for the answers though I need to ask some more.I have the same issue. GPU is consistently running around 0% looking at Windows Task Manager (win10). I'm running from command line using:

feature_extractor
exhaustive_matcher
mapper
model_converter

Should it be like this? What times should I expect running around 130 images of size: 2071x2304?

I'm on a RTX 2080 Ti, I have not installed CUDA Toolkit nor have I compiled the binaries. I have only downloaded and run the pre-compiled binaries.

Regards
Sebastian

Johannes Schönberger

unread,
Sep 30, 2018, 4:00:45 AM9/30/18
to col...@googlegroups.com
Only feature extraction, matching and dense reconstruction can take advantage of the GPU if you have CUDA. 

Sebastian Buks

unread,
Oct 2, 2018, 6:25:35 AM10/2/18
to col...@googlegroups.com
It seems Windows 10 Task Manager is reporting wrong. Using MSI Afterburner I can indeed see the GPU being used for the aforementioned tasks.
 

You received this message because you are subscribed to a topic in the Google Groups "COLMAP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/colmap/_KnAM0apWRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to colmap+un...@googlegroups.com.

To post to this group, send email to col...@googlegroups.com.

Johannes Schönberger

unread,
Oct 2, 2018, 1:51:37 PM10/2/18
to col...@googlegroups.com
Yes, the task manager is not good to track the GPU usage. There is also GPUZ, which works well. 

xinqi...@gmail.com

unread,
Oct 11, 2018, 10:19:31 PM10/11/18
to COLMAP
Thanks for the information! I just encounter the similar problem and dig into the code. In incremental_mapper.h I set the "ba_global_use_pba = true" and I check the PBA code to make sure the device is device=pba::ParallelBA::PBA_CUDA_DEVICE_DEFAULT. But the problem is that the running time for sparse reconstruction (mapper) using PBA seems longer than using Ceres library. Do you happen to know why?

Thanks again.

在 2018年9月30日星期日 UTC-7上午1:00:45,Johannes Schönberger写道:
Reply all
Reply to author
Forward
0 new messages