colmap / colmap

COLMAP - Structure-from-Motion and Multi-View Stereo
https://colmap.github.io/
Other
7.36k stars 1.49k forks source link

Min Requirements for Compilation - where to find? (CM on Kubuntu 22.04 - older Hardware) #2571

Open luisseyfer opened 3 months ago

luisseyfer commented 3 months ago

Hello, I try to compile CM-3.9.1 on a older Dell with Quadro 3000M. Nvidia recommends Driver 390 which runs fine, but requires CUDA 9.1, which requires gcc-6. This is at least result of some days digging into subject. I was able to bring all this together. (Cuda run files and gcc from older Kubuntu) Unfortunately I always end up with compiler errors. I downloaded and extracted code manually. Inside package:

mkdir colmap-2024-05
 export CC=/usr/bin/gcc-6 && export CXX=/usr/bin/g++-6 && export CUDAHOSTCXX=/usr/bin/g++-6
cmake -DCMAKE_CUDA_ARCHITECTURES= all .. -GNinja

...results in:

...
  "tmp/CMakeCUDACompilerId.ptx"

  /usr/include/x86_64-linux-gnu/bits/floatn.h(74): error: invalid argument to
  attribute "__mode__"

  /usr/include/x86_64-linux-gnu/bits/floatn.h(86): error: identifier
  "__float128" is undefined

  2 errors detected in the compilation of "tmp/CMakeCUDACompilerId.cpp1.ii".

  # --error 0x1 --

Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test)
  /usr/share/cmake-3.22/Modules/CMakeDetermineCUDACompiler.cmake:298 (CMAKE_DETERMINE_COMPILER_ID)
  cmake/FindDependencies.cmake:123 (enable_language)
  CMakeLists.txt:96 (include)

Complete logs are attatched.

There are many results if you google for float128 error, but I am unable to make something useful out of them. Could someone give me some advice how to solve this?

I guess I should try an older CM version. Where can I find min requirements?

CMakeOutput.log CMakeError.log

kevincaradant commented 3 months ago

Hi,

I feel less alone with this particular use case. I have exactly the same challenge with a GT 650M. It seems like we're close to a solution, but I'm encountering these two issues:


/usr/include/x86_64-linux-gnu/bits/floatn.h(74): error: invalid argument to attribute "__mode__"

/usr/include/x86_64-linux-gnu/bits/floatn.h(86): error: identifier "__float128" is undefined

Did you find a solution? I'm having this issue while compiling FFmpeg, but I suspect it will occur with other compilations as well.

Thanks.

kevincaradant commented 3 months ago

@luisseyfer I don't know if it will help you / resolve your main issue, however I successfully build it ( I lost one day on 4 diffrent issues with gcc ect )

Anyway, I suggest to you to edit the floatn.h file and replace it with :

/* Macros to control TS 18661-3 glibc features.
   Copyright (C) 2017-2018 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <http://www.gnu.org/licenses/>.  */

/* Defined to 1 if the current compiler invocation provides a
   floating-point type with the IEEE 754 binary128 format, and this glibc
   includes corresponding *f128 interfaces for it.  */
#define __HAVE_FLOAT128 0

/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
   from the default float, double and long double types in this glibc.  */
#define __HAVE_DISTINCT_FLOAT128 0

/* Defined to 1 if the current compiler invocation provides a
   floating-point type with the right format for _Float64x, and this
   glibc includes corresponding *f64x interfaces for it.  */
#define __HAVE_FLOAT64X 0

/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
   of long double.  Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
   the format of _Float128, which must be different from that of long
   double.  */
#define __HAVE_FLOAT64X_LONG_DOUBLE 0

#ifndef __ASSEMBLER__

/* Defined to concatenate the literal suffix to be used with _Float128
   types, if __HAVE_FLOAT128 is 1.
   E.g.: #define __f128(x) x##f128.  */
# undef __f128

/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.
   E.g.: #define __CFLOAT128 _Complex _Float128.  */
# undef __CFLOAT128

#endif /* !__ASSEMBLER__.  */

#include <bits/floatn-common.h>

Make a backup of the original file before to apply the change ( in case you need to revert it ) ;)

luisseyfer commented 3 months ago

Thanks Kevin I will give it a try

luisseyfer commented 3 months ago

