DetectorFreeSfM icon indicating copy to clipboard operation
DetectorFreeSfM copied to clipboard

Installation issue

Open hardikdava opened this issue 1 year ago • 14 comments
trafficstars

Hello great work. Thank you for the wonderful idea and trying to solve core issue of sfm. I am trying to install modified version of colmap as per install.md guide but hitting a wall with the installation in docker.

  • Can anyone help me with these errors?
  • Is it possible to disable dense reconstruction from building? That would be good solution.
1226.7 /usr/local/cuda/include/cuda_runtime.h:1726:55:   required from 'cudaError_t cudaBindTextureToArray(const texture<T, dim, readMode>&, cudaArray_const_t) [with T = float; int dim = 242; cudaTextureReadMode readMode = cudaReadModeElementType; cudaError_t = cudaError; cudaArray_const_t = const cudaArray*]'
1226.7 /colmap/src/mvs/patch_match_cuda.cu:1518:36:   required from here
1226.7 /usr/local/cuda/include/cuda_runtime.h:1685:32: warning: 'cudaError_t cudaBindTextureToArray(const textureReference*, cudaArray_const_t, const cudaChannelFormatDesc*)' is deprecated [-Wdeprecated-declarations]
1226.7  1685 |   return ::cudaBindTextureToArray(&tex, array, &desc);
1226.7       |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
1226.7 /usr/local/cuda/include/cuda_runtime_api.h:8898:46: note: declared here
1226.7  8898 | extern __CUDA_DEPRECATED __host__ cudaError_t CUDARTAPI cudaBindTextureToArray(const struct textureReference *texref, cudaArray_const_t array, const struct cudaChannelFormatDesc *desc);
1226.7       |                                              ^~~~~~~~~~~~~~~~~~~~~~
1226.7 /usr/local/cuda/include/cuda_runtime.h: In instantiation of 'cudaError_t cudaBindTextureToArray(const texture<T, dim, readMode>&, cudaArray_const_t, const cudaChannelFormatDesc&) [with T = float; int dim = 2; cudaTextureReadMode readMode = cudaReadModeElementType; cudaError_t = cudaError; cudaArray_const_t = const cudaArray*]':
1226.7 /usr/local/cuda/include/cuda_runtime.h:1726:55:   required from 'cudaError_t cudaBindTextureToArray(const texture<T, dim, readMode>&, cudaArray_const_t) [with T = float; int dim = 2; cudaTextureReadMode readMode = cudaReadModeElementType; cudaError_t = cudaError; cudaArray_const_t = const cudaArray*]'
1226.7 /colmap/src/mvs/patch_match_cuda.cu:1629:36:   required from here
1226.7 /usr/local/cuda/include/cuda_runtime.h:1685:32: warning: 'cudaError_t cudaBindTextureToArray(const textureReference*, cudaArray_const_t, const cudaChannelFormatDesc*)' is deprecated [-Wdeprecated-declarations]
1226.7  1685 |   return ::cudaBindTextureToArray(&tex, array, &desc);
1226.7       |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
1226.7 /usr/local/cuda/include/cuda_runtime_api.h:8898:46: note: declared here
1226.7  8898 | extern __CUDA_DEPRECATED __host__ cudaError_t CUDARTAPI cudaBindTextureToArray(const struct textureReference *texref, cudaArray_const_t array, const struct cudaChannelFormatDesc *desc);
1226.7       |                                              ^~~~~~~~~~~~~~~~~~~~~~
1227.1 CMake Error at colmap_cuda_generated_patch_match_cuda.cu.o.Release.cmake:280 (message):
1227.1   Error generating file
1227.1   /colmap/build/src/CMakeFiles/colmap_cuda.dir/mvs/./colmap_cuda_generated_patch_match_cuda.cu.o
1227.1 
1227.1 
1227.1 make[2]: *** [src/CMakeFiles/colmap_cuda.dir/build.make:91: src/CMakeFiles/colmap_cuda.dir/mvs/colmap_cuda_generated_patch_match_cuda.cu.o] Error 1
1227.1 make[1]: *** [CMakeFiles/Makefile2:723: src/CMakeFiles/colmap_cuda.dir/all] Error 2
1227.1 make: *** [Makefile:136: all] Error 2

hardikdava avatar Jul 30 '24 11:07 hardikdava

Hi, can you post the full error stack?

The error suggests that your version of cuda is using some deprecated elements, are you using an older version of cuda? Can you post your dockerfile as well?

BedirYilmaz avatar Jul 31 '24 14:07 BedirYilmaz

Yes, it is possible to disable dense reconstruction when building COLMAP. This can be done by modifying the CMake configuration. You can add the following flag when running CMake:

