ActiveIntelligentSystemsLab / sgm_gpu_ros

GPU implementation of SGM for ROS
GNU General Public License v3.0
24 stars 6 forks source link

Slow performance on Jetson Xavier NX #8

Open lio94 opened 1 year ago

lio94 commented 1 year ago

I am trying to get this node running on Jetson Xavier NX / ROS Noetic. I changed line -gencode=arch=compute_72,code=sm_72 in CMakeLists.txt to match to the Xavier architecture.

However, I face extremely slow performance, as I get a disparity image out only every 2-3 minutes.

fujimo-t commented 1 year ago

I don't have Jetson Xavier NX so I can't inspect myself.

What do you use as input image node and how is it specification (such as resolution, frame rate, etc.)?

lio94 commented 10 months ago

I don't have Jetson Xavier NX so I can't inspect myself.

What do you use as input image node and how is it specification (such as resolution, frame rate, etc.)?

Hi,

I tested with a KITTI rosbag, which has mono8 images with resolution of 1242x375 @ 10 Hz.

I have same performance issues also on my PC with RTX 3050 (-gencode=arch=compute_86,code=sm_86).

If I run the sgm library alone outside ROS, it gives 60 FPS. But with this ROS node, only a less than 1 Hz.

I tried to disable consistencycheck and non-GPU operations, but still trying to find out what is causing the overhead.

fujimo-t commented 10 months ago

Thank you for the details.

I need more information to resolve:

  1. How many Hz do you run test.launch described on README.md? I recorded about 75 Hz (same to input) on my environment, ROS Noetic and RTX 3060.
  2. Can you tell me how to create your KITTI rosbag? I want to same rosbag to reproduce.
lio94 commented 10 months ago

With your test bag and launchfile I get about 66 Hz output, while input image is 76 Hz. ROS Noetic here also.

You should be able generate the same bag I use with the commands below:

git clone https://github.com/tomas789/kitti2bag.git
pip install kitti2bag
wget https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0106/2011_09_26_drive_0106_sync.zip
unzip 2011_09_26_drive_0106_sync.zip
wget https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_calib.zip
unzip 2011_09_26_calib.zip
kitti2bag -t 2011_09_26 -r 0106 raw_synced .

Attached is the corresponding launch file with correct topic name kitti.launch.txt

fujimo-t commented 9 months ago

Thank you more information.

This node is implemented by TimeSynchronizer and it requires exactly same timestamp between left and right image. Left and right timestamps are not completely synchronized in the KITTI bag so most of input images aren't processed by the node.

In such case, you need to change the synchronizer to use ApproximateTime Policy.