It compiled through. with only some warnings. I did a test run. Unfortunately it produces no results:

...
I0529 22:37:25.941097 36104 feature_extraction.cc:255] Processed file [1086/1087]
I0529 22:37:25.941134 36104 feature_extraction.cc:258]   Name:            series-a-portrait/images/_DSC6487.png
I0529 22:37:25.941148 36104 feature_extraction.cc:284]   Dimensions:      2005 x 3593
I0529 22:37:25.941161 36104 feature_extraction.cc:287]   Camera:          #238 - SIMPLE_RADIAL
I0529 22:37:25.941181 36104 feature_extraction.cc:290]   Focal Length:    4311.60px
I0529 22:37:25.941191 36104 feature_extraction.cc:303]   Features:        9202
I0529 22:37:27.227664 36104 feature_extraction.cc:255] Processed file [1087/1087]
I0529 22:37:27.227699 36104 feature_extraction.cc:258]   Name:            series-a-portrait/images/_DSC6488.png
I0529 22:37:27.227711 36104 feature_extraction.cc:284]   Dimensions:      2004 x 3591
I0529 22:37:27.227720 36104 feature_extraction.cc:287]   Camera:          #239 - SIMPLE_RADIAL
I0529 22:37:27.227739 36104 feature_extraction.cc:290]   Focal Length:    4309.20px
I0529 22:37:27.227756 36104 feature_extraction.cc:303]   Features:        8408
I0529 22:37:27.380143 36087 timer.cc:91] Elapsed time: 9.496 [minutes]
I0529 22:37:27.384166 36157 misc.cc:198] 
==============================================================================
Exhaustive feature matching
==============================================================================
E0529 22:37:27.474249 36167 sift.cc:1259] Not enough GPU memory to match 13339 features. Reduce the maximum number of matches.
E0529 22:37:27.474669 36167 feature_matching_utils.cc:211] Failed to create feature matcher.
I0529 22:37:27.479388 36086 incremental_mapper.cc:225] Loading database
I0529 22:37:27.483858 36086 database_cache.cc:65] Loading cameras...
I0529 22:37:27.484112 36086 database_cache.cc:75]  239 in 0.000s
I0529 22:37:27.484123 36086 database_cache.cc:83] Loading matches...
I0529 22:37:27.484145 36086 database_cache.cc:89]  0 in 0.000s
I0529 22:37:27.484153 36086 database_cache.cc:105] Loading images...
I0529 22:37:27.484887 36086 database_cache.cc:155]  239 in 0.001s (connected 0)
I0529 22:37:27.484913 36086 database_cache.cc:166] Building correspondence graph...
I0529 22:37:27.484925 36086 database_cache.cc:203]  in 0.000s (ignored 0)
I0529 22:37:27.484947 36086 timer.cc:91] Elapsed time: 0.000 [minutes]
W0529 22:37:27.484956 36086 incremental_mapper.cc:247] No images with matches found in the database
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 21816, resource id: 14680715, major code: 40 (TranslateCoords), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 21990, resource id: 14680723, major code: 40 (TranslateCoords), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 22041, resource id: 14680655, major code: 40 (TranslateCoords), minor code: 0
kevincaradant commented 3 months ago

My intention was to assist in resolving the "float" point issues you mentioned. It seems to have compiled successfully after that. Now, you appear to be encountering an issue with colmap itself, but I don't know what it is (colmap) to be honest. I came (randomly) across your query because of the errors you shared ;)

/usr/include/x86_64-linux-gnu/bits/floatn.h(74): error: invalid argument to attribute "__mode__"

/usr/include/x86_64-linux-gnu/bits/floatn.h(86): error: identifier "__float128" is undefined

Just what I understand:

Maybe look about this

E0529 22:37:27.474249 36167 sift.cc:1259] Not enough GPU memory to match 13339 features. Reduce the maximum number of matches.

Which is about to have restricted features used because there is no enought memory on the GPU. Maybe you could specify the features wanted ?

That seems to give you this in consequence :

W0529 22:37:27.484956 36086 incremental_mapper.cc:247] No images with matches found in the database

However, I don't know the subject, sorry, I can't help you on this issue

luisseyfer commented 2 months ago

Thanks again. Your help is very much appreciated.