mdaiter / openMVG

openMVG with a LATCH descriptor, an ORB descriptor, DEEP descriptors from the cvpr15compare repo, PNNet/Torch loader and a GPU-based L2 matcher integrated
Other
31 stars 20 forks source link

Compilation issue #8

Closed donlk closed 8 years ago

donlk commented 8 years ago

@mdaiter @csp256 Did you guys used CUDA 8 as a base for the implementation? I'm getting compilation errors about definitions allegedly introduced in CUDA 8.0. Here: nvcc fatal : Value 'sm_60' is not defined for option 'gpu-architecture' CMake Error at cunn_generated_ReLU.cu.o.cmake:203 (message): Error generating /mnt/linuxdata/Development/work/projects/sfmrecon/built/linux-x86_64/openMVG-prefix/src/openMVG-build/openMVG/features/deep/cunnproduction/CMakeFiles/cunn.dir//./cunn_generated_ReLU.cu.o and here: nvcc fatal : Unsupported gpu architecture 'compute_60' CMake Error at latch_cuda_generated_latch.cu.o.cmake:203 (message): Error generating /mnt/linuxdata/Development/work/projects/sfmrecon/built/linux-x86_64/openMVG-prefix/src/openMVG-build/openMVG/features/latch/CMakeFiles/latch_cuda.dir//./latch_cuda_generated_latch.cu.o

Also, i compiled Torch myself, but i did not get a THNets_CPU library as an output that is apparently required: CMake Error: install(EXPORT "openMVG-targets" ...) includes target "deepDescriptorTHNets_static" which requires target "THNets_CPU" that is not in the export set.

And lastly, i see thnets depends on cudnn for which the usage is bound to registration here https://developer.nvidia.com/cudnn
This might complicate the build process for openMVG and violate its openness to some degree.

I'm using my own openMVG branch merged with the latest develop upstream and mdaiter's custom one: https://github.com/donlk/openMVG/tree/gpu_matcher

mdaiter commented 8 years ago

Hey @donlk , I did use CUDA 8.0 for this implementation, coupled with CuDNN v5.0. This was to allow for my code to run on my GTX 1080.

You can change sm_60 to sm_53 or really sm_30. All of the above should work.

I'm not too sure as to why THNets_CPU wouldn't be included in the compilation process. To ensure that this version builds, I just did a clean Git pull and recompile. It built flawlessly for me. However, I'll add in an explicit install to the openMVG_targets for you.

Give me 5 minutes.

mdaiter commented 8 years ago

Hey @donlk , Just pushed! Could you please:

  1. Run git submodule update
  2. Run git pull ; git fetch

and test if it works? Thanks!

donlk commented 8 years ago

Just tried it. Previous issues are gone, but there is a new one:

[ 44%] Building NVCC (Device) object openMVG/features/deep/thnets/CMakeFiles/THNets_CUDA.dir/cudnn/THNets_CUDA_generated_cunn_SpatialMaxUnpooling.cu.o /usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char *) memcpy (__dest, __src, __n) + __n; CMake Error at THNets_CUDA_generated_cunn_SpatialMaxUnpooling.cu.o.cmake:267 (message): Error generating file /mnt/linuxdata/Development/work/projects/sfmrecon/built/linux-x86_64/openMVG-prefix/src/openMVG-build/openMVG/features/deep/thnets/CMakeFiles/THNets_CUDA.dir/cudnn/./THNets_CUDA_generated_cunn_SpatialMaxUnpooling.cu.o openMVG/features/deep/thnets/CMakeFiles/THNets_CUDA.dir/build.make:461: recipe for target 'openMVG/features/deep/thnets/CMakeFiles/THNets_CUDA.dir/cudnn/THNets_CUDA_generated_cunn_SpatialMaxUnpooling.cu.o' failed make[2]: *** [openMVG/features/deep/thnets/CMakeFiles/THNets_CUDA.dir/cudnn/THNets_CUDA_generated_cunn_SpatialMaxUnpooling.cu.o] Error 1 CMakeFiles/Makefile2:1429: recipe for target 'openMVG/features/deep/thnets/CMakeFiles/THNets_CUDA.dir/all' failed make[1]: *** [openMVG/features/deep/thnets/CMakeFiles/THNets_CUDA.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

mdaiter commented 8 years ago

@donlk this seems like a compiler error with no forced inlining, as referenced here: https://github.com/BVLC/caffe/issues/4046 and here: https://github.com/tensorflow/tensorflow/issues/1346 . I just added a CMake forced inlining function. Can you please retry? Thanks.

donlk commented 8 years ago

Yes you're right, i forgot i already encountered this issue in the past during OpenCV compilation which required the same solution. It compiles fine now, though there is a runtime issue as well, for which i opened a new ticket: https://github.com/mdaiter/openMVG/issues/10 You can close this one.

mdaiter commented 8 years ago

Thanks @donlk ! I'll check out that issue ASAP.