How To enable OpenCL (202302 Release)

Is there a way to enable OpenCL in VisionFive 2 Debian 202302 Release?
After installing some packages provided, no valid devices are found when I run the clinfo command.

$ sudo apt install clinfo
$ clinfo
Number of platforms                               0

Also, the return value of OpenCL’s GetPlatformIDs API was -1.

supplement
The purpose of enabling OpenCL is to check the OpenCL Delegate of TensorFlow Lite.
VisionFive 2 Debian Image (December) had OpenCL working.
Please reply if there are any necessary steps.

Do you have the IMG.icd file in /etc/OpenCL/vendors ?

The content should be

libPVROCL.so

Then you should have a file of that name in /usr/lib/risc64-linux-gnu/

If any are missing, you will not get the OpenCL acceleration from the GPU.

It seems that StarFive have done somethign wrong with the GPU driver in the last image, things seems to run worse than the previous one…

Thanks for reply.

Do you have the IMG.icd file in /etc/OpenCL/vendors ?

The IMG.icd file exists and is as follows:

$ ls /etc/OpenCL/vendors/IMG.icd
/etc/OpenCL/vendors/IMG.icd
$ cat /etc/OpenCL/vendors/IMG.icd
libPVROCL.so

Then you should have a file of that name in /usr/lib/risc64-linux-gnu/

libPVROCL.so

There are libPVROCL.so and libOpenCL.so.

~$ ls -al /usr/lib/riscv64-linux-gnu/libOpenCL.so*
lrwxrwxrwx 1 root root    14 Feb 27 19:39 /usr/lib/riscv64-linux-gnu/libOpenCL.so -> libPVROCL.so.1
lrwxrwxrwx 1 root root    18 Oct  5 12:56 /usr/lib/riscv64-linux-gnu/libOpenCL.so.1 -> libOpenCL.so.1.0.0
-rw-r--r-- 1 root root 44720 Oct  5 12:56 /usr/lib/riscv64-linux-gnu/libOpenCL.so.1.0.0
$ ls -al /usr/lib/riscv64-linux-gnu/libPVROCL.so*
lrwxrwxrwx 1 root root     25 Feb 27 19:39 /usr/lib/riscv64-linux-gnu/libPVROCL.so -> libPVROCL.so.1.17.6210866
lrwxrwxrwx 1 root root     25 Feb 27 19:39 /usr/lib/riscv64-linux-gnu/libPVROCL.so.1 -> libPVROCL.so.1.17.6210866
-rw-r--r-- 1 root root 414200 Feb 27 19:39 /usr/lib/riscv64-linux-gnu/libPVROCL.so.1.17.6210866

Weird.

If you install lddtree:
sudo apt install pax-utils

then run it on libPVROCL.so:

lddtree /usr/lib/riscv64-linux-gnu/libPVROCL.so

There is no broken dependency right?
Is there is any traces in the kernel log from PVR_K? (you may want to run a dmesg -c prior to run clinfo just to make sure you only see related kernel logs)

I was going to suggest a quick** workaround (if you were in a rush), depending on the workload, to enable use of the CPU’s (or HART’s as they are called in the RISC-V world - HARdware Thread’s). And later when you get the GPU working it will add to the available processing.

$ sudo apt install libpocl2 libpocl2-common pocl-opencl-icd
$ clinfo

** But it turns out that those Debian packages are not yet available for RISC-V (The POCL project is currently looking for RISC-V CPU maintainers), so you would need to build from source code and that might have other requirements which you may also have to build from source code. So my suggestion on how to speed things up, might rapidly turn into a total nightmare of a time sink.

But if you want to try and compile, and optimise, from source, I’d probably start here:
http://portablecl.org/
https://github.com/pocl/pocl
https://github.com/pocl/pocl/blob/master/doc/sphinx/source/install.rst

Off-topic, after installing opencl successfully, you might want to test this tool which makes use of opencl and opencv.
It’s in the fedora 37 riscv repos.

dnf install waifu2x-converter-cpp

