Alexander Alekhin edited this page Jun 16, 2016 · 2 revisions
Clone this wiki locally

CARMA build, test and run instruction.

1. Install build suites

  • Install gcc-4.5-arm-linux-gnueabi, g++-4.5-arm-linux-gnueabi, cmake, make, python
  • Download Thrust library (it isn’t included in CUDA 4.2 for CARMA). Copy thrust directory with header files to /include
git clone git://
cp -r thrust/thrust <path to cuda toolkit>/include/thrust

2. Getting OpenCV sources and testdata:

git clone
git clone

3. Build OpenCV for CARMA

1. create <opencv_build> directory and go to there

-DCMAKE_TOOLCHAIN_FILE=<opencv_source>/platforms/linux/arm-gnueabi.toolchain.cmake <opencv_source>

3. make

Note: Form the listing above, OpenCV GPU will be compiled only for Fermi sm_21. To adjust target architectures, you need to modify CUDA_ARCH_BIN and CUDA_ARCH_PTX CMake variables, which control what to embed in output file as GPU binary and as PTX intermediate code.

For those who are familiar with NVCC command line interface

  • -DCUDA_ARCH_BIN=“2.1(2.0)” is expanded to –gencode arch=compute_20,code=sm_21
  • -DCUDA_ARCH_BIN=“3.0” is expanded to –gencode arch=compute_30,code=sm_30
  • -DCUDA_ARCH_PTX=“3.0” is expanded to –gencode arch=compute_30,code=compute_30

You can specify several compute capabilities, but setting single architecture reduces output binary size and compilation time.

  • -DCUDA_ARCH_BIN=“2.1(2.0) 3.0 3.5”
  • -DCUDA_ARCH_PTX=“1.2 1.3”

4. Deploy OpenCV and test suite to CARMA

  • Copy applications from opencv/build/bin directory.
  • Copy libraries from opencv/build/lib directory.
  • Copy directory opencv_extra/testdata to CARMA.

5. Run tests on CARMA and generating report

  • Specify test data path by setting:
export OPENCV_TEST_DATA_PATH=<path to testdata folder>
  • Execute accuracy tests. It will run on all CUDA devices installed
  • Execute performance tests on specified device.
./opencv_perf_gpu --gtest_output=xml:perf_report.xml  [--perf_cuda_device=N]
  • Generate human readable report file
copy perf_report.xml from CARMA to desktop.
python opencv/modules/ts/misc/ perf_report.xml -o html >report.html
  • It’s possible to pass arbitrary number of another report files from another test runs on another hardware to compare all them in one summary final report.
python opencv/modules/ts/misc/ fil1.xml fil2.xml fil3.xml -o html >report.html
  • To run measure performance of CPU counterparts from OpenCV run the same performance framework in the following way:
./opencv_perf_gpu --gtest_output=xml:cpu_perf_report.xml --perf_run_cpu
./opencv_perf_gpu --gtest_output=xml:perf_report.xml --gtest_filter=*GoodFeaturesToTrack*