htkseason / VOLDOR

VOLDOR-SLAM is a real-time dense-indirect SLAM system takes dense optical flows as input that supports monocular, stereo and RGB-D video sequence.
472 stars 56 forks source link

Build VO/SLAM Pipeline #8

Closed Xrigok closed 3 years ago

Xrigok commented 3 years ago

你好,我在Build VO/SLAM Pipeline的时候出现了底下这个问题,想请问下你的gcc版本是哪个,我的是5.4.0 /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

error This file requires compiler and library support \

htkseason commented 3 years ago

5.4.0可能老了些。Linux下我用的是Ubuntu18默认的gcc,查了下好像是7.4。你可以尝试更新下。或者可以试试把extra_compile_args=["-std=c++11"] 放进setup.pyExtionsion里。

Xrigok commented 3 years ago

感谢回复,C++标准是解决了,但,现在是gpu error,我的gpu version是11.2的,具体error在图里,要是知道怎么解决,麻烦教我下,谢谢

------------------ 原始邮件 ------------------ 发件人: "htkseason/VOLDOR" @.>; 发送时间: 2021年8月13日(星期五) 下午2:00 @.>; @.**@.>; 主题: Re: [htkseason/VOLDOR] Build VO/SLAM Pipeline (#8)

5.4.0可能老了些。Linux下我用的是Ubuntu18默认的gcc,查了下好像是7.4。你可以尝试更新下。或者可以试试把extra_compile_args=["-std=c++11"] 放进setup.py的Extionsion里。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

htkseason commented 3 years ago

你好,我没看到图。

Xrigok commented 3 years ago

抱歉,以为邮箱回复你能看到图,底下这些错误 ../../gpu-kernels/gmat.h(7): warning: field initializers are a C++11 feature ../../gpu-kernels/align_frame.cu(533): warning: list initialization syntax is a C++11 feature ../../gpu-kernels/alignframe.cu(18): warning: variable "N" was set but never used ../../gpu-kernels/align_frame.cu(22): error: dynamic initialization is not supported for a constant variable ../../gpu-kernels/align_frame.cu(23): error: dynamic initialization is not supported for a constant variable ../../gpu-kernels/align_frame.cu(25): error: dynamic initialization is not supported for a constant variable ../../gpu-kernels/align_frame.cu(26): error: dynamic initialization is not supported for a constant variable ../../gpu-kernels/align_frame.cu(28): error: dynamic initialization is not supported for a constant variable ../../gpu-kernels/align_frame.cu(30): error: dynamic initialization is not supported for a constant variable ../../gpu-kernels/align_frame.cu(31): error: dynamic initialization is not supported for a constant variable ../../gpu-kernels/align_frame.cu(32): error: dynamic initialization is not supported for a constant variable

htkseason commented 3 years ago

可能还是一样的问题,gcc版本有点老,setup.pynvcc那行加个-std=c++11或者搜一下用-ccbin指定个新一些的g++。 另外如果问题解决了,可以请你分享下怎么解决的吗,这样也可以帮到别人。

Xrigok commented 3 years ago

好,感谢你的帮忙

Xrigok commented 3 years ago

换成gcc-7,但还是不行,最后出现这个问题,没有生成pyvoldor_vo.xxx.so /usr/bin/ld: ./libgpu-kernels.so(tmpxft_000142de_00000000-41_collect_p3p_instances.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC ./libgpu-kernels.so: error adding symbols: Bad value collect2: error: ld returned 1 exit status error: command 'g++' failed with exit status 1

htkseason commented 3 years ago

好像是link的问题。确认下nvcc和cython是不是都用的gcc7。或者Extension里加extra_link_args=["-std=c++11"]试试。

Xrigok commented 3 years ago

我原本是用ubuntu16.04,现在换成ubuntu18.04,应该是必须ubuntu18.04和gcc/++-7的才行

htkseason commented 3 years ago

好的,等有机会我研究下ubuntu16的问题。

Xrigok commented 3 years ago

在运行demo的时候出现以下的问题,定位了下,是vo_ret = self.cython_process_pool.apply(py_voldor_funmap)这一句,你在初始化 self.cython_process_pool的时候写了# Linux remote processing have problem with some opencv builds...,你当初是re building opencv还是怎么解决的? terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(3.4.14) /tmp/opencv-3.4.14/modules/highgui/src/window.cpp:652: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvDestroyAllWindows'

htkseason commented 3 years ago

应该和我comment的内容无关,linux上用的已经是兼容性比较好的threadpool了,改用processpool会更快些,但对opencv的build有一些要求。

你这个确实是opencv的问题,我测试过apt install的opencv是可以跑的,只是不能用cpu的ap3p,你可以试试sudo apt install libopencv-dev

或者你按照他的错误提示,装一下libgtk2.0,再build。

Xrigok commented 3 years ago

我换了opencv3.2后解决了

Xrigok commented 3 years ago

我仔细看了下demo的结果,0 keyframes registered,运行过程中有一堆这样的输出,我的cuda是11.1的,卡是 Tesla V100,我是需要改下*.cu里的代码再build还是? ../../gpu-kernels/collect_p3p_instances.cu at line 186 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/solve_batch_lambdatwist.cu at line 86 GPUassert : invalid device symbol ../../gpu-kernels/meanshift.cu at line 79 GPUassert : invalid device symbol ../../gpu-kernels/collect_p3p_instances.cu at line 186 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/solve_batch_lambdatwist.cu at line 86 GPUassert : invalid device symbol ../../gpu-kernels/meanshift.cu at line 79 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/optimize_depth.cu at line 362 GPUassert : invalid device symbol ../../gpu-kernels/collect_p3p_instances.cu at line 186 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/solve_batch_lambdatwist.cu at line 86 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/reduce_vector_sum.h at line 53 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/reduce_vector_sum.h at line 53 GPUassert : invalid device symbol ../../gpu-kernels/meanshift.cu at line 133 GPUassert : invalid device symbol ../../gpu-kernels/collect_p3p_instances.cu at line 186 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/solve_batch_lambdatwist.cu at line 86 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/reduce_vector_sum.h at line 53 GPUassert : no kernel image is available for execution on the device ../../gpu-kernels/reduce_vector_sum.h at line 53 GPUassert : invalid device symbol ../../gpu-kernels/meanshift.cu at line 133 GPUassert : invalid device symbol ../../gpu-kernels/collect_p3p_instances.cu at line 186

htkseason commented 3 years ago

你这个卡不错。试试看把setup.py里的nvcc_machine_code删了,或者根据link改一下。