clinfo icon indicating copy to clipboard operation
clinfo copied to clipboard

Adding support to Android (Qualcomm Adreno)

Open kimocoder opened this issue 2 years ago • 13 comments

To be updated

kimocoder avatar Oct 17 '23 17:10 kimocoder

Would you clarify what specifically is needed?

Oblomov avatar Jun 06 '24 14:06 Oblomov

I do not know I have clinfo on snd8 gen 1 and working

MatejMagat305 avatar Jan 30 '25 10:01 MatejMagat305

it works for me

Number of platforms                               1
  Platform Name                                   QUALCOMM Snapdragon(TM)
  Platform Vendor                                 QUALCOMM
  Platform Version                                OpenCL 3.0 QUALCOMM build: commit unknown
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions with Version                cl_khr_icd                                                       0xc00000 (3.0.0)
  Platform Numeric Version                        0xc00000 (3.0.0)
  Platform Extensions function suffix             QCOM
  Platform Host timer resolution                  0ns

  Platform Name                                   QUALCOMM Snapdragon(TM)
Number of devices                                 1
  Device Name                                     QUALCOMM Adreno(TM) 750
  Device Vendor                                   QUALCOMM
  Device Vendor ID                                0x5143
  Device Version                                  OpenCL 3.0 Adreno(TM) 750
  Device Numeric Version                          0xc00000 (3.0.0)
  Driver Version                                  OpenCL 3.0 QUALCOMM build: commit unknown Compiler E031.45.02.06
  Device OpenCL C Version                         OpenCL C 3.0 Adreno(TM) 750
  Device OpenCL C all versions                    OpenCL C                                                         0xc00000 (3.0.0)
                                                  OpenCL C                                                         0x800000 (2.0.0)
                                                  OpenCL C                                                         0x402000 (1.2.0)
                                                  OpenCL C                                                         0x401000 (1.1.0)
                                                  OpenCL C                                                         0x400000 (1.0.0)
  Device OpenCL C features                        __opencl_c_3d_image_writes                                       0xc00000 (3.0.0)
                                                  __opencl_c_atomic_order_acq_rel                                  0xc00000 (3.0.0)
                                                  __opencl_c_atomic_order_seq_cst                                  0xc00000 (3.0.0)
                                                  __opencl_c_atomic_scope_device                                   0xc00000 (3.0.0)
                                                  __opencl_c_atomic_scope_all_devices                              0xc00000 (3.0.0)
                                                  __opencl_c_device_enqueue                                        0xc00000 (3.0.0)
                                                  __opencl_c_generic_address_space                                 0xc00000 (3.0.0)
                                                  __opencl_c_images                                                0xc00000 (3.0.0)
                                                  __opencl_c_int64                                                 0xc00000 (3.0.0)
                                                  __opencl_c_pipes                                                 0xc00000 (3.0.0)
                                                  __opencl_c_program_scope_global_variables                        0xc00000 (3.0.0)
                                                  __opencl_c_read_write_images                                     0xc00000 (3.0.0)
                                                  __opencl_c_subgroups                                             0xc00000 (3.0.0)
                                                  __opencl_c_work_group_collective_functions                       0xc00000 (3.0.0)
                                                  __opencl_c_integer_dot_product_input_4x8bit                      0xc00000 (3.0.0)
                                                  __opencl_c_integer_dot_product_input_4x8bit_packed               0xc00000 (3.0.0)
  Latest conformance test passed                  v2024-01-09-04
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               6
  Max clock frequency                             1MHz
  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                             1024x1024x1024
  Max work group size                             1024
  Preferred work group size multiple (device)     64
  Preferred work group size multiple (kernel)     8
  Max sub-groups per work group                   16
  Preferred / native vector sizes
    char                                                 1 / 1
    short                                                1 / 1
    int                                                  1 / 1
    long                                                 1 / 0
    half                                                 1 / 1        (cl_khr_fp16)
    float                                                1 / 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                             Yes
    IEEE754-2008 fused multiply-add               No
    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                             Yes
    IEEE754-2008 fused multiply-add               No
    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                              5814714368 (5.415GiB)
  Error Correction support                        No
  Max memory allocation                           1073741824 (1024MiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   Yes
    Fine-grained system sharing                   No
    Atomics                                       Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Page size (QCOM)                                4096 bytes
  External memory padding (QCOM)                  0 bytes
  Preferred alignment for atomics
    SVM                                           128 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Atomic memory capabilities                      relaxed, acquire/release, sequentially-consistent, work-item scope, work-group scope, device scope, all-devices s                                                                          cope
  Atomic fence capabilities                       relaxed, acquire/release, sequentially-consistent, work-item scope, work-group scope, device scope, all-devices s                                                                          cope
  Max size for global variable                    65536 (64KiB)
  Preferred total size of global vars             1048576 (1024KiB)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        1048576 (1024KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            134217728 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                 128
    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                    12288
  Max pipe packet size                            1024
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     8
  Max constant buffer size                        65536 (64KiB)
  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                     supported
  Queue properties (on device)
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                655376 (640KiB)
    Max size                                      655376 (640KiB)
  Max queues on device                            1
  Max events on device                            1024
  Prefer user sync for interop                    No
  Profiling timer resolution                      1000ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Non-uniform work-groups                       Yes
    Work-group collective functions               Yes
    Sub-group independent forward progress        Yes
    IL version                                    (n/a)
    ILs with version                              (n/a)
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                (n/a)
  Built-in kernels with version                   (n/a)
  Device Extensions                               cl_ext_image_from_buffer cl_ext_image_requirements_info cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_k                                                                          hr_depth_images cl_khr_egl_event cl_khr_egl_image cl_khr_extended_bit_ops cl_khr_fp16 cl_khr_gl_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extend                                                                          ed_atomics cl_khr_image2d_from_buffer cl_khr_integer_dot_product cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_mipmap_image cl_khr_srg                                                                          b_image_writes cl_khr_subgroups cl_khr_subgroup_ballot cl_qcom_accelerated_image_ops cl_qcom_android_ahardwarebuffer_host_ptr cl_qcom_android_native_buffer_host_pt                                                                          r cl_qcom_bfloat16_product cl_qcom_bitreverse cl_qcom_compressed_image cl_qcom_create_buffer_from_image cl_qcom_dmabuf_host_ptr cl_qcom_dot_product8 cl_qcom_ext_ho                                                                          st_ptr cl_qcom_ext_host_ptr_iocoherent cl_qcom_extended_query_image_info cl_qcom_extract_image_plane cl_qcom_filter_bicubic cl_qcom_ml_ops cl_qcom_other_image cl_q                                                                          com_perf_hint cl_qcom_priority_hint cl_qcom_protected_context cl_qcom_recordable_queues cl_qcom_reqd_sub_group_size cl_qcom_subgroup_shuffle cl_qcom_vector_image_o                                                                          ps cl_qcom_onchip_global_memory cl_qcom_large_buffer
  Device Extensions with Version                  cl_ext_image_from_buffer                                         0x400000 (1.0.0)
                                                  cl_ext_image_requirements_info                                   0x400000 (1.0.0)
                                                  cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                  cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                  cl_khr_depth_images                                              0x400000 (1.0.0)
                                                  cl_khr_egl_event                                                 0x400000 (1.0.0)
                                                  cl_khr_egl_image                                                 0x400000 (1.0.0)
                                                  cl_khr_extended_bit_ops                                          0x400000 (1.0.0)
                                                  cl_khr_fp16                                                      0x400000 (1.0.0)
                                                  cl_khr_gl_sharing                                                0x400000 (1.0.0)
                                                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                  cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                  cl_khr_image2d_from_buffer                                       0x400000 (1.0.0)
                                                  cl_khr_integer_dot_product                                       0x800000 (2.0.0)
                                                  cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                  cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                  cl_khr_mipmap_image                                              0x400000 (1.0.0)
                                                  cl_khr_srgb_image_writes                                         0x400000 (1.0.0)
                                                  cl_khr_subgroups                                                 0x400000 (1.0.0)
                                                  cl_khr_subgroup_ballot                                           0x400000 (1.0.0)
                                                  cl_qcom_accelerated_image_ops                                    0x400008 (1.0.8)
                                                  cl_qcom_android_ahardwarebuffer_host_ptr                         0x400001 (1.0.1)
                                                  cl_qcom_android_native_buffer_host_ptr                           0x400006 (1.0.6)
                                                  cl_qcom_bfloat16_product                                         0x400000 (1.0.0)
                                                  cl_qcom_bitreverse                                               0x400001 (1.0.1)
                                                  cl_qcom_compressed_image                                         0x400003 (1.0.3)
                                                  cl_qcom_create_buffer_from_image                                 0x400007 (1.0.7)
                                                  cl_qcom_dmabuf_host_ptr                                          0x400000 (1.0.0)
                                                  cl_qcom_dot_product8                                             0x401001 (1.1.1)
                                                  cl_qcom_ext_host_ptr                                             0x400005 (1.0.5)
                                                  cl_qcom_ext_host_ptr_iocoherent                                  0x400004 (1.0.4)
                                                  cl_qcom_extended_query_image_info                                0x400000 (1.0.0)
                                                  cl_qcom_extract_image_plane                                      0x400005 (1.0.5)
                                                  cl_qcom_filter_bicubic                                           0x400000 (1.0.0)
                                                  cl_qcom_ml_ops                                                   0x400001 (1.0.1)
                                                  cl_qcom_other_image                                              0x400006 (1.0.6)
                                                  cl_qcom_perf_hint                                                0x400004 (1.0.4)
                                                  cl_qcom_priority_hint                                            0x400005 (1.0.5)
                                                  cl_qcom_protected_context                                        0x400005 (1.0.5)
                                                  cl_qcom_recordable_queues                                        0x400001 (1.0.1)
                                                  cl_qcom_reqd_sub_group_size                                      0x400001 (1.0.1)
                                                  cl_qcom_subgroup_shuffle                                         0x400006 (1.0.6)
                                                  cl_qcom_vector_image_ops                                         0x400009 (1.0.9)
                                                  cl_qcom_onchip_global_memory                                     0x400000 (1.0.0)
                                                  cl_qcom_large_buffer                                             0x400000 (1.0.0)

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [QCOM]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 QUALCOMM Snapdragon(TM)
    Device Name                                   QUALCOMM Adreno(TM) 750
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 QUALCOMM Snapdragon(TM)
    Device Name                                   QUALCOMM Adreno(TM) 750
  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                                 QUALCOMM Snapdragon(TM)
    Device Name                                   QUALCOMM Adreno(TM) 750

ICD loader properties
  ICD loader Name                                 Khronos OpenCL ICD Loader
  ICD loader Vendor                               Khronos Group
  ICD loader Version                              OPENCL_ICD_LOADER_VERSION_MAJOR.OPENCL_ICD_LOADER_VERSION_MINOR.OPENCL_ICD_LOADER_VERSION_REV
  ICD loader Profile                              OpenCL 3.0

ahorek avatar Feb 02 '25 11:02 ahorek

First successful Qualcomm OpenCL parser I've seen until now, and iI've got 26 phones

kimocoder avatar Feb 06 '25 00:02 kimocoder

Would you clarify what specifically is needed?

Well, Qualcomm phones got OpenCL support and everything, but Im unsure if it's "clinfo" support or the binding from Qualcomm (libraries) which is placed outside the clinfo checks

kimocoder avatar Feb 06 '25 00:02 kimocoder

it works for me

Number of platforms                               1
  Platform Name                                   QUALCOMM Snapdragon(TM)
  Platform Vendor                                 QUALCOMM
  Platform Version                                OpenCL 3.0 QUALCOMM build: commit unknown
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions with Version                cl_khr_icd                                                       0xc00000 (3.0.0)
  Platform Numeric Version                        0xc00000 (3.0.0)
  Platform Extensions function suffix             QCOM
  Platform Host timer resolution                  0ns

  Platform Name                                   QUALCOMM Snapdragon(TM)
Number of devices                                 1
  Device Name                                     QUALCOMM Adreno(TM) 750
  Device Vendor                                   QUALCOMM
  Device Vendor ID                                0x5143
  Device Version                                  OpenCL 3.0 Adreno(TM) 750
  Device Numeric Version                          0xc00000 (3.0.0)
  Driver Version                                  OpenCL 3.0 QUALCOMM build: commit unknown Compiler E031.45.02.06
  Device OpenCL C Version                         OpenCL C 3.0 Adreno(TM) 750
  Device OpenCL C all versions                    OpenCL C                                                         0xc00000 (3.0.0)
                                                  OpenCL C                                                         0x800000 (2.0.0)
                                                  OpenCL C                                                         0x402000 (1.2.0)
                                                  OpenCL C                                                         0x401000 (1.1.0)
                                                  OpenCL C                                                         0x400000 (1.0.0)
  Device OpenCL C features                        __opencl_c_3d_image_writes                                       0xc00000 (3.0.0)
                                                  __opencl_c_atomic_order_acq_rel                                  0xc00000 (3.0.0)
                                                  __opencl_c_atomic_order_seq_cst                                  0xc00000 (3.0.0)
                                                  __opencl_c_atomic_scope_device                                   0xc00000 (3.0.0)
                                                  __opencl_c_atomic_scope_all_devices                              0xc00000 (3.0.0)
                                                  __opencl_c_device_enqueue                                        0xc00000 (3.0.0)
                                                  __opencl_c_generic_address_space                                 0xc00000 (3.0.0)
                                                  __opencl_c_images                                                0xc00000 (3.0.0)
                                                  __opencl_c_int64                                                 0xc00000 (3.0.0)
                                                  __opencl_c_pipes                                                 0xc00000 (3.0.0)
                                                  __opencl_c_program_scope_global_variables                        0xc00000 (3.0.0)
                                                  __opencl_c_read_write_images                                     0xc00000 (3.0.0)
                                                  __opencl_c_subgroups                                             0xc00000 (3.0.0)
                                                  __opencl_c_work_group_collective_functions                       0xc00000 (3.0.0)
                                                  __opencl_c_integer_dot_product_input_4x8bit                      0xc00000 (3.0.0)
                                                  __opencl_c_integer_dot_product_input_4x8bit_packed               0xc00000 (3.0.0)
  Latest conformance test passed                  v2024-01-09-04
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               6
  Max clock frequency                             1MHz
  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                             1024x1024x1024
  Max work group size                             1024
  Preferred work group size multiple (device)     64
  Preferred work group size multiple (kernel)     8
  Max sub-groups per work group                   16
  Preferred / native vector sizes
    char                                                 1 / 1
    short                                                1 / 1
    int                                                  1 / 1
    long                                                 1 / 0
    half                                                 1 / 1        (cl_khr_fp16)
    float                                                1 / 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                             Yes
    IEEE754-2008 fused multiply-add               No
    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                             Yes
    IEEE754-2008 fused multiply-add               No
    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                              5814714368 (5.415GiB)
  Error Correction support                        No
  Max memory allocation                           1073741824 (1024MiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   Yes
    Fine-grained system sharing                   No
    Atomics                                       Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Page size (QCOM)                                4096 bytes
  External memory padding (QCOM)                  0 bytes
  Preferred alignment for atomics
    SVM                                           128 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Atomic memory capabilities                      relaxed, acquire/release, sequentially-consistent, work-item scope, work-group scope, device scope, all-devices s                                                                          cope
  Atomic fence capabilities                       relaxed, acquire/release, sequentially-consistent, work-item scope, work-group scope, device scope, all-devices s                                                                          cope
  Max size for global variable                    65536 (64KiB)
  Preferred total size of global vars             1048576 (1024KiB)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        1048576 (1024KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            134217728 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                 128
    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                    12288
  Max pipe packet size                            1024
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     8
  Max constant buffer size                        65536 (64KiB)
  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                     supported
  Queue properties (on device)
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                655376 (640KiB)
    Max size                                      655376 (640KiB)
  Max queues on device                            1
  Max events on device                            1024
  Prefer user sync for interop                    No
  Profiling timer resolution                      1000ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Non-uniform work-groups                       Yes
    Work-group collective functions               Yes
    Sub-group independent forward progress        Yes
    IL version                                    (n/a)
    ILs with version                              (n/a)
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                (n/a)
  Built-in kernels with version                   (n/a)
  Device Extensions                               cl_ext_image_from_buffer cl_ext_image_requirements_info cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_k                                                                          hr_depth_images cl_khr_egl_event cl_khr_egl_image cl_khr_extended_bit_ops cl_khr_fp16 cl_khr_gl_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extend                                                                          ed_atomics cl_khr_image2d_from_buffer cl_khr_integer_dot_product cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_mipmap_image cl_khr_srg                                                                          b_image_writes cl_khr_subgroups cl_khr_subgroup_ballot cl_qcom_accelerated_image_ops cl_qcom_android_ahardwarebuffer_host_ptr cl_qcom_android_native_buffer_host_pt                                                                          r cl_qcom_bfloat16_product cl_qcom_bitreverse cl_qcom_compressed_image cl_qcom_create_buffer_from_image cl_qcom_dmabuf_host_ptr cl_qcom_dot_product8 cl_qcom_ext_ho                                                                          st_ptr cl_qcom_ext_host_ptr_iocoherent cl_qcom_extended_query_image_info cl_qcom_extract_image_plane cl_qcom_filter_bicubic cl_qcom_ml_ops cl_qcom_other_image cl_q                                                                          com_perf_hint cl_qcom_priority_hint cl_qcom_protected_context cl_qcom_recordable_queues cl_qcom_reqd_sub_group_size cl_qcom_subgroup_shuffle cl_qcom_vector_image_o                                                                          ps cl_qcom_onchip_global_memory cl_qcom_large_buffer
  Device Extensions with Version                  cl_ext_image_from_buffer                                         0x400000 (1.0.0)
                                                  cl_ext_image_requirements_info                                   0x400000 (1.0.0)
                                                  cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                  cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                  cl_khr_depth_images                                              0x400000 (1.0.0)
                                                  cl_khr_egl_event                                                 0x400000 (1.0.0)
                                                  cl_khr_egl_image                                                 0x400000 (1.0.0)
                                                  cl_khr_extended_bit_ops                                          0x400000 (1.0.0)
                                                  cl_khr_fp16                                                      0x400000 (1.0.0)
                                                  cl_khr_gl_sharing                                                0x400000 (1.0.0)
                                                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                  cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                  cl_khr_image2d_from_buffer                                       0x400000 (1.0.0)
                                                  cl_khr_integer_dot_product                                       0x800000 (2.0.0)
                                                  cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                  cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                  cl_khr_mipmap_image                                              0x400000 (1.0.0)
                                                  cl_khr_srgb_image_writes                                         0x400000 (1.0.0)
                                                  cl_khr_subgroups                                                 0x400000 (1.0.0)
                                                  cl_khr_subgroup_ballot                                           0x400000 (1.0.0)
                                                  cl_qcom_accelerated_image_ops                                    0x400008 (1.0.8)
                                                  cl_qcom_android_ahardwarebuffer_host_ptr                         0x400001 (1.0.1)
                                                  cl_qcom_android_native_buffer_host_ptr                           0x400006 (1.0.6)
                                                  cl_qcom_bfloat16_product                                         0x400000 (1.0.0)
                                                  cl_qcom_bitreverse                                               0x400001 (1.0.1)
                                                  cl_qcom_compressed_image                                         0x400003 (1.0.3)
                                                  cl_qcom_create_buffer_from_image                                 0x400007 (1.0.7)
                                                  cl_qcom_dmabuf_host_ptr                                          0x400000 (1.0.0)
                                                  cl_qcom_dot_product8                                             0x401001 (1.1.1)
                                                  cl_qcom_ext_host_ptr                                             0x400005 (1.0.5)
                                                  cl_qcom_ext_host_ptr_iocoherent                                  0x400004 (1.0.4)
                                                  cl_qcom_extended_query_image_info                                0x400000 (1.0.0)
                                                  cl_qcom_extract_image_plane                                      0x400005 (1.0.5)
                                                  cl_qcom_filter_bicubic                                           0x400000 (1.0.0)
                                                  cl_qcom_ml_ops                                                   0x400001 (1.0.1)
                                                  cl_qcom_other_image                                              0x400006 (1.0.6)
                                                  cl_qcom_perf_hint                                                0x400004 (1.0.4)
                                                  cl_qcom_priority_hint                                            0x400005 (1.0.5)
                                                  cl_qcom_protected_context                                        0x400005 (1.0.5)
                                                  cl_qcom_recordable_queues                                        0x400001 (1.0.1)
                                                  cl_qcom_reqd_sub_group_size                                      0x400001 (1.0.1)
                                                  cl_qcom_subgroup_shuffle                                         0x400006 (1.0.6)
                                                  cl_qcom_vector_image_ops                                         0x400009 (1.0.9)
                                                  cl_qcom_onchip_global_memory                                     0x400000 (1.0.0)
                                                  cl_qcom_large_buffer                                             0x400000 (1.0.0)

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [QCOM]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 QUALCOMM Snapdragon(TM)
    Device Name                                   QUALCOMM Adreno(TM) 750
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 QUALCOMM Snapdragon(TM)
    Device Name                                   QUALCOMM Adreno(TM) 750
  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                                 QUALCOMM Snapdragon(TM)
    Device Name                                   QUALCOMM Adreno(TM) 750

ICD loader properties
  ICD loader Name                                 Khronos OpenCL ICD Loader
  ICD loader Vendor                               Khronos Group
  ICD loader Version                              OPENCL_ICD_LOADER_VERSION_MAJOR.OPENCL_ICD_LOADER_VERSION_MINOR.OPENCL_ICD_LOADER_VERSION_REV
  ICD loader Profile                              OpenCL 3.0

Please give me over the weekend and I will ask you to locate a few files 👍

kimocoder avatar Feb 06 '25 00:02 kimocoder

Android does not have vendor libraries in load paths by default. You need to add them manually to run clinfo or use any OpenCL program. $ export LD_LIBRARY_PATH="/system/vendor/lib64" $ ./clinfo Another option is to load the libopencl.so at runtime, but you also have to mimic the ocl api by binding all functions in use.

ahorek avatar Feb 06 '25 02:02 ahorek

The clinfo build system already tries to detect Android, and if detected it will do two things:

  1. add ${ANDROID_ROOT}/vendor/lib64 to rpath-link and the library search path when linking the executable
  2. build the executable as clinfo.real and create a clinfo wrapper script that will set LD_LIBRARY_PATH appropriately before running clinfo.real

@kimocoder could please clarify exactly what problems you're experiencing? How is your build system set up? Does the build succeed or fail? What does make show display?

Oblomov avatar Feb 06 '25 07:02 Oblomov

@Oblomov you're right! but the termux package doesn't include the wrapper /data/data/com.termux/files/usr/bin/clinfo

I guess @kimocoder didn't compile it from the source.

ahorek avatar Feb 06 '25 12:02 ahorek

If this is the case, then this is a termux packaging issue. The script does need to be designed better if it's of general use, so I'll keep this issue open, but if this is indeed a termux issue @kimocoder should open an issue with them, possibly referencing this bug so we can have a discussion about it with the termux developers.

Oblomov avatar Feb 06 '25 13:02 Oblomov

I'm getting the following error on my Adreno tablet, not sure how to resolve this:

~/clinfo $ make OS=Android
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers  -c -o clinfo.o src/clinfo.c
In file included from src/clinfo.c:35:
In file included from src/error.h:8:
src/ext.h:160:18: error: redefinition of typedef 'cl_version' is a C11 feature [-Werror,-Wtypedef-redefinition]
  160 | typedef cl_uint         cl_version;
      |                         ^
../OpenCL-Headers/CL/cl.h:117:17: note: previous definition is here
  117 | typedef cl_uint cl_version;
      |                 ^
1 error generated.
make: *** [<builtin>: clinfo.o] Error 1

hbmartin avatar May 02 '25 13:05 hbmartin

Hi @hbmartin I cannot reproduce with the latest version of the OpenCL-Headers and clinfo.

Oblomov avatar May 02 '25 14:05 Oblomov

Strange, when I remove line 160 from ext.h everything works fine

hbmartin avatar May 02 '25 15:05 hbmartin

I'm getting the following error on my Adreno tablet, not sure how to resolve this:

~/clinfo $ make OS=Android
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers  -c -o clinfo.o src/clinfo.c
In file included from src/clinfo.c:35:
In file included from src/error.h:8:
src/ext.h:160:18: error: redefinition of typedef 'cl_version' is a C11 feature [-Werror,-Wtypedef-redefinition]
  160 | typedef cl_uint         cl_version;
      |                         ^
../OpenCL-Headers/CL/cl.h:117:17: note: previous definition is here
  117 | typedef cl_uint cl_version;
      |                 ^
1 error generated.
make: *** [<builtin>: clinfo.o] Error 1

@Oblomov I have met the same problem here via export CPPFLAGS=-I/path/to/where/headers/are.
In the newest OpenCL header (until now 2025/06/24),line 123 in cl.h:

line 123 typedef cl_uint cl_version;

is public,and in ext.h, if we defined CL_VERSION_3_0,the cl_uint will be defined to cl_version,which will cause compilation error here.

the default CL_TARGET_OPENCL_VERSION is 220 in ext.h,may be we can set it to 300.I changed this vaule to 300 and it works.

FranzKafkaYu avatar Jun 24 '25 15:06 FranzKafkaYu

Ah, I see now. The change was introduced on 2024-06-18, with nothing to mark it. Your proposed fix sounds like the way to go, but there's an issue: 300 might not be a valid supported value for CL_TARGET_OPENCL_VERSION if someone has older versions of the headers, so it looks like something more sophisticated is needed.

Oblomov avatar Jun 24 '25 17:06 Oblomov

I believe 6201e4599b13efa2dd20dd8b6fbe036d90ec2a73 fixes this issue. Feel free to reopen if this is not the case.

Oblomov avatar Jun 24 '25 17:06 Oblomov