ubuntu20.04 配置 SUMA++ 全流程
前言
最近在阅读语义SLAM的相关文献,其中就有suma++,但大家复现的往往都是18.04版本,所以只能自己开一个了。
安装rangenet_lib
由于suma++中,TensorRT版本较老在我的电脑上没发用,因此只能寻找新方案。首先找到了TensorRT8的相关库。参考1
感谢大佬!!!!
首先根据rangnet_lib安装对应依赖,然后在gitclone步骤按这个来
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/ros/catkin.git
git clone https://github.com/vincenzo0603/rangenet_lib_forTensorRT8XX.git
cd .. && catkin init
catkin build rangenet_lib
error1:
Errors << rangenet_lib:make /home/beabbit/study_space/SuMa++/logs/rangenet_lib/build.make.000.log
In file included from /home/beabbit/study_space/SuMa++/src/rangenet_lib_forTensorRT8XX/src/netTensorRT.cpp:7:
/home/beabbit/study_space/SuMa++/src/rangenet_lib_forTensorRT8XX/include/netTensorRT.hpp:9:10: fatal error: NvInfer.h: 没有那个文件或目录
9 | #include <NvInfer.h>
| ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/rangenet_lib.dir/build.make:89:CMakeFiles/rangenet_lib.dir/src/netTensorRT.cpp.o] 错误 1
make[2]: *** 正在等待未完成的任务....
In file included from /home/beabbit/study_space/SuMa++/src/rangenet_lib_forTensorRT8XX/include/selector.hpp:16,
from /home/beabbit/study_space/SuMa++/src/rangenet_lib_forTensorRT8XX/src/selector.cpp:8:
/home/beabbit/study_space/SuMa++/src/rangenet_lib_forTensorRT8XX/include/netTensorRT.hpp:9:10: fatal error: NvInfer.h: 没有那个文件或目录
9 | #include <NvInfer.h>
| ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/rangenet_lib.dir/build.make:76:CMakeFiles/rangenet_lib.dir/src/selector.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:305:CMakeFiles/rangenet_lib.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
cd /home/beabbit/study_space/SuMa++/build/rangenet_lib; catkin build --get-env rangenet_lib | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd -
解决方案:
1.在终端定位缺少文件的位置(以我上面的问题距离)
sudo locate NvInfer.h
得到
/home/beabbit/study_space/package/TensorRT-8.2.1.8/include/NvInfer.h
2.在Cmakelist.txt文件中加入:
include_directories(/home/beabbit/study_space/package/TensorRT-8.2.1.8/include)
再次编译,问题解决。
Suma++安装
首先在src文件夹中打开终端gitclone,注意和rangnet_lib为同一个文件夹。
git clone https://github.com/PRBonn/semantic_suma.git
然后查看opengl版本。
glxinfo | grep "version"
得到
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.6.0 NVIDIA 525.147.05
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 525.147.05
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 525.147.05
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
GL_EXT_shader_group_vote, GL_EXT_shader_implicit_conversions,
可知版本为4.6.0,以此在终端
cd .. && catkin build --save-config -i --cmake-args -DCMAKE_BUILD_TYPE=Release -DOPENGL_VERSION=460 -DENABLE_NVIDIA_EXT=YES
Error1:
[semantic_suma:cmake] CMake Error at /home/beabbit/study_space/SuMa++/src/semantic_suma/CMakeLists.txt:61 (COMPILE_SHADERS):
[semantic_suma:cmake] Unknown CMake command "COMPILE_SHADERS".
我怀疑所以我我一直使用sudo的问题,后续把整个工程清零,重新来一般这无这个问题。
Error2:
RT8XX/include/netTensorRT.hpp:9:10: fatal error: NvInfer.h: 没有那个文件或目录
[semantic_suma:make] 9 | #include <NvInfer.h>
解决方法和之前一样
终于编译成功,按照要求下载model并且在suma中的config文件设置好路径后就可以了
运行suma++
一开始就遇到一个错误
(dxtorch) beabbit@beabbit-Lenovo-Legion-Y7000-2020:~/study_space/SuMa++$ ./src/semantic_suma/bin/visualizer
OpenGL Context Version 4.6 core profile
GLEW initialized.
OpenGL context version: 4.6
OpenGL vendor string : NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1650/PCIe/SSE2
terminate called after throwing an instance of 'rv::XmlError'
what(): Error while parsing in line 1
已放弃 (核心已转储)
后发现只要在bin文件夹中打开终端就不会了,第一次运行有点久后面就可以拉,完美结束!