I'm having difficulty compiling Colmap with Cuda, according to the instructions at https://colmap.github.io/install.html, after several attempts.
I'm running Kubuntu 18 with nvidia-cuda-toolkit version 9. This is a fairly new, clean install. I had previously installed the snap colmap-mardy (colmap v. 2.1) but removed it prior to compilation attempt.
Attempt 1:
Compilation failed fails at 25% with this message:
nvcc fatal : Unsupported gpu architecture 'compute_20'
CMake Error at pba_generated_ProgramCU.cu.o.Release.cmake:219 (message):
Error generating
/home/g/Projects/3D_Print_Model/PhotoGram/ColMap/Install/colmap/build/lib/PBA/CMakeFiles/pba.dir//./pba_generated_ProgramCU.cu.o
After reading Reference 1 below I added the nvcc dir to my path.The compilation then fails with:
[ 25%] Building NVCC (Device) object lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o
nvcc fatal : Unsupported gpu architecture 'compute_20'
CMake Error at pba_generated_ProgramCU.cu.o.Release.cmake:219 (message):
Error generating
/home/g/Projects/3D_Print_Model/PhotoGram/ColMap/Install/colmap/build/lib/PBA/CMakeFiles/pba.dir//./pba_generated_ProgramCU.cu.o
lib/PBA/CMakeFiles/pba.dir/build.make:63: recipe for target 'lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o' failed
make[2]: *** [lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o] Error 1
CMakeFiles/Makefile2:485: recipe for target 'lib/PBA/CMakeFiles/pba.dir/all' failed
make[1]: *** [lib/PBA/CMakeFiles/pba.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Attempt 2:
I uninstalled Cuda 9 and installed Cuda 8
Compilation failed again at 25% with the message that PBA does not support gcc version > 5
Attempt3:
In the install script I changed the line
CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake ..
to
CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake ..
Compilation continued to 100% then failed with:[100%] Linking CXX executable colmap
../libcolmap.a(bitmap.cc.o): In function `char const* boost::re_detail_106501::re_is_set_member<char const*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char const*, char const*, boost::re_detail_106501::re_set_long<unsigned int> const*, boost::re_detail_106501::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool)':
bitmap.cc:(.text._ZN5boost16re_detail_10650116re_is_set_memberIPKccNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_S8_S8_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb[_ZN5boost16re_detail_10650116re_is_set_memberIPKccNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_S8_S8_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb]+0x163): undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
bitmap.cc:(.text._ZN5boost16re_detail_10650116re_is_set_memberIPKccNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_S8_S8_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb[_ZN5boost16re_detail_10650116re_is_set_memberIPKccNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_S8_S8_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb]+0x341): undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
collect2: error: ld returned 1 exit status
src/exe/CMakeFiles/colmap_exe.dir/build.make:143: recipe for target 'src/exe/colmap' failed
make[2]: *** [src/exe/colmap] Error 1
CMakeFiles/Makefile2:1184: recipe for target 'src/exe/CMakeFiles/colmap_exe.dir/all' failed
make[1]: *** [src/exe/CMakeFiles/colmap_exe.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
The garbled nature of the text indicated some kind of mismatch, so I reinstalled ceres-solver using gcc-5, but received the same message.
The references (for other applications) indicate that cuda vers. 9 does not support compute_20, and recommend to delete references to it. However I'm unsure how to do that.
I'm also slightly concerned that colmap-mardy snap may have written changes to the GPU. They are self contained but given the snap's size (650MB) it likely has it's own version of Cuda (prob v 8).
I'm now officially way above my paygrade. Can you help?
References: (All regarding compute_20 issue)
1. https://github.com/colmap/colmap/issues/301
2. https://github.com/BVLC/caffe/issues/5141
3. https://stackoverflow.com/questions/48383846/nvcc-fatal-unsupported-gpu-architecture-compute-20-while-cuda-9-1caffeopen
4. https://stackoverflow.com/questions/47129220/nvcc-fatal-unsupported-gpu-architecture-compute-20-while-cuda9-0-is-installe