After installing it, I did another clinfo:


clinfo 
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 22.2.2
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No devices found in platform [Clover?]
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

Temporarily mounting image-69’s / from the sdcard…

[root@fc38-rv64-vf2-YOW mnt]# mount /dev/mmcblk1p3 /mnt/mysdcardroot/
[root@fc38-rv64-vf2-YOW mnt]# cd /mnt/mysdcardroot/

I found the above recommended files to look for:

[root@fc38-rv64-vf2-YOW mysdcardroot]# find . -name "*OCL*" |xargs ls -lht
lrwxrwxrwx 1 root root   25 Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libPVROCL.so -> libPVROCL.so.1.17.6210866
lrwxrwxrwx 1 root root   25 Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libPVROCL.so.1 -> libPVROCL.so.1.17.6210866
-rw-r--r-- 1 root root 405K Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libPVROCL.so.1.17.6210866

[root@fc38-rv64-vf2-YOW mysdcardroot]# find . -name "*OpenCL*" |xargs ls -lht
lrwxrwxrwx 1 root root   14 Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libOpenCL.so -> libPVROCL.so.1
lrwxrwxrwx 1 root root   18 Sep 30  2021 ./usr/lib/riscv64-linux-gnu/libOpenCL.so.1 -> libOpenCL.so.1.0.0
-rw-r--r-- 1 root root  44K Sep 30  2021 ./usr/lib/riscv64-linux-gnu/libOpenCL.so.1.0.0
-rw-r--r-- 1 root root  23K Sep 30  2021 ./usr/share/doc/ocl-icd-libopencl1/html/libOpenCL.html
-rw-r--r-- 1 root root 2.4K Sep 30  2021 ./usr/share/man/man7/libOpenCL.7.gz
lrwxrwxrwx 1 root root   14 Sep 30  2021 ./usr/share/man/man7/libOpenCL.so.7.gz -> libOpenCL.7.gz

[root@fc38-rv64-vf2-YOW mysdcardroot]# cat etc/OpenCL/vendors/IMG.icd
libPVROCL.so

Ok let’s lddtree those:


[root@fc38-rv64-vf2-YOW mysdcardroot]# lddtree ./usr/lib/riscv64-linux-gnu/libPVROCL.so.1.17.6210866
libPVROCL.so.1.17.6210866 => ./usr/lib/riscv64-linux-gnu/libPVROCL.so.1.17.6210866 (interpreter => none)
    libsrv_um.so => not found
    libusc.so => not found
    libpthread.so.0 => /lib64/libpthread.so.0
    libdl.so.2 => /lib64/libdl.so.2
    libstdc++.so.6 => /lib64/libstdc++.so.6
    libm.so.6 => /lib64/libm.so.6
    libgcc_s.so.1 => /lib64/libgcc_s.so.1
    libc.so.6 => /lib64/libc.so.6
    ld-linux-riscv64-lp64d.so.1 => /lib/ld-linux-riscv64-lp64d.so.1
[root@fc38-rv64-vf2-YOW mysdcardroot]# lddtree ./usr/lib/riscv64-linux-gnu/libOpenCL.so.1.0.0
libOpenCL.so.1.0.0 => ./usr/lib/riscv64-linux-gnu/libOpenCL.so.1.0.0 (interpreter => none)
    libdl.so.2 => /lib64/libdl.so.2
    libc.so.6 => /lib64/libc.so.6
    ld-linux-riscv64-lp64d.so.1 => /lib/ld-linux-riscv64-lp64d.so.1

The above libsrv_um.so => not found and libusc.so => not found I have identified as powervr binaries which others call pvr_binaries. I’ll try and find those as well on the sdcard.

[root@fc38-rv64-vf2-YOW mysdcardroot]# find . -name "libsrv_um.so*" -print |xargs ls -lht
lrwxrwxrwx 1 root root   25 Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libsrv_um.so -> libsrv_um.so.1.17.6210866
-rw-r--r-- 1 root root 367K Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libsrv_um.so.1.17.6210866

