How to build OpenCL programming environment in yocto

Hi, community.

I will want to try to use OpenCL on SoM.
Please tell me how to add OpenCL module/library etc.
Alternatively, could you provide me a reference image include OpenCL programming environment ?

  • SoM=Verdin iMX8MP Quad 2GB
  • Linux 5.4.154-5.5.0-devel+git.c65f1622951c
  • DISTRO=xwayland
  • IMAGE=tdx-reference-minimal-image (not tdx-reference-multimedia-image)

Best regards,
Takeo.

Hi Takeo-san

ご無沙汰しております。Long time no see. Happy new year. Sorry for the late reply.

Unfortunately, we don’t support OpenCL out of the box through Yocto… You have to check in the available layers if there is any source code, or otherwise add it yourself.

For Torizon, we had some containers that worked with Apalis iMX8 and Colibri iMX8X, but untested in Verdin iMX8M Plus: How to use OpenCL 1.2 in iMX8 on Torizon

Kind regards,
Alvaro.

Hi Alvaro-san

明けましておめでとうございます。
本年もよろしくお願いします。

Thank you for replying me. I understand.

By adding some variable in local.conf, It seems that the OpenCL library enabled.
I decided to use the “multimedia-image” , not “minimum image” in this time.

conf/local.conf

IMAGE_LINGUAS ?= "en_US"
GLIBC_GENERATE_LOCALS ?= "en_US.UTF-8"
IMAGE_INSTALL_append = "imx-gpu-viv"

Best regards,
Takeo.

1 Like

Perfect, many thanks for the information Takeo-san.

How was the performance? I don’t think GPGPU in iMX8 series is very good. NPU and CPU should be better.

Kind regards,
Alvaro.

Hi, alvaro-san.

I don’t think GPGPU in iMX8 series is very good

Got it.
As a result of comparing the processing time of CPU and GPU (OpenCL), CPU was better.
I think it depends on the my program…

Kind regards,
Takeo.

You might as well try Vulkan and see how it goes but we haven’t tested it at all.

Kind regards,
Alvaro.