XiaoMi / mace

MACE is a deep learning inference framework optimized for mobile heterogeneous computing platforms.
Apache License 2.0
4.94k stars 819 forks source link

Hexagon DSP 运行InceptionV3相关问题 #198

Closed summerspringwei closed 6 years ago

summerspringwei commented 6 years ago

Before you open an issue, please make sure you have tried the following steps:

  1. Make sure your environment is the same with (https://mace.readthedocs.io/en/latest/installation/env_requirement.html).
  2. Have you ever read the document for your usage?
  3. The form below must be filled.

System information

Model deploy file (*.yml)

......

Describe the problem

mace应该也是使用的nnlib(https://source.codeaurora.org/quic/hexagon_nn/nnlib).我在OnePlus3上测试,(手机刷入Lineage OS 15.1,已经root),按照nnlib中README.HOW.TO.BUILD,安装如testsig-0xxxx.so,运行graph_app,得到如下错误 Failed to disable DSP DCVS: ffffffff! return value from dspCV_initQ6() : -1 ERROR: Could not initialize a new graph 查看logcat 09-19 17:54:29.480 7039 7039 V /data/graph_app: vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:194: fopen success: /dsp/fastrpc_shell_0 09-19 17:54:29.481 7039 7039 V /data/graph_app: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1082: create user pd with attributes 0 domain 0 09-19 17:54:29.572 7039 7041 V /data/graph_app: vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:194: fopen success: /system/lib/rfsa/adsp/libhexagon_nn_skel.so 09-19 17:54:29.593 7039 7039 D /data/graph_app: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:707: Error fffffffb: remote handle open domain failed. domain 0, name hexagon_nn, dlerror signature verify start failed for libhexagon_nn_skel.so 09-19 17:54:29.594 7039 7039 D /data/graph_app: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:651: Error ffffffff: remote handle invoke failed. domain 0, handle ffffffff, sc 11000000, pra 0x0 09-19 17:54:29.598 7039 7041 V /data/graph_app: vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:194: fopen success: /system/lib/rfsa/adsp/libdspCV_skel.so 09-19 17:54:29.618 7039 7039 D /data/graph_app: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:707: Error fffffffb: remote handle open domain failed. domain 0, name dspCV, dlerror signature verify start failed for libdspCV_skel.so 09-19 17:54:29.621 7039 7039 D /data/graph_app: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:651: Error ffffffff: remote handle invoke failed. domain 0, handle ffffffff, sc 2020000, pra 0xff825dd0

有两个问题:

  1. 有人遇到这样的问题吗?如果遇到,请问是怎么解决的呀? 2.请问是否是高通不支持在商业的手机上开发Hexagon DSP的应用?因为看Hexagon SDK 3.3.3,elfsign 工具中的说明,似乎在说只有OEM采用签名的.so可以运行。

如果有对问题感兴趣的,欢迎联系我。 xiachunwei@ict.ac.cn 谢谢!

liyinhgqw commented 6 years ago

是的,必须 OEM 签名,所以除非厂商内置了签名的nnlib 到生产的手机,个人开发者无法使用

llhe commented 6 years ago

这是高通芯片的限制,845前的芯片必须要经过签名,即使只是纯计算。(可能)后续芯片会允许不签名执行纯计算任务。

peyer commented 6 years ago

@llhe, I have rooted Google PIXEL mobile, and used ${HEXAGON_SDK}/scripts/testsig.py to generate testsig-${serial_numbers}.so, and put it under /vendor/lib/rfsa/adsp, but I still got error which shown that "dlopen error: dspCV signature verify start failed for libdspCV_skel.so"

llhe commented 6 years ago

@peyer Root也绕不开这个限制。

是的,必须 OEM 签名,所以除非厂商内置了签名的nnlib 到生产的手机,个人开发者无法使用

wayen820 commented 5 years ago

我使用了xiaomi的nnlib库,也签名了,手机是米8,解锁,刷开发版,并且root了。运行高通官方sdk自带的calculator例子,报如下错误 01-25 16:33:55.882 5119 5120 D adsprpc : HAP_utils.c:263:0x90ae:8: ADSP: Logging mask set to 31 01-25 16:33:55.894 5119 5120 E adsprpc : sigverify.c:705:0x10ab:8: ADSP: testsig root: 0c,09,76,0d (qc test) 01-25 16:33:55.895 5119 5120 E adsprpc : sigverify.c:720:0x10ab:8: ADSP: image root[0]: b6,6f,91,3f 01-25 16:33:55.895 5119 5120 E adsprpc : sigverify.c:722:0x10ab:8: ADSP: :error: signature does not match image root 01-25 16:33:55.895 5119 5120 W adsprpc : sigverify.c:589:0x10ab:8: ADSP: OEM ID -----------------------> 0x72 01-25 16:33:55.896 5119 5120 W adsprpc : sigverify.c:590:0x10ab:8: ADSP: Debug Fuse Enabled -----------> No 01-25 16:40:09.291 5224 5225 D adsprpc : HAP_utils.c:263:0xa0ae:8: ADSP: Logging mask set to 31 01-25 16:40:09.306 5224 5225 E adsprpc : sigverify.c:705:0xd0b4:8: ADSP: testsig root: 0c,09,76,0d (qc test) 01-25 16:40:09.307 5224 5225 E adsprpc : sigverify.c:720:0xd0b4:8: ADSP: image root[0]: b6,6f,91,3f 01-25 16:40:09.307 5224 5225 E adsprpc : sigverify.c:722:0xd0b4:8: ADSP: :error: signature does not match image root 01-25 16:40:09.307 5224 5225 W adsprpc : sigverify.c:589:0xd0b4:8: ADSP: OEM ID -----------------------> 0x72 01-25 16:40:09.309 5224 5225 W adsprpc : sigverify.c:590:0xd0b4:8: ADSP: Debug Fuse Enabled -----------> No 01-25 16:40:09.310 5224 5225 W adsprpc : sigverify.c:591:0xd0b4:8: ADSP: Testsig Enabled --------------> No 签名不匹配?

lee-bin commented 5 years ago

请参考https://github.com/XiaoMi/mace/issues/318#issuecomment-457078932 查看secure boot是禁掉的吗

wayen820 commented 5 years ago

我米8刷的是一个这个上面的 http://www.miui.com/download-345.html 开发版,使用##6484##查看版本信息怎么木有secure root 的信息,正常的不刷机的有secure root信息,显示YES。