Failed running RKNN library on ubuntu
Posted: 2025-02-13 14:05
Hello,
I have a LuckFox Pico Ultra W and I'm trying to use the RKNN library using the Ubuntu Kernel using the following steps:
I installed the linario compiler: gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf
I compiled the rknn_yolov5_demo with said compiler and changed it to link with the librknnrt.so from the repo path 'rknn-toolkit2/rknpu2/runtime/Linux/librknn_api/armhf'
I copied the librknnrt.so to /lib and ran the compiled yolo demo binary using the yolov5s-640-640.rknn model file
After receiving the error ' failed to open rknpu module, need to insmod rknpu dirver!', I found rknpu.ko in the SDK's build folder and installed it with the 'insmod' command as I was asked
After doing all of this, I can finally get the demo to run (though only with sudo), only to fall on the following errors:
E RKNN: [16:36:58.030] failed to allocate fd, ret: -1, errno: 12, errstr: Cannot allocate memory
E RKNN: [16:36:58.031] failed to malloc npu memory, size: 7752683, flags: 0x2
E RKNN: [16:36:58.032] read File: yolov5s-640-640.rknn failed!
E RKNN: [16:36:58.033] rknn_init, load model failed!
rknn_init fail! ret=-6
I do not know what I'm doing wrong, and have no way to debug the error since the library isn't opensource
Am I doing anything wrong? Did I skip some steps or should use a different .so library? wrong compiler?
Would appreciate any sort of help.
I have a LuckFox Pico Ultra W and I'm trying to use the RKNN library using the Ubuntu Kernel using the following steps:
I installed the linario compiler: gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf
I compiled the rknn_yolov5_demo with said compiler and changed it to link with the librknnrt.so from the repo path 'rknn-toolkit2/rknpu2/runtime/Linux/librknn_api/armhf'
I copied the librknnrt.so to /lib and ran the compiled yolo demo binary using the yolov5s-640-640.rknn model file
After receiving the error ' failed to open rknpu module, need to insmod rknpu dirver!', I found rknpu.ko in the SDK's build folder and installed it with the 'insmod' command as I was asked
After doing all of this, I can finally get the demo to run (though only with sudo), only to fall on the following errors:
E RKNN: [16:36:58.030] failed to allocate fd, ret: -1, errno: 12, errstr: Cannot allocate memory
E RKNN: [16:36:58.031] failed to malloc npu memory, size: 7752683, flags: 0x2
E RKNN: [16:36:58.032] read File: yolov5s-640-640.rknn failed!
E RKNN: [16:36:58.033] rknn_init, load model failed!
rknn_init fail! ret=-6
I do not know what I'm doing wrong, and have no way to debug the error since the library isn't opensource
Am I doing anything wrong? Did I skip some steps or should use a different .so library? wrong compiler?
Would appreciate any sort of help.