Re: Tegra on Angstrom Embedded Linux

230 views
Skip to first unread message

Shervin Emami

unread,
Jun 4, 2012, 10:57:49 PM6/4/12
to android...@googlegroups.com
Yes the Tegra 2 has a Cortex-A9 with VFPv3-D16 (a very fast hardware floating-point unit) but it does not have NEON (an even faster integer & float SIMD unit), So if you enable VFP then it should be much faster at floating-point calculations than Cortex-A8 based devices (eg: iPhone4 or BeagleBoard-xM). These are things that mostly effect your C/C++ compiler, so make sure you use the correct VFP settings for your compiler (eg: for GCC it is "-mfpu=vfpv3-16" and perhaps more, like Tom said).

The Tegra optimizations are not enabled by default even on Android, and are mostly NEON optimizations (plus some Tegra GPU and Tegra multi-core optimizations), so you probably won't gain much by using it compared to Tegra 3 devices that do have NEON.

-Shervin.

On Monday, June 4, 2012 4:52:14 PM UTC-7, tomwhipple wrote:
Hi,

I can't answer to defaults, but a key flag for Tegra2 is "-mfpu=vfpv3-d16", since Tegra2 has only 16 vector floating point registers. (As opposed to the more typical 32). http://wiki.debian.org/ArmHardFloatPort/VfpComparison has lots of detailed info.

I know you're not building for Android, but as an example, if you look at the android.toolchain.cmake, the "armeabi-v7a" target runs on Tegra2.

Hope that helps!

-tom


On Sunday, June 3, 2012 8:38:16 AM UTC-7, Nicu Stiurca wrote:
Hi,

I recently posted a question on the main OpenCV Yahoo Users Group. Someone replied saying I might have better luck with my question here. I'm not sure this is the right place for it, but it's worth a try so I am pasting my original question below.

I am wondering about Tegra support for non-Android embedded applications. I am developing some CV applications on a Tegra 2 board running Angstrom Linux. (Angstrom is a fairly popular embedded Linux distribution.) I noticed in the OpenCV 2.4.0beta changelog that apparently the OpenCV Tegra team has achieved significant performance optimizations. Does anybody know if these optimizations are enabled by default in the 2.4 tag of the OpenCV repository? Are they Android specific, or can I take advantage of them simply by cross-compiling the source for my platform? Do I have to enable any special flags?

Nicu Stiurca

unread,
Jun 5, 2012, 8:24:44 AM6/5/12
to android...@googlegroups.com
Hmm the changelog link I posted earlier seems broken now. Oh well. Shervin, are you saying that the optimizations that were achieved in 2.4.0 were mainly for Tegra 3--not Tegra 2--on account of NEON availability? I suppose it doesn't matter much since I plan to upgrade to Tegra 3 later this year, but it would be good to know.

Tom, thanks for verifying that "-mfpu=vfpv3-d16" should do the trick (for the most part at least). I imagine I also need "-mfloatabi=softfp" or "...hard". (I'm not sure if I can have my whole system use hard FP since I rely on some precompiled binaries.) I will look at android.toolchain.cmake as well.

Andrey Pavlenko

unread,
Jun 5, 2012, 8:41:43 AM6/5/12
to android...@googlegroups.com
Tegra optimizations of OpenCV are not included to the open source library version.
Instead they will be distributed by NVidia as a part of Tegra dev tools (I guess TADP or so), wait for announcement...
Significant part of these optimizations use NEON.

Tom Whipple

unread,
Jun 5, 2012, 10:52:18 AM6/5/12
to android...@googlegroups.com
You are correct about "-mfloatabi=softfp". Those two settings seemed to be sufficient to get our project running. Additional work was required so we could ship two versions of our library and make runtime decisions about which to load (NEON vs non-NEON). The Tegra2 seems to perform well enough for our purpose, but there are obviously many devices out there that need NEON to run fast enough to be useful.

-tom

-------------------------
Tom Whipple




Reply all
Reply to author
Forward
0 new messages