rockchip-linux / rknn-toolkit

BSD 3-Clause "New" or "Revised" License
830 stars 175 forks source link

连接了一个rv1126设备,运行rknn-toolkit-1.7.5中的例子,提示 Init runtime environment failed #482

Closed Lahahaha closed 3 weeks ago

Lahahaha commented 1 month ago

连接了一个rv1126设备,运行rknn-toolkit-1.7.5中的例子,提示 Init runtime environment failed

(rknntk) hang@Hang-Lu:~/rkdnn/rknn-toolkit-1.7.5/examples/tflite/mobilenet_v1$ adb devices
List of devices attached
20240311RV1126FD2G009C  device

更新驱动

adb push drivers/linux-armhf-puma/*   /
adb push drivers/npu_ko/galcore_puma.ko /lib/modules/galcore.ko

查看内核版本(version 6.4.6.5.351518)

[root@ATK-DLRV1126:/]# dmesg | grep -i galcore
[    7.046011] galcore: loading out-of-tree module taints kernel.
[    7.055818] galcore: npu init.
[    7.057000] galcore: start npu probe.
[    7.057173] galcore ffbc0000.npu: Linked as a consumer to regulator.4
[    7.057753] Galcore version 6.4.6.5.351518
[    7.057761] Galcore options:
[    7.061703] Galcore Info: ContiguousBase=0x7f95a000 ContiguousSize=0x400000
[    7.066604] Galcore Info: MMU mapped core 0 SRAM[0] hardware virtual address=                                                      0x400000 size=0x40000
[    7.066652] Galcore Info: MMU mapped core 0 SRAM[1] hardware virtual address=                                                      0x440000 size=0x40000
[    7.068411] galcore ffbc0000.npu: Init npu devfreq
[    7.068456] galcore ffbc0000.npu: bin=0
[    7.068496] galcore ffbc0000.npu: leakage=1.250
[    7.091977] galcore ffbc0000.npu: temp=51700, pvtm=105239 (105239 + 0)
[    7.092415] galcore ffbc0000.npu: pvtm-volt-sel=1
[    7.092459] galcore ffbc0000.npu: bin-scale=23
[    7.093279] galcore ffbc0000.npu: avs=0
[    7.094174] galcore ffbc0000.npu: l=-2147483648 h=2147483647 hyst=0 l_limit=0                                                       h_limit=0 h_table=0
[    7.094218] galcore ffbc0000.npu: failed to read out thermal zone (-22)
[    7.094322] galcore ffbc0000.npu: failed to find power_model node
[    7.094338] galcore ffbc0000.npu: failed to initialize power model

查看 rknn_server 版本(v1.7.5)

[root@ATK-DLRV1126:/]# strings /usr/bin/rknn_server | grep build
1.7.5 (bb79b30 build: 2023-07-18 10:56:54)

查看librknn_runtime版本(v1.7.5)

[root@ATK-DLRV1126:/]# strings /usr/lib/librknn_runtime.so | grep version
rknn_get_sdk_version
pre_compile_version
optimization_level_version
op_version
I [%s:%d]custom op version: %d
E [%s:%d] rknn_query,  info_len(%d) != sizeof(rknn_sdk_version)(%d)!
librknn_runtime version 1.7.5 (ccb93f1 build: 2023-07-18 10:56:29 base: 1131)
//int8 version
W [%s:%d]Unsupported evis version
E [%s:%d]unsupport kernel size:%d/dilation:%d/evis version:%d
.gnu.version
.gnu.version_r

使用的 rknntoolkit 版本:v1.7.5

运行例子如下:

(rknntk) hang@Hang-Lu:~/rkdnn/rknn-toolkit-1.7.5/examples/tflite/mobilenet_v1$ python test.py rv1126
Set target: rv1126
W rknn-toolkit version: 1.7.5
/home/hang/miniconda3/envs/rknntk/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/hang/miniconda3/envs/rknntk/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

 ...(省略)

--> Export RKNN model
done
--> Init runtime environment
adb: error: cannot bind listener: attempted to listen on unavailable socket type: localabstract:transfer_proxy
E Connect to Device Failure (-2)
E Catch exception when init runtime!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 979, in rknn.api.rknn_base.RKNNBase.init_runtime
E   File "rknn/api/rknn_runtime.py", line 171, in rknn.api.rknn_runtime.RKNNRuntime.__init__
E   File "rknn/api/rknn_platform_utils.py", line 327, in rknn.api.rknn_platform_utils.start_ntp_or_adb
E Exception: Init runtime environment failed!
E Please feedback the detailed log file <log_feedback_to_the_rknn_toolkit_dev_team.log> to the RKNN Toolkit development team.
E You can also check github issues: https://github.com/rockchip-linux/rknn-toolkit/issues
E Current device id is: None
E Devices connected:
E ['20240311RV1126FD2G009C']
Init runtime environment failed

使用 restart_rknn.sh 脚本重启了服务重新执行上面的脚本也是同样的错误

Lahahaha commented 3 weeks ago

没解决、改为使用C接口