I want to share my opencv test results with everyone. I bought a pcduino8 uno that has 8 cores. I wanted opencv to easily utilize several cores. I downloaded the opencv src code to the pcduino8 and compiled it with the OpenMP compiler flag. Opencv is setup to use parallel processing but the OpenMP flag must be set on.
After several hours of compiling, I ran the code that billbo911 gave us several years ago. The results were amazing. I can watch the CPU monitor with’ top’ to see several cores crunching on pixels. My frame rate almost doubled.
I suggest anyone using C code on a pcduino to try the new 8 core device.
Here are my notes from the test:
- There is no onboard flash for the PCDuino8 so the uSD card must stay in the carrier at all times.
- OpenCV 2.4.8 is installed with apt-get but I downloaded 2.4.11 src.
- Download the 2.4.11 src to any folder. I placed it in ~/Downloads/opencv-2.4.11.
- install cmake: sudo apt-get install cmake cmake-gui
- cd ~/Downloads/opencv-2.4.11/cmake and type cmake-gui.
- Enter the opencv path at the top. /home/tim/Downloads/opencv-2.4.11/.
- Enter the build path on the second line. /home/tim/Downloads/opencv-2.4.11/build
- Press configure. You will see that the build directory is created at this step.
- Go into the configure tree and make sure the WITH_OPENMP checkbox is on and make sure the WITH_TBB checkbox is off. Make sure the WITH_OPENCL is off.
- Press Generate and wait until it finishes.
- cd ~/Downloads/ opencv-2.4.11/build and type << sudo make install
- The ‘make install’ takes about 3 hours.
- Run your opencv code while gnome-system-monitor is running and watch multiple CPUs reach 100%.
- Make sure you use the new opencv libraries by setting the LD_LIBRARY_PATH to the new directory. I placed the following in my ~/.bashrc
Export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
You can write a small openmp c file to prove that the openmp is working.