How can I verify that CUDA is being used for feature extraction (e.g., ORB) in RTAB-Map?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I verify that CUDA is being used for feature extraction (e.g., ORB) in RTAB-Map?

GGYU
Dear mathieu,

Hi,

I'm running RTAB-Map 0.21.9 with OpenCV 4.10.0 (built from source with `WITH_CUDA=ON` and `opencv_contrib` including `xfeatures2d`). I also enabled parameters like `FAST/Gpu`, `ORB/Gpu`, and set `Kp/DetectorStrategy=6` (ORB) through ROS 2 parameters.

When I run RTAB-Map (ROS 2 Humble), it works fine and launches correctly. However, I'm not sure if the GPU is actually being used for feature extraction such as ORB or FAST.

Here are some additional details:

- `rtabmap --version` confirms OpenCV 4.10.0 and that xfeatures2d and nonfree modules are enabled.
- I set `FAST/Gpu` to true in `Parameters.h`, and recompiled RTAB-Map.
- No explicit message in the console/logs confirms if CUDA is being used during runtime.
- I'm running on a Jetson Orin NX with CUDA 12.4 and cuDNN 9.8.
- `cv2.cuda.getCudaEnabledDeviceCount()` returns 1.

My question is:

**Is there a way to confirm from RTAB-Map logs or parameters that CUDA is being used for feature extraction (e.g., ORB/FAST)?**

Should I increase verbosity? Are there debug messages or parameter flags that explicitly confirm CUDA usage during feature extraction?

Thank you so much for your continued support, Mathieu.

Best regards
GGYU
Reply | Threaded
Open this post in threaded view
|

Re: How can I verify that CUDA is being used for feature extraction (e.g., ORB) in RTAB-Map?

GGYU
rtabmap --version
RTAB-Map:               0.21.9
PCL:                    1.12.1
With VTK:                9.1.0
OpenCV:                 4.10.0
With OpenCV xfeatures2d:  true
With OpenCV nonfree:      true
With ORB OcTree:          true
With SuperPoint Torch:   false
With Python3:            false
With FastCV:             false
With OpenGV:             false
With Madgwick:            true
With PDAL:               false
With libLAS:             false
With CudaSift:           false
With TORO:                true
With g2o:                 true
With GTSAM:               true
With Vertigo:             true
With CVSBA:              false
With Ceres:              false
With OpenNI:              true
With OpenNI2:             true
With Freenect:           false
With Freenect2:          false
With K4W2:               false
With K4A:                false
With DC1394:              true
With FlyCapture2:        false
With ZED:                false
With ZED Open Capture:   false
With RealSense:          false
With RealSense SLAM:     false
With RealSense2:          true
With MYNT EYE S:         false
With DepthAI:            false
With XVisio SDK:         false
With libpointmatcher:     true
With CCCoreLib:          false
With Open3D:             false
With OctoMap:             true
With GridMap:             true
With cpu-tsdf:           false
With open chisel:        false
With Alice Vision:       false
With LOAM:               false
With FLOAM:              false
With FOVIS:              false
With Viso2:              false
With DVO:                false
With ORB_SLAM:           false
With OKVIS:              false
With MSCKF_VIO:          false
With VINS-Fusion:        false
With OpenVINS:           false
Reply | Threaded
Open this post in threaded view
|

Re: How can I verify that CUDA is being used for feature extraction (e.g., ORB) in RTAB-Map?

matlabbe
Administrator
There are a couple of indirect ways to know it:

If you set the parameter to true and you don't have cuda, you will get a warning.

You can add --udebug argument to show more logs and see if the gpu version of the feature is used.

Run without gpu option enabled, look at the processing time, then restart with the parameter enabled, then compre with new processing time. If identical, it is probably not running it.