Toybrick

ubuntu20.04宿主机远程链接rk1808计算棒设备上的npu驱动程序失败

amanda

注册会员

积分
52
楼主
发表于 2022-2-15 10:17:04    查看: 3838|回复: 0 | [复制链接]    打印 | 只看该作者
本帖最后由 amanda 于 2022-2-15 10:18 编辑

1. 参考[rknn-toolkit](https://github.com/rockchip-linu ... e_rk_usb_rule/linux)
并以`sudo`权限执行`update_rk1808_usb_rule.sh`脚本以获取`USB`设备的读写权限,并重启宿主机系统
2. 执行`adb devides`脚本获取rk1808计算棒设备id
```text
List of devices attached
TM018083200400203        device
```
3. 执行`ls -ltr /dev/bus/usb/003/001`查看rk1808计算棒设备权限
```text
crw-rw-r-- 1 root root 189, 256 2月  14 10:10 /dev/bus/usb/003/001
```

4. 参照[rknpu](https://github.com/rockchip-linux/rknpu)更新RK1808的驱动至1.7.1版本
```shell
adb push drivers/linux-aarch64/   /
adb push drivers/npu_ko/galcore.ko /lib/modules/galcore.ko
```

5. 重启rk1808计算棒系统`adb shell && sudo reboot`并启动`rknn_server`进程`adb shell && rknn_server`,显示如下
```text
# rknn_server
start rknn server, version:1.7.1 (0cfd4a1 build: 2021-12-10 09:43:11)
1 NNPluginManager loadPlugins(41): No plugin find!
I NPUTransfer: Starting NPU Transfer Server, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:51)

```
执行`ps -A | grep rknn_server`,显示如下
```text
440 ?        00:00:00 rknn_server
488 pts/0    00:00:00 rknn_server
```
rknn_server进程已启动rknn的npu驱动已更新至1.7.1版本

6. 从宿主机ubuntu20.04系统上远程链接rk1808计算棒的npu驱动程序,`python3 examples/tflite/mobilenet_v1/test.py`执行结果如下
```text
78b0f390f34c:python3 -u /opt/project/examples/tflite/mobilenet_v1/test.py
--> config model
done
--> Loading model
W The target_platform is not set in config, using default target platform rk1808.
done
--> Building model
W:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/control_flow_ops.py:1034: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.
   
2022-02-14 06:27:56.534017: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1483] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
W:tensorflow:From /usr/local/lib/python3.6/dist-packages/rknn/api/rknn.py:278: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
done
--> Export RKNN model
done
--> Init runtime environment
* daemon not running; starting now at tcp:5037
* daemon started successfully
error: device 'TM018083200400203' not found
E Connect to Device Failure (-1)
E Catch exception when init runtime!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 868, 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 318, 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: TM018083200400203
E Devices connected:
E []
Init runtime environment failed

Process finished with exit code 255

```
想请教一下这个问题是什么原因导致的?如何解决?谢谢。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表