rockchip-linux / rknpu

BSD 3-Clause "New" or "Revised" License
212 stars 61 forks source link

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

Open Amanda-Barbara opened 2 years ago

Amanda-Barbara commented 2 years ago
  1. 参考rknn-toolkit 并以sudo权限执行update_rk1808_usb_rule.sh脚本以获取USB设备的读写权限,并重启宿主机系统

  2. 执行adb devides脚本获取rk1808计算棒设备id

    List of devices attached
    TM018083200400203   device
  3. 执行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
  4. 参照rknpu更新RK1808的驱动至1.7.1版本

    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,显示如下

    
    # 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版本

  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..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

Process finished with exit code 255


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

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

hwddean commented 1 year ago

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