How to limit mali gpu usage?
I want to use MNN on mali gpu, however, MNN will make the usage of gpu 100%, the UI will performance poor when use it, is there a way to limit the usage to ensure the UI works well?
could you please tell me how to get the usage of mali gpu, thanks
could you please tell me how to get the usage of mali gpu, thanks
- modify CMakeLists.txt in MNN directory, open option(MNN_OPENCL "Enable OpenCL" ON)
- recompile MNN source code combining your options.
cmake .. -DMNN_BUILD_DEMO=ON -DMNN_BUILD_CONVERTER=true -DOpenCL_INCLUDE_DIR=/usr/include/aarch64-linux-gnu/ && make -j6
However, many models are not running on gpu with partial op dimension are not supported on opencl, error info is reshape not support dimensions == 3 The Creator Don't support type 73, 257. While, you can use mobilenet, etc, demo_zoo provided by MNN. Reference link is https://www.yuque.com/mnn/en/demo_zoo
In addition, few face detection demos are provided to learn MNN framework.
UltraFace: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/issues/95
BlazeFace: https://github.com/xindongzhang/MNN-APPLICATIONS/issues/15
LFFD: https://github.com/SyGoing/LFFD-MNN
could you please tell me how to get the usage of mali gpu, thanks
- modify CMakeLists.txt in MNN directory, open option(MNN_OPENCL "Enable OpenCL" ON)
- recompile MNN source code combining your options.
cmake .. -DMNN_BUILD_DEMO=ON -DMNN_BUILD_CONVERTER=true -DOpenCL_INCLUDE_DIR=/usr/include/aarch64-linux-gnu/ && make -j6However, many models are not running on gpu with partial op dimension are not supported on opencl, error info is
reshape not support dimensions == 3 The Creator Don't support type 73, 257.While, you can use mobilenet, etc, demo_zoo provided by MNN. Reference link is https://www.yuque.com/mnn/en/demo_zoo In addition, few face detection demos are provided to learn MNN framework. UltraFace: Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB#95 BlazeFace: xindongzhang/MNN-APPLICATIONS#15 LFFD: https://github.com/SyGoing/LFFD-MNN
What are you talking about ??
could you please tell me how to get the usage of mali gpu, thanks
- modify CMakeLists.txt in MNN directory, open option(MNN_OPENCL "Enable OpenCL" ON)
- recompile MNN source code combining your options.
cmake .. -DMNN_BUILD_DEMO=ON -DMNN_BUILD_CONVERTER=true -DOpenCL_INCLUDE_DIR=/usr/include/aarch64-linux-gnu/ && make -j6However, many models are not running on gpu with partial op dimension are not supported on opencl, error info is
reshape not support dimensions == 3 The Creator Don't support type 73, 257.While, you can use mobilenet, etc, demo_zoo provided by MNN. Reference link is https://www.yuque.com/mnn/en/demo_zoo In addition, few face detection demos are provided to learn MNN framework. UltraFace: Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB#95 BlazeFace: xindongzhang/MNN-APPLICATIONS#15 LFFD: https://github.com/SyGoing/LFFD-MNNWhat are you talking about ??
I just want to show you how to compile MNN supported on ARM Mali GPU, and some demos are provided for application. If you can ,please ignore it.
solved by limit the CommandQueue size
I will propose a PR after I change the code more appropriate if needed
cat /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/load try this @kl456123 , ff9a0000 may be replaced by your gpu number
I will propose a PR after I change the code more appropriate if needed
Hi @HaoLiuHust Did you eventually have it proposed or not? If negative, could you please give a hint for how you solve this by limiting the CommandQueue size? Thanks.
I will propose a PR after I change the code more appropriate if needed
Hi @HaoLiuHust Did you eventually have it proposed or not? If negative, could you please give a hint for how you solve this by limiting the CommandQueue size? Thanks.
No, did not propose a PR yet. You can refer to Mace. they have implement a CommandQueue when use GPU
I will propose a PR after I change the code more appropriate if needed
Hi @HaoLiuHust Did you eventually have it proposed or not? If negative, could you please give a hint for how you solve this by limiting the CommandQueue size? Thanks.
https://github.com/HaoLiuHust/MNN/commit/8050a23dc7600b3f6bfdd42edab4423243f056c4 https://github.com/HaoLiuHust/MNN/commit/18b5837a05ff12f7e6abffd38729d76fdf76b8bf
you can refer to my commits
I will propose a PR after I change the code more appropriate if needed
Hi @HaoLiuHust Did you eventually have it proposed or not? If negative, could you please give a hint for how you solve this by limiting the CommandQueue size? Thanks.
HaoLiuHust@8050a23 HaoLiuHust@18b5837
you can refer to my commits
Thanks Hao, your idea inspired me a lot. (Apart from few syntex errors). It works very well on my rk3288 board.
I will propose a PR after I change the code more appropriate if needed
Hi @HaoLiuHust Did you eventually have it proposed or not? If negative, could you please give a hint for how you solve this by limiting the CommandQueue size? Thanks.
HaoLiuHust@8050a23 HaoLiuHust@18b5837 you can refer to my commits
Thanks Hao, your idea inspired me a lot. (Apart from few syntex errors). It works very well on my rk3288 board.
glad to hear that
DOpenCL_INCLUDE_DIR=
你好,麻烦问一下,我编译加这一句好像不起作用。不加编译通过(cmake -DCMAKE_TOOLCHAIN_FILE=../project/cross-compile/arm.toolchain.cmake -DARM_NAME=hisi3559a100 -DMNN_OPENCL=ON ..),在arm 上运行报错,Failed creating base context during opening of kernel driver. Kernel module may not have been loaded Build program failed ! programName.c_str()=s buffer_to_image in buildKernel, 305 ERROR CODE : -44