ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

ros indigo rviz performance displaying pointclouds 2x faster when compiled from_source

asked 2014-08-13 01:44:07 -0500

kluessi gravatar image

updated 2014-08-13 08:17:18 -0500

Hi there,

as we started migrating our code to indigo yesterday we had performance issues, especially when working with pointclouds. The code compiled with catkin_make runs just with 1Hz, whereas using rosbuild we achieve 30Hz. We found out, related to the following topic:

http://answers.ros.org/question/71965...

that we need to enable compiler optimization by setting catkin_make -DCMAKE_BUILD_TYPE=Release and the code runs at the expected framerate of 30Hz.

Now to the topic:

Displaying just a pointcloud from the asus xtion in rviz installed from the repository gives us a performance of 14Hz on our desktop.

  • Intel i7-3770 3.4 GHz quad-core
  • Nvidia GeForce GTX660
  • 16GB ram
  • Ubuntu 14.04 - 64bit
  • ros-indigo

Knowing the above (catkin compiled code runs 3x slower) we build rviz from source with the following compiler options:

  • set(CMAKE_BUILD_TYPE RelWithDebInfo)
  • set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -Wall -msse2 -msse3 -mssse3 -msse4 -msse4.2")

This gives us a performance of 30Hz displaying a pointcloud, resulting in a much smoother usage of rviz.

Evaluating the same on a laptop:

  • Intel i7-4600M, 2.1Ghz dual core
  • Intel HD Graphics 4600
  • 8 GB RAM
  • Ubuntu 14.04 - 64bit
  • ros indigo

rviz from repository: 4Hz vs. rviz from source 9Hz

EDIT I prepared a table containing all build tests I have done:

image description

This leads to the question: Are the ros-indigo packages really compiled with compiler optimizations turned on e.g. as Release?

Have a nice day!

edit retag flag offensive close merge delete

Comments

Out of curiosity, did u try to set PLATFORM_CXX_FLAGS to "${CMAKE_CXX_FLAGS} -std=gnu++0x -Wall -march=native"? According to this should add the apropriate -msseN for your platform

jorge gravatar image jorge  ( 2014-08-13 07:15:44 -0500 )edit

I tried your suggestion. For results please look in my post above. Not much difference. Still faster than the repository, but as fast as without SSE optimizations turned on.

kluessi gravatar image kluessi  ( 2014-08-13 08:18:31 -0500 )edit

Make sense. Thanks!

jorge gravatar image jorge  ( 2014-08-13 10:57:47 -0500 )edit
William gravatar image William  ( 2014-08-13 11:15:48 -0500 )edit
William gravatar image William  ( 2014-08-13 12:02:58 -0500 )edit

Thanks for the links William. Seem to be related.

kluessi gravatar image kluessi  ( 2014-08-14 02:49:33 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2014-08-13 02:13:45 -0500

ahendrix gravatar image

Yes; the released packages are compiled with optimizations turned on, but they're compiled for the "standard" x86 or x86_64 machine, which doesn't include the higher SSE optimizations (at least 3, 4 and 4.1, if my memory is correct).

The builds done on the build farm do this on purpose because they have to be compatible with all of the possible computers that are supported by Ubuntu. Obviously, if you're willing to use a newer instruction set that isn't portable, you can get faster performance.

I suspect you'll see similar performance to the released packages if you compile in release mode with the default optimization flags.

edit flag offensive delete link more

Comments

I compiled rviz again using BUILD_TYPE Release and RelWithDebInfo, both without SSE optimizations.

I still get the performance of 30Hz on the desktop and 14Hz.

I will prepare a table containing all builds tested and edit my post above in a second.

kluessi gravatar image kluessi  ( 2014-08-13 02:59:09 -0500 )edit

cmake tends to cache environment variables between runs; did you clean your workspace and rebuild when switching flags?

ahendrix gravatar image ahendrix  ( 2014-08-13 12:47:37 -0500 )edit

I performed the tests again, this time deleting the build and devel folder from the workspace. Same results as above.

kluessi gravatar image kluessi  ( 2014-08-14 02:41:58 -0500 )edit
Martin Günther gravatar image Martin Günther  ( 2014-10-07 11:26:46 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2014-08-13 01:44:07 -0500

Seen: 1,175 times

Last updated: Aug 13 '14