Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3399 编译with_opencl后运行示例mobilenetv1_light_api显示不支持opencl #10512

Open
nypyp opened this issue May 8, 2024 · 1 comment
Assignees

Comments

@nypyp
Copy link

nypyp commented May 8, 2024

为使您的问题得到快速解决,在建立 Issue 前,请您先通过如下方式搜索是否有相似问题:历史 issue, FAQ 文档, 官方文档

如果您没有查询到相似问题,为快速解决您的提问,建立 issue 时请提供如下细节信息:

  • 标题:简洁、精准描述您的问题,例如“最新预测库的 API 文档在哪儿 ”
  • 版本、预测库信息:
       1)Paddle Lite 版本:v2.13rc
       2)Host 环境:Ubuntu 18.04
       3)运行设备环境:rk3399J
       4)预测后端信息:CPU/GPU
  • 预测信息
       1)预测 API:C++
       2)预测选项信息:armv8、多线程
       3)预测库来源:源码编译, gcc
  • 复现信息:如为报错,请提供剥离业务环境的可复现预测 demo,用于问题复现
  • 问题描述:编译Paddle_lite预测库with_opencv=ON with_opencl=ON with_extra=ON后,运行示例程序mobilenetv1_light_api报如下信息,不支持opencl:
- [I  5/ 8 16: 8:51.823 .../code/Paddle-Lite/lite/api/paddle_api.cc:44 IsOpenCLBackendValid] need to check fp16 valid:0
[I  5/ 8 16: 8:51.823 ...-Lite/lite/backends/opencl/cl_wrapper.cc:41 CLWrapper] Failed to find and initialize Opencl library
[I  5/ 8 16: 8:51.823 .../code/Paddle-Lite/lite/api/paddle_api.cc:51 IsOpenCLBackendValid] Found opencl library:0
is_opencl_backend_valid:false
nb model will be running on cpu.

运行clinfo指令得到信息:

arm_release_ver of this libmali is 'r18p0-01rel0', rk_so_ver is '4'.Number of platforms                               1
  Platform Name                                   ARM Platform
  Platform Vendor                                 ARM
  Platform Version                                OpenCL 1.2 v1.r18p0-01rel0.5cb5681058e8e076ff89747c20c32578
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp16 cl_khr_icd cl_khr_egl_image cl_khr_image2d_from_buffer cl_arm_core_id cl_arm_printf cl_arm_thread_limit_hint cl_arm_non_uniform_work_group_size cl_arm_import_memory
  Platform Extensions function suffix             ARM

  Platform Name                                   ARM Platform
Number of devices                                 1
  Device Name                                     Mali-T860
  Device Vendor                                   ARM
  Device Vendor ID                                0x8602000
  Device Version                                  OpenCL 1.2 v1.r18p0-01rel0.5cb5681058e8e076ff89747c20c32578
  Driver Version                                  1.2
  Device OpenCL C Version                         OpenCL C 1.2 v1.r18p0-01rel0.5cb5681058e8e076ff89747c20c32578
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               4
  Max clock frequency                             5MHz
  Device Partition                                (core)
    Max number of sub-devices                     0
    Supported partition types                     None
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              4
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 8 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              4027211776 (3.751GiB)
  Error Correction support                        No
  Max memory allocation                           1006802944 (960.2MiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        262144 (256KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            65536 pixels
    Max 1D or 2D image array size                 2048 images
    Base address alignment for 2D image buffers   32 bytes
    Pitch alignment for 2D image buffers          16 pixels
    Max 2D image size                             65536x65536 pixels
    Max 3D image size                             65536x65536x65536 pixels
    Max number of read image args                 128
    Max number of write image args                8
  Local memory type                               Global
  Local memory size                               32768 (32KiB)
  Max number of constant args                     8
  Max constant buffer size                        65536 (64KiB)
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        Yes
    Profiling                                     Yes
  Prefer user sync for interop                    No
  Profiling timer resolution                      1000ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                
  Device Extensions                               cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp16 cl_khr_icd cl_khr_egl_image cl_khr_image2d_from_buffer cl_arm_core_id cl_arm_printf cl_arm_thread_limit_hint cl_arm_non_uniform_work_group_size cl_arm_import_memory

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  ARM Platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [ARM]
  clCreateContext(NULL, ...) [default]            Success [ARM]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 ARM Platform
    Device Name                                   Mali-T860
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 ARM Platform
    Device Name                                   Mali-T860
  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)  Success (1)
    Platform Name                                 ARM Platform
    Device Name                                   Mali-T860

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.11
  ICD loader Profile                              OpenCL 2.1

请问如何才能调用系统的opencl库呢,文档中并未写明,谢谢

@csy0225
Copy link
Collaborator

csy0225 commented May 9, 2024

您看下您的 lib 是否在这个列表里面,没有的话可以添加试下

#elif defined(__linux__)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants