Compilation errors: Kubuntu 18 + Cuda V 9

185 views
Skip to first unread message

gryph...@gmail.com

unread,
Jul 28, 2018, 5:40:13 AM7/28/18
to COLMAP
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

gryph...@gmail.com

unread,
Jul 28, 2018, 5:45:17 AM7/28/18
to COLMAP
Just to note: this was posted incomplete yesterday. This is the complete post.

Johannes Schönberger

unread,
Jul 28, 2018, 3:49:46 PM7/28/18
to col...@googlegroups.com
Did you checkout the latest commit in the dev branch of COLMAP? There was a recent fix that prevents compute architecture 2 from being compiled under CUDA 9. In case you actually need to compile for compute architecture 2 (which is quite old), because you have an older GPU, then the only option is to downgrade to CUDA 8. In this case, you already discovered that CUDA is not compatible with the default GCC version. The reason your are seeing linker errors for boost is that the default boost packages in the Ubuntu repository were compiled with a different GCC version, which is not fully compatible. To fix the problem, you would have to manually compile boost with the same GCC version as used in COLMAP and link against that version. 
--
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/59afeac3-e4dd-4472-80c3-1ba15b3e9cb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages