0

I have an rPi 400 running Raspbian (Debian GNU/Linux 11.)

If I run clinfo on it, I see 0 platforms.

I have no /etc/vendor/ directory either.

How do I run OpenCL on my rPi400?

Bram
  • 172
  • 10

1 Answers1

1

There is no OpenCL available for the Raspberry Pi 4.

But there is CLVK which translates the CL kernel into a Vulkan kernel.

The Vulkan driver for rPi4 is called v3dv which can be used for this.

You need an up-to-date version of v3dv, so either build it from source, or make sure your distribution uses one that is not too old. At the time of writing: Raspberry Pi OS (Debian 11) has a Vulkan driver that is too old (missing the VK_KHR_storage_buffer_storage_class extension.) But Ubuntu OS 23.04 has one that will work with v3dv.

Once you have built a libOpenCL.so with CLVK, you can launch a CL application like this:

$ LD_PRELOAD=./libOpenCL.so clinfo

Lastly, I must warn that currently, the v3dv Vulkan Driver lacks a lot of extensions. For instance, it cannot do fp16, nor can it do 8bit integer operations. So not all CL kernels will run on it.

Bram
  • 172
  • 10