[root@fc38-rv64-vf2-YOW mysdcardroot]# find . -name "libusc.so*" -print |xargs ls -lht
lrwxrwxrwx 1 root root   22 Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libusc.so -> libusc.so.1.17.6210866
-rw-r--r-- 1 root root 1.6M Dec 19 08:25 ./usr/lib/riscv64-linux-gnu/libusc.so.1.17.6210866

I’m trying hard. LOL
This is fedora 38’s ldconfig cache for a few related graphics library locations.

[root@fc38-rv64-vf2-YOW ~]# ldconfig --print-cache
	libGLX.so.0 (libc6,double-float) => /lib64/lp64d/libGLX.so.0
	libGLU.so.1 (libc6,double-float) => /lib64/lp64d/libGLU.so.1
	libGLESv2.so.2 (libc6,double-float) => /lib64/lp64d/libGLESv2.so.2
	libGLESv1_CM.so.1 (libc6,double-float) => /lib64/lp64d/libGLESv1_CM.so.1
	libGL.so.1 (libc6,double-float) => /lib64/lp64d/libGL.so.1
	libEGL_mesa.so.0 (libc6,double-float) => /lib64/lp64d/libEGL_mesa.so.0
	libEGL.so.1 (libc6,double-float) => /lib64/lp64d/libEGL.so.1

Since /usr/lib/riscv64-linux-gnu/ doesn’t exist on fedora 38, I figured I should give placing these opencl .so’s in /lib64/lp64d/.


rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libPVROCL.so /lib64/lp64d/libPVROCL.so
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libPVROCL.so.1 /lib64/lp64d/libPVROCL.so.1
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libPVROCL.so.1.17.6210866 /lib64/lp64d/libPVROCL.so.1.17.6210866
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libOpenCL.so /lib64/lp64d/libOpenCL.so
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libOpenCL.so.1 /lib64/lp64d/libOpenCL.so.1
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libOpenCL.so.1.0.0 /lib64/lp64d/libOpenCL.so.1.0.0
rsync --archive /mnt/mysdcardroot/etc/OpenCL/vendors/IMG.icd /etc/OpenCL/vendors/IMG.icd
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libsrv_um.so /lib64/lp64d/libsrv_um.so
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libsrv_um.so.1.17.6210866 /lib64/lp64d/libsrv_um.so.1.17.6210866
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libusc.so /lib64/lp64d/libusc.so
rsync --archive /mnt/mysdcardroot/usr/lib/riscv64-linux-gnu/libusc.so.1.17.6210866 /lib64/lp64d/libusc.so.1.17.6210866


[root@fc38-rv64-vf2-YOW ~]# lddtree /lib64/lp64d/libPVROCL.so.1.17.6210866
libPVROCL.so.1.17.6210866 => /lib64/lp64d/libPVROCL.so.1.17.6210866 (interpreter => none)
    libsrv_um.so => /lib64/libsrv_um.so
        librt.so.1 => /lib64/librt.so.1
        libdrm.so.2 => /lib64/libdrm.so.2
    libusc.so => /lib64/libusc.so
    libpthread.so.0 => /lib64/libpthread.so.0
    libdl.so.2 => /lib64/libdl.so.2
    libstdc++.so.6 => /lib64/libstdc++.so.6
    libm.so.6 => /lib64/libm.so.6
    libgcc_s.so.1 => /lib64/libgcc_s.so.1
    libc.so.6 => /lib64/libc.so.6
    ld-linux-riscv64-lp64d.so.1 => /lib/ld-linux-riscv64-lp64d.so.1

But still no luck no devices found:

[root@fc38-rv64-vf2-YOW ~]# clinfo
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 22.2.2
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No devices found in platform [Clover?]
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.14
  ICD loader Profile                              OpenCL 3.0

Still trying. I’m realizing the vf2 gpu stuff isn’t in this fedora 38 rootfs at all.

