elucideye / acf

Aggregated Channel Feature object detection in C++ and OpenGL ES 2.0 based on https://github.com/pdollar/toolbox
BSD 3-Clause "New" or "Revised" License
49 stars 20 forks source link

Ubuntu 18.04 w/ linux-gcc-armhf-neon #108

Closed headupinclouds closed 5 years ago

headupinclouds commented 5 years ago

Migrated from (2) https://github.com/elucideye/acf/issues/102#issuecomment-487247357

  1. As mentioned in the previous discussion, I also have tried to build with toolchain linux-gcc-armhf-neon on X86 Ubuntu 18.04. ; Case 1: enable GPGPU, there was an build error as mentioned previous; Case 2: disable GPGPU wirh '--fwd ACF_BUILD_OGLES_GPGPU=OFF', there is a fresh build error as follows:
===========
[ 3%] Building CXX object src/lib/CMakeFiles/acf.dir/acf/acf/transfer.cpp.o
cd /home/bourne/workbase/app_tools/acf/_builds/linux-gcc-armhf-neon/src/lib && /usr/bin/arm-linux-gnueabihf-g++ -DACF_DO_HALF=1 -DACF_SERIALIZE_WITH_CVMATIO=1 -DHALF_ENABLE_CPP11_CMATH=1 -I/home/bourne/workbase/app_tools/acf/_builds/linux-gcc-armhf-neon -I/home/bourne/workbase/app_tools/acf/src/lib/acf -isystem /home/bourne/.hunter/_Base/6421d63/d018056/8948932/Install/include/opencv4 -isystem /home/bourne/.hunter/_Base/6421d63/d018056/8948932/Install/include -isystem /home/bourne/.hunter/_Base/6421d63/d018056/8948932/Install/include/cvmatio -mfpu=neon -mfloat-abi=hard -std=c++11 -std=c++11 -o CMakeFiles/acf.dir/acf/acf/transfer.cpp.o -c /home/bourne/workbase/app_tools/acf/src/lib/acf/acf/transfer.cpp
In file included from /home/bourne/workbase/app_tools/acf/src/lib/acf/acf/transfer.cpp:11:0:
/home/bourne/workbase/app_tools/acf/src/lib/acf/acf/transfer.h:15:10: fatal error: ogles_gpgpu/common/proc/base/procinterface.h: No such file or directory
#include <ogles_gpgpu/common/proc/base/procinterface.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
=============
BourneYin commented 5 years ago

Should Hunter integrate OpenGL/OpenGL ES? In this way, this makes it easy to cross-compile opengl for arm...

headupinclouds commented 5 years ago

Maybe this is helpful:

https://stackoverflow.com/questions/35561459/compiling-opengl-es-2-0-for-arm-mali-on-ubuntu

If you do get something running please share any notes related to setup.

Should Hunter integrate OpenGL/OpenGL ES?

For most platforms it is a system library, and source isn't available. Which implementation did you have in mind?

This OpenGL ES 2.0 acceleration is fairly low level, and was the lowest common denominator for the platforms I was targeting at the time. Shader only GPGPU processing (and 8 bit precision) can be limiting, and something like Halide or TVM will be more flexible and will support a wider array of platforms. Apple has also mentioned plans to drop support for OpenGL in favor of Metal. With a good ARM GPU, I think lightweight Yolo and SSD detectors might be preferable, although maybe the inherent speed of ACF + gradient boosting is still useful in some contexts for fast region proposal.

BourneYin commented 5 years ago

Maybe this is helpful:

https://stackoverflow.com/questions/35561459/compiling-opengl-es-2-0-for-arm-mali-on-ubuntu

If you do get something running please share any notes related to setup.

Should Hunter integrate OpenGL/OpenGL ES?

For most platforms it is a system library, and source isn't available. Which implementation did you have in mind?

This OpenGL ES 2.0 acceleration is fairly low level, and was the lowest common denominator for the platforms I was targeting at the time. Shader only GPGPU processing (and 8 bit precision) can be limiting, and something like Halide or TVM will be more flexible and will support a wider array of platforms. Apple has also mentioned plans to drop support for OpenGL in favor of Metal. With a good ARM GPU, I think lightweight Yolo and SSD detectors might be preferable, although maybe the inherent speed of ACF + gradient boosting is still useful in some contexts for fast region proposal.

'For most platforms it is a system library, and source isn't available. Which implementation did you have in mind?' => Yes, mesa (opengl/es) driver is an open source implementation. It may be an option.

A year ago, I tried halide acceleration for opencv, but I didn't go deep into it. Maybe I'll continue my research in the future. Your advice is very timely and comprehensive. I'm just a newcomer. But I'm interested in your development, and I'll probably keep up.If I find anything, I'll ask for your advice again.

Thank you!

headupinclouds commented 5 years ago

Okay, no problem.

polly.py --toolchain linux-gcc-armhf-neon --config-all Release --verbose --install --fwd ACF_BUILD_OGLES_GPGPU=OFF ACF_USE_EGL=OFF ACF_OPENGL_ES2=OFF ACF_OPENGL_ES3=OFF --reconfig

This seems to build fine now w/ CPU only. PR #111 fixes the tests in this configuration. I'm going to close the issue.

I think it will work fine if you get the OpenGL ES 2.0 libs installed for your board. Once you install them you will just need to make sure CMake can find them. You can provide hints with CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH. Remember, you will need to do something like what is sketched out in pipeline in order to see a benefit using that configuration.

BourneYin commented 5 years ago

Okay, no problem.

polly.py --toolchain linux-gcc-armhf-neon --config-all Release --verbose --install --fwd ACF_BUILD_OGLES_GPGPU=OFF ACF_USE_EGL=OFF ACF_OPENGL_ES2=OFF ACF_OPENGL_ES3=OFF --reconfig

This seems to build fine now w/ CPU only. PR #111 fixes the tests in this configuration. I'm going to close the issue.

I think it will work fine if you get the OpenGL ES 2.0 libs installed for your board. Once you install them you will just need to make sure CMake can find them. You can provide hints with CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH. Remember, you will need to do something like what is sketched out in pipeline in order to see a benefit using that configuration.

Yes, I have verified it. Great!