rknpu icon indicating copy to clipboard operation
rknpu copied to clipboard

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

Open Amanda-Barbara opened this issue 4 years ago • 2 comments

  1. 参考rknn-toolkit 并以sudo权限执行update_rk1808_usb_rule.sh脚本以获取USB设备的读写权限,并重启宿主机系统
  2. 执行adb devides脚本获取rk1808计算棒设备id
List of devices attached
TM018083200400203	device
  1. 执行ls -ltr /dev/bus/usb/003/001查看rk1808计算棒设备权限
crw-rw-r-- 1 root root 189, 256 2月  14 10:10 /dev/bus/usb/003/001
  1. 参照rknpu更新RK1808的驱动至1.7.1版本
adb push drivers/linux-aarch64/   /
adb push drivers/npu_ko/galcore.ko /lib/modules/galcore.ko
  1. 重启rk1808计算棒系统adb shell && sudo reboot并启动rknn_server进程adb shell && rknn_server,显示如下
# 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,显示如下

440 ?        00:00:00 rknn_server
488 pts/0    00:00:00 rknn_server

rknn_server进程已启动rknn的npu驱动已更新至1.7.1版本

  1. 从宿主机ubuntu20.04系统上远程链接rk1808计算棒的npu驱动程序,python3 examples/tflite/mobilenet_v1/test.py执行结果如下
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

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

Amanda-Barbara avatar Feb 14 '22 06:02 Amanda-Barbara

请问问题解决了吗?我也遇到类似的问题

mkwml avatar Jun 13 '22 09:06 mkwml

请问一下有解决吗?我也遇到同类问题

hwddean avatar Mar 28 '23 04:03 hwddean