wget https://github.com/starfive-tech/soft_3rdpart/blob/JH7110_VisionFive2_devel/IMG_GPU/out/img-gpu-powervr-bin-1.17.6210866.tar.gz?raw=true -O img-gpu-powervr-bin-1.17.6210866.tar.gz
tar zxvf img-gpu-powervr-bin-1.17.6210866.tar.gz

Now we need to place all this stuff in their respective correct locations.

cat /etc/ld.so.conf.d/img-gpu-powervr-bin.conf 
/home/davidm/img-gpu-powervr-bin-1.17.6210866/staging/usr/lib
/home/davidm/img-gpu-powervr-bin-1.17.6210866/target/usr/lib

Then integrate into the linker paths:


[root@fc38-rv64-vf2-YOW ~]# ldconfig -v
/home/davidm/img-gpu-powervr-bin-1.17.6210866/staging/usr/lib: (from /etc/ld.so.conf.d/img-gpu-powervr-bin.conf:1)
	libVK_IMG.so.1 -> libVK_IMG.so.1.17.6210866
	libPVROCL.so.1 -> libPVROCL.so.1.17.6210866
	libpvr_dri_support.so -> libpvr_dri_support.so.1.17.6210866
	libsrv_um.so -> libsrv_um.so.1.17.6210866
	libGLESv1_CM_PVR_MESA.so -> libGLESv1_CM_PVR_MESA.so.1.17.6210866
	libusc.so -> libusc.so.1.17.6210866
	libglslcompiler.so -> libglslcompiler.so.1.17.6210866
	libGLESv2_PVR_MESA.so -> libGLESv2_PVR_MESA.so.1.17.6210866
	libufwriter.so -> libufwriter.so.1.17.6210866
	libvulkan.so.1 -> libvulkan.so.1.17.6210866
	libsutu_display.so -> libsutu_display.so.1.17.6210866
	libPVRScopeServices.so -> libPVRScopeServices.so.1.17.6210866
/home/davidm/img-gpu-powervr-bin-1.17.6210866/target/usr/lib: (from /etc/ld.so.conf.d/img-gpu-powervr-bin.conf:2)
	libVK_IMG.so.1 -> libVK_IMG.so.1.17.6210866
	libPVROCL.so.1 -> libPVROCL.so.1.17.6210866
	libpvr_dri_support.so -> libpvr_dri_support.so.1.17.6210866
	libsrv_um.so -> libsrv_um.so.1.17.6210866
	libGLESv1_CM_PVR_MESA.so -> libGLESv1_CM_PVR_MESA.so.1.17.6210866
	libusc.so -> libusc.so.1.17.6210866
	libglslcompiler.so -> libglslcompiler.so.1.17.6210866
	libGLESv2_PVR_MESA.so -> libGLESv2_PVR_MESA.so.1.17.6210866
	libufwriter.so -> libufwriter.so.1.17.6210866
	libvulkan.so.1 -> libvulkan.so.1.17.6210866
	libsutu_display.so -> libsutu_display.so.1.17.6210866
	libPVRScopeServices.so -> libPVRScopeServices.so.1.17.6210866

After a shutdown and power on, clinfo still doesn’t see any devices.

YES, I FORGOT. Somebody in another thread mentioned opencl doesn’t get enabled when there is nothing connected to the HDMI port and there was no desktop started. I’ll try plugging the board into a 1080p monitor now and running clinfo after that.

2 Likes

It was caused by running as a non-root user.
I got the proper output by running with sudo clinfo.

