| 本帖最后由 jefferyzhang 于 2020-3-31 10:41 编辑 
 安装准备:
 
 安装前请务必先更新Debian10到最新版本,参考:
 http://t.rock-chips.com/forum.php?mod=viewthread&tid=1319&extra=page%3D1
 
 
 安装步骤:
 
 1. 安装Toybrick GBM mali组件
 
 sudo apt install toybrick-gbm-dev libgbm-dev
 2. 安装OpenGL测试工具glmark2
 
 
 3. 安装OpenCL和clinfo
 
 sudo apt install ocl-icd-opencl-dev ocl-icd-dev clinfo
 4. 链接mali库
 
 sudo toybrick-mali.sh link
 
 5. 如果有任何GL/CL库的操作,记得操作之前先unlink mali库
 
 sudo toybrick-mali.sh unlink
 
 测试验证:
 
 1. OpenGL性能测试
 
 
 可以看到画面出现OpenGL 3D图像测试程序正在运行。完整运行指标如下:
 
 toybrick@debian10:~$ glmark2-es2-drm =======================================================     glmark2 2017.07 =======================================================     OpenGL Information     GL_VENDOR:     ARM     GL_RENDERER:   Mali-T860     GL_VERSION:    OpenGL ES 3.2 v1.r18p0-01rel0.5630b190419266e7fe8b09ec0007fb39 ======================================================= [build] use-vbo=false: FPS: 59 FrameTime: 16.949 ms [build] use-vbo=true: FPS: 59 FrameTime: 16.949 ms [texture] texture-filter=nearest: FPS: 60 FrameTime: 16.667 ms [texture] texture-filter=linear: FPS: 60 FrameTime: 16.667 ms [texture] texture-filter=mipmap: FPS: 60 FrameTime: 16.667 ms [shading] shading=gouraud: FPS: 60 FrameTime: 16.667 ms [shading] shading=blinn-phong-inf: FPS: 59 FrameTime: 16.949 ms [shading] shading=phong: FPS: 60 FrameTime: 16.667 ms [shading] shading=cel: FPS: 59 FrameTime: 16.949 ms [bump] bump-render=high-poly: FPS: 59 FrameTime: 16.949 ms [bump] bump-render=normals: FPS: 59 FrameTime: 16.949 ms [bump] bump-render=height: FPS: 59 FrameTime: 16.949 ms [effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 31 FrameTime: 32.258 ms [effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 27 FrameTime: 37.037 ms [pulsar] light=false:quads=5:texture=false: FPS: 59 FrameTime: 16.949 ms [desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 26 FrameTime: 38.462 ms [desktop] effect=shadow:windows=4: FPS: 30 FrameTime: 33.333 ms [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 20 FrameTime: 50.000 ms [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 20 FrameTime: 50.000 ms [buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 29 FrameTime: 34.483 ms [ideas] speed=duration: FPS: 30 FrameTime: 33.333 ms [jellyfish] <default>: FPS: 32 FrameTime: 31.250 ms [terrain] <default>: FPS: 11 FrameTime: 90.909 ms [shadow] <default>: FPS: 29 FrameTime: 34.483 ms [refract] <default>: FPS: 29 FrameTime: 34.483 ms [conditionals] fragment-steps=0:vertex-steps=0: FPS: 59 FrameTime: 16.949 ms [conditionals] fragment-steps=5:vertex-steps=0: FPS: 30 FrameTime: 33.333 ms [conditionals] fragment-steps=0:vertex-steps=5: FPS: 60 FrameTime: 16.667 ms [function] fragment-complexity=low:fragment-steps=5: FPS: 59 FrameTime: 16.949 ms [function] fragment-complexity=medium:fragment-steps=5: FPS: 31 FrameTime: 32.258 ms [loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 59 FrameTime: 16.949 ms [loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 59 FrameTime: 16.949 ms [loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 30 FrameTime: 33.333 ms =======================================================                                   glmark2 Score: 44  ======================================================= 
 
 
 
 2. OpenCL环境验证
 
 
 输出正确的Mali CL环境:
 
 
 toybrick@debian10:~$ clinfo Number of platforms                               1   Platform Name                                   ARM Platform   Platform Vendor                                 ARM   Platform Version                                OpenCL 1.2 v1.r18p0-01rel0.5630b190419266e7fe8b09ec0007fb39   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.5630b190419266e7fe8b09ec0007fb39   Driver Version                                  1.2   Device OpenCL C Version                         OpenCL C 1.2 v1.r18p0-01rel0.5630b190419266e7fe8b09ec0007fb39   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     Supported affinity domains                    (n/a)   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                              4029341696 (3.753GiB)   Error Correction support                        No   Max memory allocation                           1007335424 (960.7MiB)   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                                (n/a)   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 
 
 
 
 
 GL/CL Sample 教程参考: 
 
 |