rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

Can I run the RTAB-MAP by GPU? I hope it can run faster on TX2 .

Open weseu opened this issue 5 years ago • 13 comments

Can I run the RTAB-MAP by GPU? I hope it can run faster on TX2 . Has any way to let the RTAB-MAP CPU code converse into GPU code.

weseu avatar Jun 08 '20 05:06 weseu

There is no explicit GPU options for RTAB-Map. You may take a look at OpenCV and PCL libraries for optimization options they can provide. Probably now outdated, but there were some opencv optimizations for Tegra available in jetpack, see https://github.com/introlab/rtabmap_ros/#build-from-source-for-nvidia-jetson

Other approach is to use smaller images, depending on the camera you are using.

matlabbe avatar Jun 23 '20 18:06 matlabbe

So...It didn't have cuda code now?

well.....did you know have any tools can let the code become cuda code...

weseu avatar Jun 29 '20 02:06 weseu

@weseu There is a significant performance difference in RTAB-Map between the entire support chain (Eigen, OpenCV, VTK, and especially the feature detectors) being built with CUDA support versus without. When you make use of a library that uses CUDA, you are using CUDA.

tkircher avatar Jul 02 '20 15:07 tkircher

Hi @tkircher and @matlabbe ,

I have been working on installing Rtabmap on Xavier NX (with intel realsense D455), following your advice on (https://github.com/introlab/rtabmap/issues/427#issuecomment-1000921742). As I remember I installed Opencv and VTK with CUDA support. However I built PCL without CUDA.

I managed to get rtabmap working correctly, however when running rtabmap I noticed a significant lag while mapping the 3D point cloud, seems like the lag increases with time to the point where it may take 5 seconds for the 3D point cloud to update to new camera position.

Could I know your experience in this case? It would be helpful if there is any suggestion that can help me run rtabmap in real time.

Thanks a lot :)

cannon281 avatar Aug 24 '22 08:08 cannon281

@pramodwic1 I recommend running a profiler to figure out where the CPU is spending so much of its time.

tkircher avatar Aug 24 '22 08:08 tkircher

Hi, @tkircher I am planning to pass GPU side of rtabmap but in PCL side I didn't find to where to look or how to look of CUDA support for PCL. I am using Nvidia Jetson AGX.

tugbakara avatar Aug 31 '22 11:08 tugbakara

@tugbakara There's documentation online for this, see the below link. It essentially requires rebuilding most of the basic libraries from source. When I build rtabmap for Xavier NX, I have to essentially wipe the system and start with NVidia's BLAS and LAPACK, and build Eigen and SuiteSparse and FFTW, all the way up, from source. Otherwise it simply won't work as well as it can. I've benchmarked and profiled rtabmap with different combinations of prebuilt system libraries and there just isn't any other way.

https://pointclouds.org/documentation/tutorials/gpu_install.html

tkircher avatar Aug 31 '22 16:08 tkircher

You mean I have to build not only PCL and openCV also the libs that you listed have to be installed with CUDA support and then rtapmap run ,right?

tugbakara avatar Aug 31 '22 16:08 tugbakara

You mean I have to build not only PCL and openCV also the libs that you listed have to be installed with CUDA support and then rtapmap run ,right?

Yes.

tkircher avatar Aug 31 '22 17:08 tkircher

@tkircher , thank you so much! :)

tugbakara avatar Sep 01 '22 06:09 tugbakara

Hi @tkircher again! You mentioned libs for example BLAS,LAPAS,SuiteSparse etc... Is there any reference for them? Or just you searched in github for their source codes to build or is there anything special , if there is could you explain which steps and order did you follow ? I am a bit newbie for this task and when I made a search about it actually there wasn't anything clear for me. Thanks :)

tugbakara avatar Nov 22 '22 15:11 tugbakara