$ sudo clinfo
sudo: unable to resolve host starfive: Name or service not known
[sudo] password for user:
Number of platforms                               1
  Platform Name                                   PowerVR
  Platform Vendor                                 Imagination Technologies
  Platform Version                                OpenCL 3.0
  Platform Profile                                EMBEDDED_PROFILE
  Platform Extensions                             cl_khr_icd cl_khr_fp16 cl_img_spirv cles_khr_int64 cl_img_yuv_image cl_khr_device_uuid cl_khr_depth_images cl_khr_mipmap_image cl_khr_priority_hints cl_img_generate_mipmap cl_khr_3d_image_writes cl_img_cached_allocations cl_khr_mipmap_image_writes cl_khr_create_command_queue cl_khr_suggested_local_work_size cl_img_mem_properties cl_img_mem_properties_relax_alloc_requirements cl_khr_extended_versioning cl_khr_image2d_from_buffer cl_khr_byte_addressable_store cl_khr_local_int32_base_atomics cl_khr_global_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_global_int32_extended_atomics cl_khr_spir cl_khr_il_program cl_khr_egl_image cl_arm_import_memory cl_arm_import_memory_dma_buf cl_img_protected_content cl_img_semaphore cl_img_external_semaphore cl_img_external_semaphore_sync_fd cl_khr_semaphore cl_khr_external_semaphore cl_khr_external_semaphore_sync_fd
  Platform Extensions with Version                cl_khr_icd                                                       0x400000 (1.0.0)
                                                  cl_khr_fp16                                                      0x400000 (1.0.0)
                                                  cl_img_spirv                                                     0x400000 (1.0.0)
                                                  cles_khr_int64                                                   0x400000 (1.0.0)
                                                  cl_img_yuv_image                                                 0x400000 (1.0.0)
                                                  cl_khr_device_uuid                                               0x400000 (1.0.0)
                                                  cl_khr_depth_images                                              0x400000 (1.0.0)
                                                  cl_khr_mipmap_image                                              0x400000 (1.0.0)
                                                  cl_khr_priority_hints                                            0x400000 (1.0.0)
                                                  cl_img_generate_mipmap                                           0x400000 (1.0.0)
                                                  cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                  cl_img_cached_allocations                                        0x400000 (1.0.0)
                                                  cl_khr_mipmap_image_writes                                       0x400000 (1.0.0)
                                                  cl_khr_create_command_queue                                      0x400000 (1.0.0)
                                                  cl_khr_suggested_local_work_size                                 0x400000 (1.0.0)
                                                  cl_img_mem_properties                                            0x400000 (1.0.0)
                                                  cl_img_mem_properties_relax_alloc_requirements                   0x400000 (1.0.0)
                                                  cl_khr_extended_versioning                                       0x400000 (1.0.0)
                                                  cl_khr_image2d_from_buffer                                       0x400000 (1.0.0)
                                                  cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                  cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                  cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                  cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                  cl_khr_spir                                                      0x400000 (1.0.0)
                                                  cl_khr_il_program                                                0x400000 (1.0.0)
                                                  cl_khr_egl_image                                                 0x400000 (1.0.0)
                                                  cl_arm_import_memory                                             0x400000 (1.0.0)
                                                  cl_arm_import_memory_dma_buf                                     0x400000 (1.0.0)
                                                  cl_img_protected_content                                         0x400000 (1.0.0)
                                                  cl_img_semaphore                                                 0x400000 (1.0.0)
                                                  cl_img_external_semaphore                                        0x400000 (1.0.0)
                                                  cl_img_external_semaphore_sync_fd                                0x400000 (1.0.0)
                                                  cl_khr_semaphore                                                 0x400000 (1.0.0)
                                                  cl_khr_external_semaphore                                        0x400000 (1.0.0)
                                                  cl_khr_external_semaphore_sync_fd                                0x400000 (1.0.0)
  Platform Numeric Version                        0xc00000 (3.0.0)
  Platform Extensions function suffix             IMG
  Platform Host timer resolution                  0ns

  Platform Name                                   PowerVR
