Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Rockpi4/dev/install-opencl

< Rockpi4‎ | dev
Revision as of 04:20, 16 March 2023 by RadxaYuntian (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
    ROCK Pi 4 >  Development >  Install OpenCL

OpenCL driver works on ROCK Pi 4

Install libmali package

Install libmali package from Radxa APT's testing repo.

 $ sudo apt-get install rockchip-mali-midgard14
 $ sudo apt-get install rockchip-mali-midgard-dev

Sanity Checkout with clpeak

To see if the opencl driver works properly on ROCK Pi 4, use the benchmark tool clpeak

 $ sudo apt-get update && sudo apt-get install cmake git g++
 $ git clone https://github.com/krrishnarraj/clpeak
 $ mkdir clpeak/build
 $ cd clpeak/build
 $ cmake ..
 $ make -j$(nproc)
 $ ./clpeak

After executing command clpeak, there shall be the following outputs:

 Platform: ARM Platform
   Device: Mali-T860
     Driver version  : 1.2 (Linux ARM64)
     Compute units   : 4
     Clock frequency : 200 MHz
 
     Global memory bandwidth (GBPS)
       float   : 3.68
       float2  : 5.95
       float4  : 6.70
       float8  : 5.59
       float16 : 5.15
 
     Single-precision compute (GFLOPS)
       float   : 25.12
       float2  : 47.47
       float4  : 46.81
       float8  : 41.68
       float16 : 46.45
 
     Half-precision compute (GFLOPS)
       half   : 23.11
       half2  : 50.10
       half4  : 98.10
       half8  : 93.34
       half16 : 88.61
 
     Double-precision compute (GFLOPS)
       double   : 5.85
       double2  : 3.27
       double4  : 20.97
       double8  : 20.65
       double16 : 20.40
 
     Integer compute (GIOPS)
       int   : 22.67
       int2  : 49.85
       int4  : 47.96
       int8  : 34.30
       int16 : 47.78
 
     Transfer bandwidth (GBPS)
       enqueueWriteBuffer         : 1.24
       enqueueReadBuffer          : 1.31
       enqueueMapBuffer(for read) : 5.22
         memcpy from mapped ptr   : 2.56
       enqueueUnmap(after write)  : 5.32
         memcpy to mapped ptr     : 2.73
 
     Kernel launch latency : 307.37 us

Troubleshooting