Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:applications:opencl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
products:sbc:common:applications:opencl [2023/10/26 02:58]
sravan created
products:sbc:common:applications:opencl [2024/04/24 02:48] (current)
nick [Increasing device operation frequency]
Line 9: Line 9:
 <WRAP info> <WRAP info>
 To use OpenCL you will need to use one of the following platforms to make sure the drivers are present. To use OpenCL you will need to use one of the following platforms to make sure the drivers are present.
 +</WRAP>
 +
 ^ board ^ Linux Kernel (BSP) ^ OS ^  ^ board ^ Linux Kernel (BSP) ^ OS ^ 
 | VIM3 \\ **Mali G52-MP4** - Bifrost 2nd gen| 4.9 \\ 5.15 | Ubuntu 22.04| | VIM3 \\ **Mali G52-MP4** - Bifrost 2nd gen| 4.9 \\ 5.15 | Ubuntu 22.04|
Line 14: Line 16:
 | VIM4 \\ **Mali G52-MP8** - Bifrost 2nd gen| 5.4 \\ 5.15 | Ubuntu 22.04| | VIM4 \\ **Mali G52-MP8** - Bifrost 2nd gen| 5.4 \\ 5.15 | Ubuntu 22.04|
 | Edge2 \\ **Mali G610-MP4** - Valhall 3rd gen| 5.10| Ubuntu 22.04| | Edge2 \\ **Mali G610-MP4** - Valhall 3rd gen| 5.10| Ubuntu 22.04|
-</WRAP> 
  
 ===== Check OpenCL capabilities and details ====== ===== Check OpenCL capabilities and details ======
Line 21: Line 22:
 ``` ```
  
 +<WRAP important>
 +**VIM3** has OpenCL capabilities for both NPU and GPU, and by default the OpenCL lib in /usr/lib is for NPU.
 +To use the GPU for proper acceleration follow the below steps to replace the correct library for the GPU.
 +```shell
 +# Move the NPU OpenCL lib
 +$ sudo mv /usr/lib/libOpenCL.so /usr/lib/libOpenCL.so.old
 +
 +# Symlink the right OpenCL lib for Mali GPU
 +$ sudo ln -s /usr/lib/aarch64-linux-gnu/libOpenCL.so.1.0.0 /usr/lib/libOpenCL.so
 +```
 +
 +Note: With the 4.9 kernel, there is only OpenCL 2.0 capability and PyOpenCL will break, migrating to 5.15 kernel images will resolve it.
 +</WRAP>
 ===== Get source code ====== ===== Get source code ======
 Clone the examples [[gh>sravansenthiln1/opencl-demos]] Clone the examples [[gh>sravansenthiln1/opencl-demos]]
Line 87: Line 101:
 On **VIM3/3L/4**: On **VIM3/3L/4**:
 ```shell ```shell
-$ echo 2 | sudo tee /sys/class/mpugpu/scale_mode+$ echo 2 | sudo tee /sys/class/mpgpu/scale_mode
 ``` ```
  
Last modified: 2023/10/26 02:58 by sravan