Number of devices                                 1
  Device Name                                     PowerVR B-Series BXE-4-32
  Device Vendor                                   Imagination Technologies
  Device Vendor ID                                0x1010
  Device Version                                  OpenCL 3.0
  Device UUID                                     33362035-3020-3534-2031-383200000000
  Driver UUID                                     36323130-3836-3600-0000-000000000000
  Valid Device LUID                               No
  Device LUID                                     0000-000000000000
  Device Node Mask                                0
  Device Numeric Version                          0xc00000 (3.0.0)
  Driver Version                                  1.17@6210866
  Device OpenCL C Version                         OpenCL C 1.2
  Device OpenCL C all versions                    OpenCL C                                                         0x400000 (1.0.0)
                                                  OpenCL C                                                         0x401000 (1.1.0)
                                                  OpenCL C                                                         0x402000 (1.2.0)
                                                  OpenCL C                                                         0xc00000 (3.0.0)
  Device OpenCL C features                        __opencl_c_int64                                                 0x400000 (1.0.0)
                                                  __opencl_c_pipes                                                 0xc00000 (3.0.0)
                                                  __opencl_c_images                                                0x400000 (1.0.0)
                                                  __opencl_c_subgroups                                             0xc00000 (3.0.0)
                                                  __opencl_c_3d_image_writes                                       0x400000 (1.0.0)
                                                  __opencl_c_read_write_images                                     0x400000 (1.0.0)
                                                  __opencl_c_generic_address_space                                 0xc00000 (3.0.0)
                                                  __opencl_c_program_scope_global_variables                        0xc00000 (3.0.0)
                                                  __opencl_c_work_group_collective_functions                       0xc00000 (3.0.0)
  Latest comfornace test passed                   v2021-10-04-00
  Device Type                                     GPU
  Device Profile                                  EMBEDDED_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               1
  Max clock frequency                             594MHz
  Device Partition                                (core)
    Max number of sub-devices                     1
    Supported partition types                     None
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             512x512x512
  Max work group size                             512
  Preferred work group size multiple (device)     32
  Preferred work group size multiple (kernel)     32
  Max sub-groups per work group                   512
  Preferred / native vector sizes
    char                                                16 / 1
    short                                                8 / 1
    int                                                  4 / 1
    long                                                 2 / 1
    half                                                 0 / 0        (cl_khr_fp16)
    float                                                4 / 1
    double                                               0 / 0        (n/a)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    64, Little-Endian
  Global memory size                              4082995200 (3.803GiB)
  Error Correction support                        No
  Max memory allocation                           1020748800 (973.5MiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   No
    Fine-grained system sharing                   No
    Atomics                                       No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Preferred alignment for atomics
    SVM                                           0 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Atomic memory capabilities                      relaxed, work-group scope
  Atomic fence capabilities                       relaxed, acquire/release, work-group scope
  Max size for global variable                    16384 (16KiB)
  Preferred total size of global vars             0
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384 (16KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            16384 pixels
    Max 1D or 2D image array size                 2048 images
    Base address alignment for 2D image buffers   64 bytes
    Pitch alignment for 2D image buffers          64 pixels
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             16384x16384x2048 pixels
    Max number of read image args                 8
    Max number of write image args                64
    Max number of read/write image args           64
  Pipe support                                    Yes
  Max number of pipe args                         16
  Max active pipe reservations                    1
  Max pipe packet size                            1024
  Local memory type                               Local
  Local memory size                               4096 (4KiB)
  Max number of constant args                     256
  Max constant buffer size                        1020748800 (973.5MiB)
  Generic address space support                   Yes
  Max size of kernel argument                     1024
  Queue properties (on host)
    Out-of-order execution                        Yes
    Profiling                                     Yes
  Device enqueue capabilities                     (n/a)
  Queue properties (on device)
    Out-of-order execution                        No
    Profiling                                     No
    Preferred size                                0
    Max size                                      0
  Max queues on device                            0
  Max events on device                            0
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      1000ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    Non-uniform work-groups                       Yes
    Work-group collective functions               Yes
    Sub-group independent forward progress        No
    IL version                                    SPIR-V_1.2
    ILs with version                              SPIR-V                                                           0x402000 (1.2.0)
    SPIR versions                                 1.2
  printf() buffer size                            65536 (64KiB)
  Built-in kernels                                (n/a)
  Built-in kernels with version                   (n/a)
  Device Extensions                               cl_khr_icd cl_khr_fp16 cl_img_spirv cles_khr_int64 cl_img_yuv_image cl_khr_device_uuid cl_khr_depth_images cl_khr_mipmap_image cl_khr_priority_hints cl_img_generate_mipmap cl_khr_3d_image_writes cl_img_cached_allocations cl_khr_mipmap_image_writes cl_khr_create_command_queue cl_khr_suggested_local_work_size cl_img_mem_properties cl_img_mem_properties_relax_alloc_requirements cl_khr_extended_versioning cl_khr_image2d_from_buffer cl_khr_byte_addressable_store cl_khr_local_int32_base_atomics cl_khr_global_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_global_int32_extended_atomics cl_khr_spir cl_khr_il_program cl_khr_egl_image cl_arm_import_memory cl_arm_import_memory_dma_buf cl_img_protected_content cl_img_semaphore cl_img_external_semaphore cl_img_external_semaphore_sync_fd cl_khr_semaphore cl_khr_external_semaphore cl_khr_external_semaphore_sync_fd
  Device Extensions with Version                  cl_khr_icd                                                       0x400000 (1.0.0)
                                                  cl_khr_fp16                                                      0x400000 (1.0.0)
                                                  cl_img_spirv                                                     0x400000 (1.0.0)
                                                  cles_khr_int64                                                   0x400000 (1.0.0)
                                                  cl_img_yuv_image                                                 0x400000 (1.0.0)
                                                  cl_khr_device_uuid                                               0x400000 (1.0.0)
                                                  cl_khr_depth_images                                              0x400000 (1.0.0)
                                                  cl_khr_mipmap_image                                              0x400000 (1.0.0)
                                                  cl_khr_priority_hints                                            0x400000 (1.0.0)
                                                  cl_img_generate_mipmap                                           0x400000 (1.0.0)
                                                  cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                  cl_img_cached_allocations                                        0x400000 (1.0.0)
                                                  cl_khr_mipmap_image_writes                                       0x400000 (1.0.0)
                                                  cl_khr_create_command_queue                                      0x400000 (1.0.0)
                                                  cl_khr_suggested_local_work_size                                 0x400000 (1.0.0)
                                                  cl_img_mem_properties                                            0x400000 (1.0.0)
                                                  cl_img_mem_properties_relax_alloc_requirements                   0x400000 (1.0.0)
                                                  cl_khr_extended_versioning                                       0x400000 (1.0.0)
                                                  cl_khr_image2d_from_buffer                                       0x400000 (1.0.0)
                                                  cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                  cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                  cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                  cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                  cl_khr_spir                                                      0x400000 (1.0.0)
                                                  cl_khr_il_program                                                0x400000 (1.0.0)
                                                  cl_khr_egl_image                                                 0x400000 (1.0.0)
                                                  cl_arm_import_memory                                             0x400000 (1.0.0)
                                                  cl_arm_import_memory_dma_buf                                     0x400000 (1.0.0)
                                                  cl_img_protected_content                                         0x400000 (1.0.0)
                                                  cl_img_semaphore                                                 0x400000 (1.0.0)
                                                  cl_img_external_semaphore                                        0x400000 (1.0.0)
                                                  cl_img_external_semaphore_sync_fd                                0x400000 (1.0.0)
                                                  cl_khr_semaphore                                                 0x400000 (1.0.0)
                                                  cl_khr_external_semaphore                                        0x400000 (1.0.0)
                                                  cl_khr_external_semaphore_sync_fd                                0x400000 (1.0.0)

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  PowerVR
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [IMG]
  clCreateContext(NULL, ...) [default]            Success [IMG]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 PowerVR
    Device Name                                   PowerVR B-Series BXE-4-32
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
    Platform Name                                 PowerVR
    Device Name                                   PowerVR B-Series BXE-4-32
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  Invalid device type for platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 PowerVR
    Device Name                                   PowerVR B-Series BXE-4-32

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

I solved it by adding user to render group.
Thank you very much for your very useful answer.

3 Likes

I noticed your hostname error.

unable to resolve host starfive: Name or service not known

You can make this error disappear with two steps:

1 Like