Status of context object returns -12

Background: Supposed to be getting SoC hardware which supports OpenVX. In the meantime I’m trying to familiarize myself with the OpenVX framework.

Setup:  Centos 7 server
             No hardware graphic support
             Installed MIVisionX implementation of OpenVX
             g++ compiler

Status:  Can compile/build code with openvx headers and libraries. 

Issue: The sample code I’m using dies when it checks the status of the context object. It’s returning a -12 but I don’t know what that means. Might there be a lookup table to help troubleshoot what’s going on here?


vx_context context = vxCreateContext(); 

#define ERROR_CHECK_OBJECT( obj ) { \
        vx_status status_ = vxGetStatus((vx_reference)(obj)); \
        if(status_ != VX_SUCCESS) { \
            printf("ERROR: failed with status = (%d) at " __FILE__ "#%d\n", status_, __LINE__); \
            exit(1); \
        } \

Maybe what I’m doing makes no sense?
Thanks in advance for the help!

Can you try the sample code from OpenVX with MIVisionX and see if you can run them. If the sample code is working, please share your sample.

After compiling and building I get the same thing when running it:

ERROR: failed with status = (-12) at ../src/canny.cpp#48

and it’s at the same spot where it checks the status of the context obj:

    vx_context context = vxCreateContext();

So I thought I was getting somewhere when I found this:

I installed it and it passed all the conformance tests.

I found and ran an example binary it created

failed to create context!

Looks like I still have the same issue.

Any other ideas? Maybe it’s this MIVisionX implementation that is hosed. Are there other implementations that might work better?

@Thadiusdog I tried to replicate your issue with MIVisionX, but I do not have the failure.

Below is the steps I did

  1. Clone samples
git clone
  1. Export MIVisionX path
export OPENVX_DIR=/opt/rocm/mivisionx/
  1. Make and build canny sample
mkdir canny-build && cd canny-build
cmake -DOPENVX_INCLUDES=$OPENVX_DIR/include -DOPENVX_LIBRARIES=$OPENVX_DIR/lib/ ../openvx-samples/canny-edge-detector/
  1. Run sample
./cannyEdgeDetector --image ../openvx-samples/images/face.png


./cannyEdgeDetector --image ../openvx-samples/images/face.png 
OK: OpenVX using GPU device#0 (gfx906+sram-ecc) [OpenCL 2.0 ] [SvmCaps 0 0]
OK: OpenCL buffer usage: 1754704, 4/4

So tried the example you have here but continue to get the same result. I wonder if -12 is an error code for trying to connect to the hardware itself and set something up but it can’t.

[root@ams2 openvx-samples]# ./cannyEdgeDetector --image ../openvx-samples/images/face.png
ERROR: failed with status = (-12) at /opt/openvx-samples/canny-edge-detector/src/canny.cpp#48
[root@ams2 openvx-samples]# echo $OPENVX_DIR

The system, Dell R200 Poweredge, I’m using doesn’t have a GPU and the CPU, best I can tell doesn’t support OpenVX. What I was hoping to do is use OpenVX to do some development to familiarize myself with the API.
I read somewhere that this is supported. But after a week of trying to figure this out I’m wondering if it’s not.

If it’s not too much to ask, what hardware are you using?

@Thadiusdog I am using an AMD RYZEN CPU and a Radeon VII GPU. If you are having trouble with MIVisionX as your base OpenVX, you can use OpenVX Sample Implementation which is supported on most hardware.

You follow the build instructions and link this library to the samples.

Build OpenVX 1.3 on Ubuntu 18.04

  • Git Clone project with recursive flag to get submodules
git clone --recursive
  • Use script
cd OpenVX-sample-impl/
python --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 --build .
LD_LIBRARY_PATH=./lib ./bin/vx_test_conformance

Thanks for continuing to work with me on this!

I had installed OPENVINO on a different system Intel 8th Gen i7-8700 with a Radon Graphics card. I couldn’t get that working so decided to install MIVISIONX

What I found was that it did not compile and build properly. It complained about not being able to find clEnqueueWaitSignalAMD_fn as it was not defined. I figured out it should be in cl_ext.h. I found the correct file and replaced it then everything compiled and built correctly.
I then ran the sample it produced:

runvx /opt/rocm/mivisionx/samples/gdf/canny.gdf

This ran so I figured I was good. But upon compiling and building the canny.cpp I got a different error code this time:
ERROR: failed with status = (-1) at ./source/vxtest.cpp#83

Since I was getting nowhere with that I figured I’d install the.


Ran Conformance Tests:

    OpenVX Conformance report summary

    To be conformant to the OpenVX baseline, 5563 required test(s) must pass. 5563 tests passed, 0 tests failed. PASSED.
    To be conformant to the Neural Network extension, 1180 required test(s) must pass. 1180 tests passed, 0 tests failed. PASSED.
    To be conformant to the Vision conformance profile, 7107 required test(s) must pass. 7107 tests passed, 0 tests failed. PASSED.
    To be conformant to the Neural Networks conformance profile, 1180 required test(s) must pass. 1180 tests passed, 0 tests failed. PASSED.
    To be conformant to the enhanced vision conformance profile, 2419 required test(s) must pass. 2419 tests passed, 0 tests failed. PASSED.  ```

Unfortunately,  after I compiled and built the canny app I was back to getting the -1 error.  I don't understand what the conformance tests are for?  If the apps you build still don't work properly.

Last attempt:
So I took this old laptop HP Elitebook 8440p and did the following
 Updated CMake 
 Installed OpenVX-sample-impl.git
 Ran conformance tests  ( all passed )
 Installed OpenCV
 Installed openvx-samples.git
 Built the canny app
 Ran it with no errors!

The only possible solution is that there were conflicts in all the software being installed which messed it up.   I'll keep this post updated if I find out anything else.

That’s good. Let me know how it goes.