OpenVX API for Raspberry Pi
Raspberry Pi is excited to bring the Khronos OpenVX 1.3 API to our line of single-board computers. Here’s Kiriti Nagesh Gowda, AMD‘s MTS Software Development Engineer, to tell you more.
OpenVX for computer vision
OpenVX™ is an open, royalty-free API standard for cross-platform acceleration of computer vision applications developed by The Khronos Group. The Khronos Group is an open industry consortium of more than 150 leading hardware and software companies creating advanced, royalty-free acceleration standards for 3D graphics, augmented and virtual reality, vision, and machine learning. Khronos standards include Vulkan®, OpenCL™, SYCL™, OpenVX™, NNEF™, and many others.
Now with added Raspberry Pi
The Khronos Group and Raspberry Pi have come together to work on an open-source implementation of OpenVX™ 1.3, which passes the conformance on Raspberry Pi. The open-source implementation passes the Vision, Enhanced Vision, & Neural Net conformance profiles specified in OpenVX 1.3 on Raspberry Pi.
Application developers may always freely use Khronos standards when they are available on the target system. To enable companies to test their products for conformance, Khronos has established an Adopters Program for each standard. This helps to ensure that Khronos standards are consistently implemented by multiple vendors to create a reliable platform for developers. Conformant products also enjoy protection from the Khronos IP Framework, ensuring that Khronos members will not assert their IP essential to the specification against the implementation.
OpenVX enables a performance and power-optimized computer vision processing, especially important in embedded and real-time use cases such as face, body, and gesture tracking, smart video surveillance, advanced driver assistance systems (ADAS), object and scene reconstruction, augmented reality, visual inspection, robotics, and more. The developers can take advantage of using this robust API in their application and know that the application is portable across all the conformant hardware.
Below, we will go over how to build and install the open-source OpenVX 1.3 library on Raspberry Pi 4 Model B. We will run the conformance for the Vision, Enhanced Vision, & Neural Net conformance profiles and create a simple computer vision application to get started with OpenVX on Raspberry Pi.
OpenVX 1.3 implementation for Raspberry Pi
The OpenVX 1.3 implementation is available on GitHub. To build and install the library, follow the instructions below.
Build OpenVX 1.3 on Raspberry Pi
Git clone the project with the recursive flag to get submodules:
git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git
Note: The API Documents and Conformance Test Suite are set as submodules in the sample implementation project.
Use the Build.py script to build and install OpenVX 1.3:
cd OpenVX-sample-impl/ python Build.py --os=Linux --venum --conf=Debug --conf_vision --enh_vision --conf_nn
Build and run the conformance:
export OPENVX_DIR=$(pwd)/install/Linux/x32/Debug export VX_TEST_DATA_PATH=$(pwd)/cts/test_data/ mkdir build-cts cd build-cts cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so\;$OPENVX_DIR/bin/libvxu.so\;pthread\;dl\;m\;rt -DOPENVX_CONFORMANCE_VISION=ON -DOPENVX_USE_ENHANCED_VISION=ON -DOPENVX_CONFORMANCE_NEURAL_NETWORKS=ON ../cts/ cmake --build . LD_LIBRARY_PATH=./lib ./bin/vx_test_conformance
Use the open-source samples on GitHub to test the installation.
I see raspberry 3 and 4 supported. Shouldn’t be supported also 2-1-0 with same VC4?
The OpenVX working group only verified on RPi 3 & 4, if you do have access to the older hardware and are able to run the conformance, please do send us the log and we will add the results to the list of verified hardware.
Another amazing step for RPI. Will it compile ok for 32 and 64bit RPIOS.
The 32 bit flow is verified on RPi, you can compile it for 64 bit with the right options – https://github.com/KhronosGroup/OpenVX-sample-impl/blob/openvx_1.3/Build.py#L67
Presumably this runs on the GPU?
There is an OpenCL implementation for RPi, it needs verified and tested – https://github.com/KhronosGroup/OpenVX-sample-impl/blob/openvx_1.3/Build.py#L95
Not out of the box I believe.
I got an error runing Build.py.
make: *** No rule to make target ‘install’.
On Raspberry pi 4 Any help?
I was unable to reproduce the issue, but feel free to report an issue on our open-source implementation and we can address it. – https://github.com/KhronosGroup/OpenVX-sample-impl/issues
I can reproduce this on Pi 4 running the 64 Bit OS.
cmake is not installed by default ;)
After installing cmake I ran into an issue with options for the gcc. -mfpu=neon is set, but gcc refuse it as a wrong option. On aarch64 systems this option shall be replaced with -03.
It compiles with these changes. Tests are still running ;)
You need cmake
sudo apt-get install cmake
But then the next issue is waiting. On default pi 4 running 64bit userland I am too stupid to find the right neon options
It looks like it’s using NEON, but not the Videocore GPU. Am I wrong?
The open-source implementation has OpenCL implementation for RPi, it is still experimental and needs verification – https://github.com/KhronosGroup/OpenVX-sample-impl/blob/openvx_1.3/Build.py#L95
It seems that it needs a complete vulkan driver to use the GPU. So we have to wait until it is ready.
Seems quite interesting for deep learning with RPI.
Does it directly support TensorFlow/PyTorch or do we need to first convert to NNEF?
It seems RPI is doing good at current situation but i need to address an information about rpi 4 that dispaly was not coming through HDMI Port in some monitors.Is there any solution for this . I had tried some ideas by changing the resolutions and in config.txt files .
I put together a CMake wrapper project that builds the stack and all samples: https://github.com/jwinarske/rpi-vision
Have arrived completed the OpenVX component, looking to get the OpenCV dependant installed, for this instance is there a method you can point to that will assist ? thnx in advance…
Hi folks, have the Conformant OpenVX Implementation established, there appears to be a number of ways to establish OpenCV a dependency for the sample applications. Is there a link to a procedure that is relevant to the Pi and this instance? thnx in advance…
Comments are closed