Forums - Android-error

4 posts / 0 new
Last post
Android-error
MarkWu
Join Date: 8 May 22
Posts: 35
Posted: Mon, 2023-03-06 23:40

Hi,

I use:

SNPE-VERSION:snpe-2.5.0.4052

SOC:Snapdragon 865

Android OS:12

Android SDK:31

ARCH:arm64-v8a

Phone:xiaomi 10

When I use gpu-runtime to load model in apk,  he reported the following error:

W/Thread-3: type=1400 audit(0.0:4198): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
W/Thread-3: type=1400 audit(0.0:4199): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
W/Thread-3: type=1400 audit(0.0:4200): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
W/Thread-3: type=1400 audit(0.0:4201): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
E/SNPE-DebugLog: 15:25:24.137981 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.138156 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.138529 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.138542 [USER_ERROR:DNN_RUNTIME] QNN ERROR: 1006
E/SNPE-DebugLog: 15:25:24.142075 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.142096 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.142476 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.142488 [USER_ERROR:DNN_RUNTIME] QNN ERROR: 1006
E/base_net: SNPE build failed error_code=1200; error_message=libstd error. QnnBackned_Create failed: 1006; error_component=Dependent library; line_no=1313; thread_id=480973405360
E/base_net: ERROR engine Load failed
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 31290 (Thread-3), pid 31207 (example.demo)
But I have no problem loading the model in the shell.
/vendor/etc/public.libraries.txt  contents:
libqti-perfd-client.so
libadsprpc.so
libcdsprpc.so
libsdsprpc.so
libfastcvopt.so
liblistensoundmodel2.so
libOpenCL.so
libnpu.so
libmialgoengine.so 64
libmpbase.so 64
libHalSuperSensorServer.so 64
libSuperSensor.so 64
libSuperSensorCPU.so 64
libarcsoft_beautyshot.so 64
libarcsoft_dualcam_refocus.so 64
libarcsoft_dualcam_refocus_rear_t.so 64
libarcsoft_dualcam_refocus_rear_w.so 64
libarcsoft_dualcam_refocus_front.so 64
libarcsoft_portrait_lighting.so 64
libarcsoft_portrait_lighting_c.so 64
libarcsoft_high_dynamic_range.so 64
libmibokeh_855.so 64
libmialgo_image_colourkeeping.so 64
libarcsoft_distortion_correction.so 64
libarcsoft_bodyslim.so 64
libalCFR.so 64
libsupermoon.so 64
libcvp_common.so
libalhLDC.so 64
libalAILDC.so 64
libflaw.so 64
libarcsoft_superportrait.so 64
libmialgo_ie_capture.so 64
libmialgo_utils.so 64
libxmi_high_dynamic_range.so 64
libMIAIHDRhvx_interface.so 64
libcvp2.so
libcvp2_hfi.so
libSNPE.so 64
libsymphony-cpu.so 64
libcamera_scene.so 64
libsnpe_dsp_domains_v2.so 64
libEGL.so
What shall I do?
BR.
 
  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sat, 2023-03-11 23:59

Dear developer,

What's quantization type for you model dlc as GPU runtime only support float? You can double-check your model dlc file to make sure it's float model.

 

BR.

Wei

  • Up0
  • Down0
MarkWu
Join Date: 8 May 22
Posts: 35
Posted: Sun, 2023-03-12 19:39

Dear weihuan,

The model I use is not quantified . model-dlc-metadata contents:

converter-command=snpe-onnx-to-dlc adjust_nms_features_dims=True align_matmul_ranks=True batch=None copyright_file=None custom_io= custom_op_config_paths=None debug=-1 define_symbol=None disable_batchnorm_folding=False dry_run=None dumpIR=False dump_custom_io_config_template= dump_inferred_model=False dump_value_info=False enable_strict_validation=False expand_gru_op_structure=True extract_color_transform=True float_bw=32 force_prune_cast_ops=False handle_gather_negative_indices=True inject_cast_for_gather=True input_dim=[['data', '1,3,1024,1024']] input_dtype=[] input_encoding=[] input_layout=[] input_type=[] keep_disconnected_nodes=False keep_int64_inputs=False keep_quant_nodes=False match_caffe_ssd_to_tf=True model_version=None no_simplification=False op_package_lib= out_names=['Resize_140', 'Resize_143'] package_name=None perform_axes_to_spatial_first_order=True prepare_inputs_as_params=False preprocess_lstm_ops=True preprocess_roi_pool_inputs=True quantization_overrides= squash_box_decoder=True unroll_gru_time_steps=True unroll_lstm_time_steps=True use_convert_quantization_nodes=False validation_target=[]
converter-version=2.5.0.4052
model-copyright=N/A
model-version=N/A
quantizer-command=N/A

