OpenCL example not working

Which Khadas SBC do you use?

VIM3L

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Khadas official images, self built images, or others?

Official
Ubuntu 20.04 Server
Kernel 4.9

Please describe your issue below:

Hi,

I am trying to run the following example: VIM3/3L OpenCL [Khadas Docs]
on my VIM3L. Unfortunately I get the following linker error when trying to compile the example:

Also the other command to install the OpenCL headers fails:

I don’t have the 3L, did look at the docs and it appears you might need to update to the 5.15 kernel.

First try this to see if the file is already on the board and might just need a symbolic link.

$sudo -i
#cd /
/# find -name libSPIRV_viv.so

If the file is installed you will see results similar to this:

root@imx8mp-var-dart:/# find -name libSPIRV_viv.so
./usr/lib/libSPIRV_viv.so

If the file is not found you might have to upgrade, this is all a guess since I do not have the same board as you.

1 Like

Hello @CaptainWhale

Due to the Amlogic NPU packages also allowing access to the NPU’s compute unit as an OpenCL device, there is a conflict when managing both. Since most compiled Cl applications will look for the library in /usr/lib/, it will always select the NPU compute unit.

You will need to follow the documentation to place the correct OpenCL lib in /usr/lib.

Regarding the headerfiles, you might need to move them as well. Can you use the following commands to move them else where and then reinstall the packages ?

$ mkdir ~/CL_old
$ sudo mv /usr/include/CL/*  ~/CL_old
$ sudo apt install opencl-headers opencl-clhpp-headers

Regards.

1 Like