-DCMAKE_BUILD_TYPE=Release -DCUDA_ENABLED=OFF

This will disable CUDA and, consequently, the dense reconstruction module which relies heavily on CUDA. If you want to keep CUDA enabled but just disable the MVS (Multi-View Stereo) (see colmap's cmake for more info) module, you can use:

-DCMAKE_BUILD_TYPE=Release -DMVS_ENABLED=OFF

Remember to clean your build directory before reconfiguring with CMake.

BedirYilmaz avatar Jul 31 '24 14:07 BedirYilmaz

@hxy-123 can you help me out here? Thanks in advance.

hardikdava avatar Aug 01 '24 12:08 hardikdava

Hi, could you please specify the CUDA version of your device? This error seems to show that the current CUDA version doesn't support some functions required by COLMAP.

hxy-123 avatar Aug 01 '24 14:08 hxy-123

@hxy-123 Thanks for the reply.

I am using ubuntu-22.04 docker with cuda-11.8. Fyi: I am able to install normal version colmap without any issue.

hardikdava avatar Aug 01 '24 14:08 hardikdava

The newest COLMAP version has removed some CUDA dependencies to support new CUDA versions (>= 11.8). Therefore, we also updated the COLMAP in our modified version. You can try to install the modified COLMAP in this branch. However, the results may be a little different compared with the paper version since our experiments are conducted on the old COLMAP version.

hxy-123 avatar Aug 01 '24 14:08 hxy-123

@hxy-123 okay. I will try it out and let you know how it goes.

hardikdava avatar Aug 01 '24 14:08 hardikdava

@hxy-123 What's the reason of using older version of ceres-solver? I think colmap uses newer version

hardikdava avatar Aug 01 '24 14:08 hardikdava

Our modified part is not relevant to the ceres lib. I think any newer version of ceres lib can be installed as long as it conforms COLMAP's requirements.

hxy-123 avatar Aug 01 '24 14:08 hxy-123

@hxy-123 Thanks for the clarification. I want to test this project to work with 3D gaussian splatting which requires sfm output. Is there anyway to disable dense reconstruction in building stage?

hardikdava avatar Aug 01 '24 14:08 hardikdava

Yes, it is possible to disable dense reconstruction when building COLMAP. This can be done by modifying the CMake configuration. You can add the following flag when running CMake:

-DCMAKE_BUILD_TYPE=Release -DCUDA_ENABLED=OFF

This will disable CUDA and, consequently, the dense reconstruction module which relies heavily on CUDA. If you want to keep CUDA enabled but just disable the MVS (Multi-View Stereo) (see colmap's cmake for more info) module, you can use:

-DCMAKE_BUILD_TYPE=Release -DMVS_ENABLED=OFF

Remember to clean your build directory before reconfiguring with CMake.

I think you can try out this reply. However, I haven't disabled compiling dense reconstruction parts previously.

hxy-123 avatar Aug 01 '24 14:08 hxy-123

@hxy-123 i tried with DFSfM_modify_support_cuda12 branch. I am getting error from building SiftGPU

7.860 [ 23%] Building C object lib/VLFeat/CMakeFiles/vlfeat.dir/mathop_sse2.c.o
14.20 [ 25%] Linking C static library liblsd.a
14.54 [ 25%] Built target lsd
17.76 [ 27%] Linking C static library libvlfeat.a
17.82 [ 27%] Built target vlfeat
18.58 make[1]: *** [CMakeFiles/Makefile2:508: lib/SiftGPU/CMakeFiles/sift_gpu.dir/all] Error 2
18.58 make[1]: *** Waiting for unfinished jobs....
135.1 [ 30%] Linking CXX static library libpoisson_recon.a
135.2 [ 30%] Built target poisson_recon
135.2 make: *** [Makefile:136: all] Error 2

hardikdava avatar Aug 01 '24 15:08 hardikdava

We have tested compiling this branch on the device with CUDA version > 11.8, which works quite well. Maybe you can try to pull this branch to a new repo and compile it again?

hxy-123 avatar Aug 01 '24 15:08 hxy-123

@hxy-123 Thanks for the reply.

I am using ubuntu-22.04 docker with cuda-11.8. Fyi: I am able to install normal version colmap without any issue.

Hello, I am deploying this project on the same version of Ubuntu and CUDA, and I have encountered errors during the compilation of COLMAP. Have you resolved the issue? The compilation error messages I am encountering are as follows: image Reinstalling FLANN did not resolve the issue, and after downgrading the g++ version from 11.4 to 9.5, the errors still occur. Looking forward to your feedback, I would greatly appreciate it.

DEVECLOVER avatar Dec 21 '24 02:12 DEVECLOVER