I can load and run the model normally by using the shell command on the Xiaomi 10 mobile phone.

But the error  will appear in the app:

W/Thread-3: type=1400 audit(0.0:4198): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
W/Thread-3: type=1400 audit(0.0:4199): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
W/Thread-3: type=1400 audit(0.0:4200): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
W/Thread-3: type=1400 audit(0.0:4201): avc: denied { search } for name="soc0" dev="sysfs" ino=86749 scontext=u:r:untrusted_app:s0:c88,c263,c512,c768 tcontext=u:object_r:vendor_sysfs_soc:s0 tclass=dir permissive=0 app=com.example.demo
E/SNPE-DebugLog: 15:25:24.137981 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.138156 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.138529 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.138542 [USER_ERROR:DNN_RUNTIME] QNN ERROR: 1006
E/SNPE-DebugLog: 15:25:24.142075 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.142096 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.142476 [USER_ERROR:DNN_RUNTIME] GPU ERROR: 10029
E/SNPE-DebugLog: 15:25:24.142488 [USER_ERROR:DNN_RUNTIME] QNN ERROR: 1006
E/base_net: SNPE build failed error_code=1200; error_message=libstd error. QnnBackned_Create failed: 1006; error_component=Dependent library; line_no=1313; thread_id=480973405360
E/base_net: ERROR engine Load failed
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 31290 (Thread-3), pid 31207 (example.demo)

I found that "/vendor/etc/public. libraries. txt content:" of Xiaomi 10 mobile phone :

libqti-perfd-client.so
libadsprpc.so
libcdsprpc.so
libsdsprpc.so
libfastcvopt.so
liblistensoundmodel2.so
libOpenCL.so
libnpu.so
libmialgoengine.so 64
libmpbase.so 64
libHalSuperSensorServer.so 64
libSuperSensor.so 64
libSuperSensorCPU.so 64
libarcsoft_beautyshot.so 64
libarcsoft_dualcam_refocus.so 64
libarcsoft_dualcam_refocus_rear_t.so 64
libarcsoft_dualcam_refocus_rear_w.so 64
libarcsoft_dualcam_refocus_front.so 64
libarcsoft_portrait_lighting.so 64
libarcsoft_portrait_lighting_c.so 64
libarcsoft_high_dynamic_range.so 64
libmibokeh_855.so 64
libmialgo_image_colourkeeping.so 64
libarcsoft_distortion_correction.so 64
libarcsoft_bodyslim.so 64
libalCFR.so 64
libsupermoon.so 64
libcvp_common.so
libalhLDC.so 64
libalAILDC.so 64
libflaw.so 64
libarcsoft_superportrait.so 64
libmialgo_ie_capture.so 64
libmialgo_utils.so 64
libxmi_high_dynamic_range.so 64
libMIAIHDRhvx_interface.so 64
libcvp2.so
libcvp2_hfi.so
libSNPE.so 64
libsymphony-cpu.so 64
libcamera_scene.so 64
libsnpe_dsp_domains_v2.so 64
libEGL.so

and "/vendor/etc/public. libraries. txt content:"  of Huawei Mate50 :

libai_client_igs.so
libai_infra_log.so
libai_client.so
libqti-perfd-client.so
libadsprpc.so
libcdsprpc.so
libsdsprpc.so
libfastcvopt.so
libOpenCL.so

I don't know whether it is caused by the large difference in the contents of /vendor/etc/public.libraries.txt.

I want to know how to solve this problem, or how to judge whether the mobile phone with Qualcomm chip can use snpe in Android-app.

BR.

  • Up0
  • Down0
likai2
Join Date: 27 Dec 22
Posts: 24
Posted: Wed, 2023-03-15 04:41

Hi Mark,

Are you using Snpe.aar in your android project, or using .so derictly by CMakeList?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.