Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Questions about building an OpenCL kernel as an OpenVX node

RSun9
New Contributor I
805 Views

Hello again,

I have implemented an OpenVX node with a simple OpenCL kernel. It works. Now I want to print out the OpenCL version used in my code, and I am having problems.

First, I tried to pass the string  "--version" as part of the compiler options into vxAddDeviceLibraryIntel(). I didn't see any compiler errors, but my code exited with the following error messages:

[ INFO ] OpenCL build options: -DWORK_ITEM_XSIZE=1 -DWORK_ITEM_YSIZE=1 --version
OpenCL kernel name: com.bdti.opencl.mask
OpenCL kernel ID: 5242881
oclKernel = 0x1176690
ERROR: cannot verify graph (vx_status=-1)
ERROR: cannot release graph (vx_status=-1)
ERROR: cannot release context (vx_status=-1)

Then, I removed the change to the compiler options, and added the following line into my OpenCL script (I didn't like this approach, as a printf obviously would slow down my code significantly. It was just a test):

    printf("opencl version: %s\n", __OPENCL_VERSION__);


Now I got this output:

[ INFO ] OpenCL build options: -DWORK_ITEM_XSIZE=1 -DWORK_ITEM_YSIZE=1
OpenCL kernel name: com.bdti.opencl.mask
OpenCL kernel ID: 5242881
oclKernel = 0x17c1c50
35 errors generated.
ERROR: cannot verify graph (vx_status=-1)
ERROR: cannot release graph (vx_status=-1)
ERROR: cannot release context (vx_status=-1)


So, here are my questions:

1. Why didn't my first approach work ?

2. For my second approach, where do I look for the 35 errors generated presumably by the OpenCL compiler?

3. What's the recommended way to display the OpenCL version in CV SDK?

Thanks,

-Robby

0 Kudos
4 Replies
Stav_S_Intel
Employee
805 Views

Hey Robby, 

Sorry for the delay in response. 

The right way to go about this is querying the OpenCL RT and not the OpenVX RT. 

The best way for querying OpenCL RT version is using clGetPlatformInfo API in the host code (can be found in OpenCL spec).

for example, clGetPlatformInfo(platform, CL_PLATFORM_VERSION, param_value_size, platform_ver, &returned_size);

This should return a string with the following structure OpenCL<space><majorVersion.minorVersion><space><platformSpecificInformation>

 

Regards,

Stav

 

0 Kudos
RSun9
New Contributor I
805 Views

Hi Stav, thanks for the response.

Yes I know how to get the OpenCL version by using the clGetPlatformInfo API. However, if I understand correctly, that API requires the OpenCL SDK, which I have not installed. I was trying to verify the OpenCL compiler used to build my CL kernel into an OpenVX node, and was hoping to get that info without installing the OpenCL SDK.

-Robby

 

0 Kudos
Maxim_S_Intel
Employee
805 Views

Hi, you can set the env andf the RT wuill start to output the OpenCL kernel compilation erroro:

$ export VX_ZONE_LIST=18

$export IAP_TRACE_LEVEL=0

0 Kudos
Lam__Chee_Cheong
Beginner
805 Views

Hi,

Encountered the below warning and error message after successfully linking darknet with OpenCL. However, when running, it failed as per below about 'different data layout'. Can you pls advise me on what steps I can check further? Thks and appreciate

maxpool_layer_kernels.cl build log:
fcl build 1 succeeded.
bcl build succeeded.
 
warning: Linking two modules of different data layouts: '' is 'e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024' whereas '<origin>' is 'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32:64'
warning: Linking two modules of different target triples: ' is 'spir64' whereas '<origin>' is 'vISA_64'
opencl execution error, code -11 -11
0 Kudos
Reply