Khronos OpenVX™ is an open, royalty-free standard for cross platform acceleration of computer vision applications. OpenVX enables 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.
This document outlines the purpose of this sample implementation as well as provide build and execution instructions.
- Purpose
- Conformance & Extension Support
- Building and Executing
- Sample Build Instructions
- Conformance Test Modes
- Included Unit Tests
- Debugging
- Packaging and Installing
- CI/CD
- Bug Reporting
The purpose of this software package is to provide a sample implementation of the OpenVX 1.3.2 Specification that passes the conformance test. It is NOT intended to be a reference implementation. If there are any discrepancies with the OpenVX 1.3.2 specification, they are not intentional and the specification should take precedence. Many of the design decisions made in this sample implementation were motivated out of convenience rather than optimizing for performance. It is expected that vendor's implementations would choose to make different design choices based on their priorities, and the specification was written in such a way as to allow freedom to do so. Beyond the conformance tests, there was very limited testing, as this was not intended to be directly used as production software.
This sample implementation contains additional 'experimental' or 'internally proposed' features which are not included in OpenVX 1.3.2. Since these are not part of OpenVX, these are disabled by default in the build by using preprocessor definitions. These features may potentially be modified or may never be added to the OpenVX spec, and should not be relied on as such. Additional details on these preprocessor definitions can be found in the BUILD_DEFINES document in this same folder.
Future revisions of the OpenVX sample implementation may or may not be released, and Khronos is not actively maintaining a public open source sample implementation project.
The following is a summary of what this sample implementation IS and IS NOT:
IS:
- Passing OpenVX 1.3.2 conformance tests
- Implementing the full core API (context, image, graph, kernel, node, scalar, array, object array, pyramid, remap, distribution, threshold, LUT, matrix, convolution, delay, tensor, meta format)
- Implementing all standard vision and neural network kernels
- Supporting extensions: Import/Export (IX), Neural Networks (NN), User Data Object, NNEF Import Kernel, U1 (binary image), Pipelining, Streaming
IS NOT:
- A reference implementation
- Optimized
- Production ready
- Actively maintained by Khronos publicly
The tables below summarize which OpenVX 1.3.2 conformance feature sets and extensions are implemented in this sample and whether they are exercised by the bundled Conformance Test Suite (cts/). "Conformance status" reflects the CI pipeline (.github/workflows/ci.yml), where each listed suite runs as a required gate against the Debug build.
| Feature set | Build flag / CMake define | Implemented | Representative CTS suites | Conformance status |
|---|---|---|---|---|
| Vision (base) | --conf_vision / OPENVX_CONFORMANCE_VISION |
Yes | ColorConvert.*, Box3x3.*, vxAddSub.*, Scale.*, HarrisCorners.*, MinMaxLoc.*, GaussianPyramid.*, … (full core-vision suite) |
Passing |
| Enhanced Vision | --enh_vision / OPENVX_USE_ENHANCED_VISION |
Yes | TensorOp.*, HogFeatures.*, MatchTemplate.*, LBP.*, BilateralFilter.*, Nonmaxsuppression.*, Houghlinesp.*, ControlFlow.* |
Passing |
| Neural Networks | --conf_nn / OPENVX_CONFORMANCE_NEURAL_NETWORKS |
Yes | TensorNetworks.*, *NN* |
Passing |
| NNEF Import | --conf_nnef / OPENVX_CONFORMANCE_NNEF_IMPORT |
Yes | *NNEF* |
Passing |
| Extension | Build flag / CMake define | Implemented | Representative CTS suites | Conformance status |
|---|---|---|---|---|
Import/Export (vx_khr_ix) |
--ix / OPENVX_USE_IX |
Yes | ExtensionObject.*, Graph/ExportImport*, *IX* |
Passing |
Neural Network (vx_khr_nn) |
--nn / OPENVX_USE_NN |
Yes | *NN*, TensorNetworks.* |
Passing |
| User Data Object | --userdataobj / OPENVX_USE_USER_DATA_OBJECT |
Yes | UserDataObject.* |
Passing |
| Binary image / U1 | --u1 / OPENVX_USE_U1 |
Yes | vxBinOp1u.*, vxuBinOp1u.* |
Passing |
Pipelining (vx_khr_pipelining) |
--pipelining / OPENVX_USE_PIPELINING |
Yes | GraphPipeline.* |
Passing |
Streaming (vx_khr_pipelining) |
--streaming / OPENVX_USE_STREAMING |
Yes | GraphStreaming.* |
Passing |
Note: Pipelining and Streaming are both part of the single
vx_khr_pipeliningextension ("Graph Pipelining, Streaming and Batch Processing"). This extension also defines the event-queue API (vxEnableEvents,vxDisableEvents,vxRegisterEvent,vxWaitEvent,vxSendUserEvent) for asynchronous graph/node/user event notifications — it is not a separate extension. The event queue is implemented insample/framework/vx_event_queue.cand is exercised by theGraphPipeline.*andGraphStreaming.*suites.
The kernels can be executed by different back-end targets. The portable C reference model is always built; the others are optional and selected at build time. When an optional target is enabled it registers its kernels with the framework, and the same conformance suites run against it.
| Target | Build flag / CMake define | Implemented | Conformance status |
|---|---|---|---|
C reference model (c_model) |
(default, always built) | Yes | Passing — validated by the full CI pipeline |
| VENUM — ARM NEON (Raspberry Pi) | --venum / EXPERIMENTAL_USE_VENUM |
Yes | Passing on Raspberry Pi for the Vision & Enhanced Vision suites (see Sample 3) |
| OpenCL | --opencl / EXPERIMENTAL_USE_OPENCL |
Yes (experimental) | Not validated in CI |
Raspberry Pi / VENUM: The VENUM target provides NEON-accelerated implementations of the Vision and Enhanced Vision kernels for ARM (tuned for the Raspberry Pi 3B+). It is made up of ~40 NEON kernels in
kernels/venum/plus their OpenVX target wrappers insample/targets/venum/, covering color conversion, channel ops, filters/morphology, arithmetic/bitwise, geometric transforms (scale/warp/remap), features (FAST9, Harris, HOG, LBP,MatchTemplate), statistics (min/max/loc, mean-stddev, histogram, integral), pyramids/optical flow, and tensor ops. Enabling--venumforces a 32-bit build. It builds and passes the Vision and Enhanced Vision conformance suites on Raspberry Pi hardware.
These options are available as build toggles but have no dedicated conformance suite in the bundled CTS, so they are not validated by the conformance pipeline.
| Option | Build flag / CMake define | Implemented | Conformance status |
|---|---|---|---|
| Tiling (provisional) | --tiling / OPENVX_USE_TILING |
Yes | Not covered by CTS |
| Extended S16 (provisional) | --s16 / OPENVX_USE_S16 |
Yes | Not covered by CTS |
| OpenCL Interop | --opencl_interop / OPENVX_USE_OPENCL_INTEROP |
Yes | Not covered by CTS |
| XML import/export | OPENVX_USE_XML |
Yes | Not covered by CTS |
| FLOAT16 support | --f16 / EXPERIMENTAL_PLATFORM_SUPPORTS_16_FLOAT |
Yes | Not covered by CTS |
Note: Neural Networks and NNEF Import conformance rely on test data shipped in
cts/test_data/. Every conformance suite listed in the tables above runs as a required (non-continue-on-error) job in the current CI, so a failure indicates a real regression rather than an expected/unsupported case.
The sample implementation contains two different build system options: cmake and concerto (non-standard makefile-based system). The build and execution instructions for each are shown below.
- Linux
- macOS (Darwin)
- Android
- Windows (Visual Studio or Cygwin)
- Python 3 (tested with Python 3.8+)
- CMake 3.10 or higher (should be in PATH)
- GCC 4.3+ or Clang (Linux/macOS)
- Git submodules initialized (
git submodule update --init --recursive)
- Xcode Command Line Tools (
xcode-select --install). Apple Clang is used as the default compiler. - Use
--os=LinuxwithBuild.py(macOS shares the same CMake code path as Linux). - Libraries are built as
.dylibinstead of.so. - Use
DYLD_LIBRARY_PATHinstead ofLD_LIBRARY_PATHwhen running executables.
- Visual Studio 2013 or higher to create VS solution and use the VS compiler to build OpenVX and related projects (need DEVENV in PATH). Or Cygwin.
- NDK toolchain. Set
ANDROID_NDK_TOOLCHAIN_ROOTenvironment variable.
- Set
VX_OPENCL_INCLUDE_PATHandVX_OPENCL_LIB_PATHenvironment variables.
- libxml2 development package (e.g.
libxml2-devon Ubuntu).
Note: By default the sample implementation enables only the base Vision conformance feature set (
OPENVX_CONFORMANCE_VISION=ON); every other feature set (Enhanced Vision, Neural Networks, NNEF Import) and extension (IX, NN, U1, Pipelining, Streaming, User Data Object, etc.) is off unless you enable it explicitly, either with the correspondingBuild.pyflag or-DOPENVX_*=ONon the CMake line. This mirrors the Conformance Test Suite defaults.
Windows -- from VS / Cygwin command prompt:
python3 Build.py --helpIn case of Visual Studio solution, the default CMAKE_GENERATOR is Visual Studio 12. You can change it with the --gen option (cmake --help presents the supported generators).
Linux -- from shell:
python3 Build.py --helpThe command above will present the available build options; please follow these options.
VS solution will be created in:
${OUTPUT_PATH}/build/${OS}/${ARCH}/OpenVX.sln
In order to build and install all the sample projects from VS, build the INSTALL project (Build.py triggers it by default).
Makefiles will be created in:
${OUTPUT_PATH}/build/${OS}/${ARCH}/${CONF}
In order to build and install all the sample projects, call make install (Build.py triggers it by default).
| Variable | Description |
|---|---|
OUTPUT_PATH |
The path to output (default: root directory) |
OS |
Win / Linux / Android (Cygwin is equal to Linux) |
ARCH |
x32 / x64 |
CONF |
Release / Debug |
Enable / Disable experimental options (optional):
Windows:
- Run the python script with
--build=false - Open CMake GUI
- Set the source code directory to the openvx root folder, where the root
CMakeLists.txtis located - Set the build directory to
${OUTPUT_PATH}/build/${OS}/${ARCH}
- Set the source code directory to the openvx root folder, where the root
- Select the options to enable / disable
- Click the
Configurebutton to updateCMakeCache.txt(do not clickGenerate) - Re-run the python script (you can set
--build=trueor build from Visual Studio)
Linux:
- Run the python script with
--build=false - Navigate to
${OUTPUT_PATH}/build/${OS}/${ARCH}/${CONF} - Run
make edit_cache - Select the options to enable / disable
- Press
cto configure - Press
gto generate the makefiles - Run
make install
The build process installs the OpenVX headers in include/, executables and libraries in bin/, and libs in lib/ under:
${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}
Windows:
Add ${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin to PATH.
Linux:
export LD_LIBRARY_PATH=${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin
cd raw
${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin/vx_testmacOS:
export DYLD_LIBRARY_PATH=${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin
cd raw
${OUTPUT_PATH}/install/${OS}/${ARCH}/${CONF}/bin/vx_testThe Build.py script wraps CMake and provides command-line options for configuring the build. Run python3 Build.py --help for full usage.
| Option | Description | Default |
|---|---|---|
--os |
Operating system (Linux / Windows / Android) |
(required) |
--arch |
Architecture (32 / 64) |
64 |
--conf |
Configuration (Release / Debug) |
Release |
--c |
C compiler path | system default |
--cpp |
C++ compiler path | system default |
--gen |
CMake generator | Visual Studio 12 (Windows), CMake default (Linux) |
--env |
Print supported environment variables | False |
--out |
Output path for build/install files | root directory |
--build |
Build and install targets | True |
--rebuild |
Clean rebuild (use when adding source files) | False |
--package |
Build packages | False |
--dump_commands |
Export compile commands for tooling (YCM, etc.) | False |
| Option | CMake Define | Description |
|---|---|---|
--conf_vision |
OPENVX_CONFORMANCE_VISION=ON |
Vision conformance feature set |
--conf_nn |
OPENVX_CONFORMANCE_NEURAL_NETWORKS=ON |
Neural Networks conformance feature set |
--conf_nnef |
OPENVX_CONFORMANCE_NNEF_IMPORT=ON |
NNEF Import conformance feature set |
--enh_vision |
OPENVX_USE_ENHANCED_VISION=ON |
Enhanced Vision feature set |
| Option | CMake Define | Description |
|---|---|---|
--ix |
OPENVX_USE_IX=ON |
Import/Export extension |
--nn |
OPENVX_USE_NN=ON |
Neural Network extension |
--pipelining |
OPENVX_USE_PIPELINING=ON |
Pipelining extension |
--streaming |
OPENVX_USE_STREAMING=ON |
Streaming extension |
--userdataobj |
OPENVX_USE_USER_DATA_OBJECT=ON |
User Data Object extension |
--opencl_interop |
OPENVX_USE_OPENCL_INTEROP=ON |
OpenCL Interop extension |
--u1 |
OPENVX_USE_U1=ON |
Binary (1-bit) image support |
| Option | CMake Define | Description |
|---|---|---|
--tiling |
OPENVX_USE_TILING=ON |
Tiling extension |
--s16 |
OPENVX_USE_S16=ON |
Extended S16 support |
| Option | CMake Define | Description |
|---|---|---|
--f16 |
EXPERIMENTAL_PLATFORM_SUPPORTS_16_FLOAT=ON |
VX_TYPE_FLOAT16 support |
--venum |
EXPERIMENTAL_USE_VENUM=ON |
Raspberry Pi 3B+ NEON target (forces 32-bit) |
--opencl |
EXPERIMENTAL_USE_OPENCL=ON |
OpenCL target (forces 32-bit) |
Note: Using
--venum,--tiling, or--openclautomatically sets the architecture to 32-bit.
The following systems are supported by the concerto build:
- Linux (GCC or CLANG)
- Darwin/Mac OSX
- Windows NT (Cygwin or native Visual Studio 2013)
For each system, consider the following prerequisites:
GCC is the default compiler. If Clang is desired, it can be chosen by setting the HOST_COMPILER environment variable to CLANG.
If using GCC, version 4.3.0 or above should be used.
Mac OSX users need to use either MacPorts or Fink (or other favorite package manager) to install the same set of packages above.
Cygwin:
It is recommended that Windows users install Cygwin to build OpenVX. Obtain and run the setup utility at http://cygwin.com/setup.exe.
In addition to the defaults, you MUST manually select the gcc-core, make, and gcc-g++ packages in the Cygwin setup utility. All are in the "Devel" category. GCC version 4.3.0 or above should be used.
Native MS Visual Studio 2013:
Required packages to build:
- Microsoft Visual Studio 2013 (at least)
- A make utility compiled for Windows (examples):
mingw32-make.exe(http://www.mingw.org)gmakefrom XDCTools (http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/)
For building the code, adding the path to make.exe to the PATH is required after the vcvarsall.bat batch file (which configures the environment for compiling with VC) is executed from a CMD window.
Once the correct packages above are installed, the sample implementation can be built by typing make in the OpenVX installation directory (e.g., openvx_sample):
cd openvx_sample
makeOutputs are placed in:
out/$(TARGET_OS)/$(TARGET_CPU)/$(TARGET_BUILD)/
These variables are visible in the make output. This will be referred to as TARGET_OUT, though this may not be present in the actual environment (users could define this themselves).
In order to see a list and description of all make commands for concerto, type:
make helpThe tests can be manually run as follows. In any environment, PATHs may need to be altered to allow loading dynamic modules. The $(TARGET_OUT) variable below should be replaced with the actual path to the output file where the libraries and executables are placed.
TARGET_OUT is usually out/LINUX/x86_64/release
cd raw
LD_LIBRARY_PATH=../$(TARGET_OUT) ../$(TARGET_OUT)/vx_testTARGET_OUT is usually out/CYGWIN/X86/release
cd raw
LD_LIBRARY_PATH=../$(TARGET_OUT) ../$(TARGET_OUT)/vx_testTARGET_OUT is usually out\Windows_NT\x86\release
C:\> copy raw\*.* %TARGET_OUT%
C:\> pushd %TARGET_OUT% && vx_test.exeTARGET_OUT is usually out/DARWIN/x86_64/release
cd raw
DYLD_LIBRARY_PATH=../$(TARGET_OUT) ../$(TARGET_OUT)/vx_test- Install prerequisites
sudo apt-get update
sudo apt-get install -y cmake git python3 gcc g++- Git clone project with recursive flag to get submodules
git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git- Use
Build.pyscript
cd OpenVX-sample-impl/
python3 Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --conf_nn- Build and run conformance
export OPENVX_DIR=$(pwd)/install/Linux/x64/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=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformance- Ensure Xcode Command Line Tools are installed
xcode-select --install- Git clone project with recursive flag to get submodules
git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git- Use
Build.pyscript (use--os=Linuxfor macOS)
cd OpenVX-sample-impl/
python3 Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --conf_nn- Build and run conformance
export OPENVX_DIR=$(pwd)/install/Linux/x64/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.dylib;$OPENVX_DIR/bin/libvxu.dylib;pthread;dl;m" -DOPENVX_CONFORMANCE_VISION=ON -DOPENVX_USE_ENHANCED_VISION=ON -DOPENVX_CONFORMANCE_NEURAL_NETWORKS=ON ../cts/
cmake --build .
DYLD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformanceNote: On macOS, libraries use the
.dylibextension instead of.so, andDYLD_LIBRARY_PATHis used instead ofLD_LIBRARY_PATH.
- Git clone project with recursive flag to get submodules
git clone --recursive https://github.com/KhronosGroup/OpenVX-sample-impl.git- Use
Build.pyscript
cd OpenVX-sample-impl/
python3 Build.py --os=Linux --venum --conf=Debug --conf_vision --enh_vision --conf_nn- Build and run 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=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformanceThe sample implementation supports several conformance test configurations. The per-feature modes below are provided for local, reproducible runs; the CI pipeline itself uses a single all-features build fanned out into filtered slices (see CI/CD). For all modes, first set up the environment:
export OPENVX_DIR=$(pwd)/install/Linux/x64/Debug
export VX_TEST_DATA_PATH=$(pwd)/cts/test_data/Note: As of the pinned
ctssubmodule, the CTS enables only the base Vision feature set by default; every other conformance feature set (Enhanced Vision, Neural Networks, NNEF Import) and extension (IX, NN, U1, Pipelining, Streaming, User Data Object) is opt-in and must be turned on explicitly with the corresponding-DOPENVX_*=ONflag on the CTScmakeline, as shown in each mode below.
Note: The current
ctssubmodule stores its test data (cts/test_data/) as regular git files, so Git LFS is not required — a recursive clone/submodule checkout fetches the real images directly.
Note: When switching between modes, remove the previous install directory before rebuilding:
rm -rf install/Linux/x64/Debug
Note: On macOS, use
.dylibinstead of.sofor library paths inOPENVX_LIBRARIES, replaceLD_LIBRARY_PATHwithDYLD_LIBRARY_PATH, and omitrtfrom the library list (e.g.,"...libopenvx.dylib;...libvxu.dylib;pthread;dl;m").
python3 Build.py --os=Linux --arch=64 --conf=Debug --conf_vision
mkdir build-cts-mode-1 && cd build-cts-mode-1
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 ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformancepython3 Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision
mkdir build-cts-mode-2 && cd build-cts-mode-2
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 ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformancepython3 Build.py --os=Linux --arch=64 --conf=Debug --conf_nn
mkdir build-cts-mode-3 && cd build-cts-mode-3
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so\;$OPENVX_DIR/bin/libvxu.so\;pthread\;dl\;m\;rt -DOPENVX_CONFORMANCE_NEURAL_NETWORKS=ON ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformancepython3 Build.py --os=Linux --arch=64 --conf=Debug --conf_nnef
mkdir build-cts-mode-4 && cd build-cts-mode-4
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so\;$OPENVX_DIR/bin/libvxu.so\;$OPENVX_DIR/bin/libnnef-lib.a\;pthread\;dl\;m\;rt\;stdc++ -DCMAKE_C_FLAGS="-I$(pwd)/../kernels/NNEF-Tools/parser/cpp/include" -DOPENVX_CONFORMANCE_NNEF_IMPORT=ON ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformance '--filter=*NNEF*'Note: The NNEF static library
libnnef-lib.ais installed underbin/(notlib/) because the sample-impl install directories are set tobin. The CTS link line must also addstdc++and the NNEF parser include path (kernels/NNEF-Tools/parser/cpp/include), as shown above and in the CI workflow. If the sample-impl build fails with'numeric_limits' is not a member of 'std'on a modern GCC, add--cpp_flags="-include limits"to theBuild.pycommand.
python3 Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --conf_nn --nn --ix --u1
mkdir build-cts-mode-5 && cd build-cts-mode-5
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 -DOPENVX_USE_NN=ON -DOPENVX_USE_IX=ON -DOPENVX_USE_U1=ON ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformancepython3 Build.py --os=Linux --arch=64 --conf=Debug --userdataobj
mkdir build-cts-mode-6 && cd build-cts-mode-6
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/bin/libopenvx.so\;$OPENVX_DIR/bin/libvxu.so\;pthread\;dl\;m\;rt -DOPENVX_USE_USER_DATA_OBJECT=ON ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformance '--filter=UserDataObject.*'Note: The
Build.pyflag for this extension is--userdataobj(it maps to-DOPENVX_USE_USER_DATA_OBJECT=ON). The matching-DOPENVX_USE_USER_DATA_OBJECT=ONflag must also be passed on the CTScmakeline so theUserDataObject.*tests are compiled.
python3 Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --pipelining
mkdir build-cts-mode-7 && cd build-cts-mode-7
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_USE_PIPELINING=ON ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformance '--filter=GraphPipeline.*'python3 Build.py --os=Linux --arch=64 --conf=Debug --conf_vision --enh_vision --pipelining --streaming
mkdir build-cts-mode-8 && cd build-cts-mode-8
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_USE_PIPELINING=ON -DOPENVX_USE_STREAMING=ON ../cts/
cmake --build .
LD_LIBRARY_PATH=$OPENVX_DIR/bin:./lib ./bin/vx_test_conformance '--filter=GraphStreaming.*'The sample implementation comes with a few unit sanity tests that exercise some examples of the specification. The executables are called:
vx_test
- Main function is in source file:
sample/tests/vx_test.c - No arguments will run all included unit tests
- Argument will list the tests to be run
- Single tests can be run by specifying test number using
-t <testnum> - Expects to be run from the
raw/directory (the program looks for image files in the execution directory)
vx_query
- Main function is in source file:
tools/query/vx_query.c - Queries the implementation and prints out details about all kernels
vx_example
- Main function is in source file:
examples/vx_graph_factory.c - This is an example of creating and running a graph using what is called a graph factory. This example is beyond the scope of the OpenVX specification, but is an example of how graph parameters can be used to abstract the details of a graph to clients.
vx_bug13510, vx_bug13517, vx_bug13518
- Exercise code exposing fixed bugs
To build in debug mode (this will output in the out/.../debug folder rather than out/.../release; if you defined TARGET_OUT, you'll have to change it):
export NO_OPTIMIZE=1
makeor
make TARGET_BUILD=debugTo enable traces (printfs/logs/etc), use either the mask (higher priority) or list of zones to enable. In the mask, the zones are the bit places. Express the mask as a hex number:
export VX_ZONE_MASK=0x<hexnumber>or use the list as a comma delimited set of zone numbers (see debug/vx_debug.h):
export VX_ZONE_LIST=0,1,2,3,6,9,14The list of mapping zones to bits can be found in debug/vx_debug.h.
If you want these variables as part of the command line:
unset VX_ZONE_MASK
unset VX_ZONE_LIST
make
cd raw
VX_ZONE_LIST=0,3,16 vx_test <options>Note:
VX_ZONE_MASKwill overrideVX_ZONE_LIST. If you have both set, onlyVX_ZONE_MASKis being seen by the implementation.
On Linux, the sample implementation for OpenVX is packaged after a make in:
out/LINUX/x86_64/openvx-*.deb
Installing DEB package:
dpkg-deb -i <path>/openvx-*.debContinuous integration runs on GitHub Actions (.github/workflows/ci.yml) using an Ubuntu 22.04 environment. It runs on every pull request and on pushes to all branches, and is organized as a two-stage, build-once/fan-out pipeline rather than one rebuild per feature mode:
Stage 1 — Build (both jobs gate Stage 2):
- Install prerequisites:
cmake,make,git,python3,gcc,g++ build— compiles the sample implementation once in Debug with the full feature set enabled (OPENVX_FEATURES: Vision, Enhanced Vision, Neural Networks, NNEF Import, NN, IX, U1, User Data Object, Pipelining, Streaming), then builds the CTS against it and uploads a single self-contained artifact (build-cts/+install/+cts/test_data/).build-release— a parallel Release build of the sample implementation that acts as a build gate.
Stage 2 — Conformance test slices:
Many granular jobs (each needs: [build, build-release]) download the Stage 1 artifact and run one --filter slice of the suite; no job rebuilds. Slices are grouped by area, for example:
- Framework: baseline/smoke, graph, user kernels
- Data objects and User Data Object
- Import/Export (IX)
- Pipelining (split into
fastandstressslices because the tests run against the slower unoptimized Debug C-model) and Streaming - Neural Networks and NNEF import
- Vision and Enhanced Vision functional groups (color/channel, filters, arithmetic, geometric, features, statistics, image ops, pyramid, tensor ops, control flow, etc.)
Git submodules are fetched recursively. Pipelining and Streaming are implemented on ToT and their jobs (GraphPipeline.* / GraphStreaming.*) are expected to pass.
Note: A single all-features build serves every test slice, which is cheaper than rebuilding per feature; the trade-off is that features are exercised together rather than in isolation. The manually reproducible per-feature "Conformance Test Modes" below are provided for local runs and do not correspond one-to-one to CI jobs.
Although Khronos is not actively maintaining a public project of this sample implementation, bug reports can be reported back to the working group in an effort to make sure that we don't overlook related specification and implementation issues going forward.
If any bugs are found in the sample implementation, you can notify the Khronos working group via:
- File an issue on the GitHub
- The OpenVX feedback forum: https://community.khronos.org/c/openvx
