Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
1.14k
stars
307
forks
source link
Crash when support ArmNN AIDL backend based on a shim over the NNAPI Support Library #769
Closed
khuongtrinh2 closed 1 month ago
Hello team, On v23.02, I was trying to support ArmNN AIDL based on a shim over the NNAPI Support Library. Step:
type hal_neuralnetworks_armnn, domain; hal_server_domain(hal_neuralnetworks_armnn, hal_neuralnetworks) type hal_neuralnetworks_armnn_exec, exec_type, vendor_file_type, file_type; init_daemon_domain(hal_neuralnetworks_armnn) add_service(hal_neuralnetworks_armnn, armnn_nnapi_service);
Modify service_contexts, add: android.hardware.neuralnetworks.IDevice/google-armnn u:object_r:armnn_nnapi_service:s0
Modify file_contexts, add: /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn u:object_r:hal_neuralnetworks_armnn_exec:s0
After complete these above step, I start hal_neuralnetworks_armnn service and get log crash: " 03-20 04:16:01.890 526 526 F DEBUG : Cause: null pointer dereference 03-20 04:16:01.890 526 526 F DEBUG : x0 b400f6a20c99e1e8 x1 0000f6a2fdc651e0 x2 0000ffffe2b71a80 x3 0000ffffe2b719a8 03-20 04:16:01.890 526 526 F DEBUG : x4 0000000000000060 x5 b400f6a1fc9a9030 x6 3dcccccd00000000 x7 3dcccccd3dcccccd 03-20 04:16:01.890 526 526 F DEBUG : x8 0000000000000000 x9 0000c447fa960940 x10 0000ffffe2b71a88 x11 000000000000000f 03-20 04:16:01.890 526 526 F DEBUG : x12 0000000000006b84 x13 0000000000000001 x14 ffffffffffffffff x15 0000000000000000 03-20 04:16:01.890 526 526 F DEBUG : x16 0000c447faa566d0 x17 0000f6a302880480 x18 0000f6a30877c000 x19 b400f6a20c99e1e8 03-20 04:16:01.890 526 526 F DEBUG : x20 0000ffffe2b71a78 x21 0000f6a30802a000 x22 0000ffffe2b71a78 x23 0000f6a30802a000 03-20 04:16:01.890 526 526 F DEBUG : x24 0000f6a30802a000 x25 0000c447faa500b0 x26 0000c447faa57d78 x27 0000000000000000 03-20 04:16:01.890 526 526 F DEBUG : x28 b400f6a20c99de00 x29 0000ffffe2b719d0 03-20 04:16:01.890 526 526 F DEBUG : lr 0000f6a2fdd42a68 sp 0000ffffe2b719a0 pc 0000f6a2fdc65224 pst 0000000000001000 03-20 04:16:01.890 526 526 F DEBUG : 7 total frames 03-20 04:16:01.890 526 526 F DEBUG : backtrace: 03-20 04:16:01.890 526 526 F DEBUG : #00 pc 0000000001235224 /vendor/lib64/libarmnn_support_library_prebuilt.so (armnn_driver::ArmnnDriver::getNumberOfCacheFilesNeeded() const+68) (BuildId: 7227e80cac6f024da9bd3555a4c61b64) 03-20 04:16:01.890 526 526 F DEBUG : #01 pc 0000000001312a64 /vendor/lib64/libarmnn_support_library_prebuilt.so (SL_ANeuralNetworksDevice_getNumberOfCacheFilesNeeded+72) (BuildId: 7227e80cac6f024da9bd3555a4c61b64) 03-20 04:16:01.890 526 526 F DEBUG : #02 pc 0000000000070028 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (aidl::android::hardware::neuralnetworks::ShimDevice::ShimDevice(std::1::shared_ptr, ANeuralNetworksDevice*, std::__1::basic_string<char, std:: 1::char_traits, std::1::allocator >)+696) (BuildId: 2a5ff4e20e796027757aae11d3a172b5)
03-20 04:16:01.890 526 526 F DEBUG : #03 pc 000000000006e878 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (std:: 1::shared_ptr ndk::SharedRefBase::make<aidl::android::hardware::neuralnetworks::ShimDevice, std::1::shared_ptr&, ANeuralNetworksDevice*&, std::__1::basic_string<char, std:: 1::char_traits, std::1::allocator > const&>(std:: 1::shared_ptr&, ANeuralNetworksDevice&, std::1::basic_string<char, std::__1::char_traits, std:: 1::allocator > const&)+120) (BuildId: 2a5ff4e20e796027757aae11d3a172b5)
03-20 04:16:01.890 526 526 F DEBUG : #04 pc 000000000006dadc /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (android::neuralnetworks::shim::registerDevices(NnApiSLDriverImpl , std::1::vector<android::neuralnetworks::shim::ShimDeviceInfo, std::1::allocator > const&, unsigned int, bool, bool)+1596) (BuildId: 2a5ff4e20e796027757aae11d3a172b5)
03-20 04:16:01.891 526 526 F DEBUG : #05 pc 000000000006c0f4 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (main+148) (BuildId: 2a5ff4e20e796027757aae11d3a172b5)
03-20 04:16:01.917 526 526 F DEBUG : #06 pc 00000000000546e8 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+104) (BuildId: 19c32900d9d702c303d2b4164fbba76c)
03-20 04:16:01.976 0 0 I servicemanager: Found android.frameworks.cameraservice.service.ICameraService/default in framework VINTF manifest.
03-20 04:16:01.988 0 0 I servicemanager: Found android.frameworks.cameraservice.service.ICameraService/default in framework VINTF manifest.
"
I run /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn and " Can't load libOpenCL.so: dlopen failed: library "libOpenCL.so" not found Can't load libGLES_mali.so: dlopen failed: library "libGLES_mali.so" not found Can't load libmali.so: dlopen failed: library "libmali.so" not found Can't load libOpenCL-pixel.so: dlopen failed: library "libOpenCL-pixel.so" not found Can't load libOpenCL-car.so: dlopen failed: library "libOpenCL-car.so" not found Couldn't find any OpenCL library. " => My device don't have support OpenCL, so I build with NEON and service still not work. Log: 05-09 06:25:54.875 2436 2436 F DEBUG : ABI: 'arm64' 05-09 06:25:54.875 2436 2436 F DEBUG : Timestamp: 2024-05-09 06:25:54.798925166+0000 05-09 06:25:54.876 2436 2436 F DEBUG : Process uptime: 1s 05-09 06:25:54.876 2436 2436 F DEBUG : Cmdline: /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn 05-09 06:25:54.876 2436 2436 F DEBUG : pid: 2433, tid: 2433, name: android.hardwar >>> /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn <<< 05-09 06:25:54.876 2436 2436 F DEBUG : uid: 1000 05-09 06:25:54.876 2436 2436 F DEBUG : tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) 05-09 06:25:54.876 2436 2436 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 05-09 06:25:54.876 2436 2436 F DEBUG : Abort message: 'terminating with uncaught exception of type St8bad_cast: std::bad_cast' 05-09 06:25:54.876 2436 2436 F DEBUG : x0 0000000000000000 x1 0000000000000981 x2 0000000000000006 x3 0000fffffe1039c0 05-09 06:25:54.876 2436 2436 F DEBUG : x4 736f646277641f73 x5 736f646277641f73 x6 736f646277641f73 x7 7f7f7f7f7f7f7f7f 05-09 06:25:54.876 2436 2436 F DEBUG : x8 00000000000000f0 x9 0000e5263e6dc090 x10 0000000000000001 x11 0000e5263e725f00 05-09 06:25:54.876 2436 2436 F DEBUG : x12 00000000663c6c72 x13 000000007fffffff x14 000000000018cfd4 x15 00000014ac798c97 05-09 06:25:54.876 2436 2436 F DEBUG : x16 0000e5263e792d08 x17 0000e5263e76e810 x18 0000e52646316000 x19 00000000000000ac 05-09 06:25:54.876 2436 2436 F DEBUG : x20 00000000000000b2 x21 0000000000000981 x22 0000000000000981 x23 00000000ffffffff 05-09 06:25:54.876 2436 2436 F DEBUG : x24 ffffff80ffffffc8 x25 0000e5263e794f58 x26 0000e52646f71ed1 x27 0000000000000003 05-09 06:25:54.876 2436 2436 F DEBUG : x28 0000e5264566ed40 x29 0000fffffe103a40 05-09 06:25:54.876 2436 2436 F DEBUG : lr 0000e5263e716414 sp 0000fffffe1039a0 pc 0000e5263e716444 pst 0000000000000000 05-09 06:25:54.876 2436 2436 F DEBUG : 17 total frames 05-09 06:25:54.876 2436 2436 F DEBUG : backtrace: 05-09 06:25:54.876 2436 2436 F DEBUG : #00 pc 000000000005c444 /apex/com.android.runtime/lib64/bionic/libc.so (abort+180) (BuildId: e28e590ca0e65ae6ef686c6e737bc371) 05-09 06:25:54.876 2436 2436 F DEBUG : #01 pc 00000000000ba3c4 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (abort_message+276) (BuildId: 51e38cd2421a89b1d0c3b09382a793d1) 05-09 06:25:54.877 2436 2436 F DEBUG : #02 pc 00000000000bab40 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (demangling_terminate_handler()+272) (BuildId: 51e38cd2421a89b1d0c3b09382a793d1) 05-09 06:25:54.877 2436 2436 F DEBUG : #03 pc 00000000000ba9f8 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (std::terminate(void (*)())+8) (BuildId: 51e38cd2421a89b1d0c3b09382a793d1) 05-09 06:25:54.877 2436 2436 F DEBUG : #04 pc 00000000000ba59c /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (cxxabiv1::failed_throw(cxxabiv1::cxa_exception*)+28) (BuildId: 51e38cd2421a89b1d0c3b09382a793d1) 05-09 06:25:54.877 2436 2436 F DEBUG : #05 pc 00000000000ba4e4 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (cxa_throw+116) (BuildId: 51e38cd2421a89b1d0c3b09382a793d1) 05-09 06:25:54.877 2436 2436 F DEBUG : #06 pc 00000000000d9c70 /vendor/bin/hw/android.hardware.neuralnetworks-shim-service-armnn (std::__1::locale::use_facet(std::1::locale::id&) const+224) (BuildId: 51e38cd2421a89b1d0c3b09382a793d1) 05-09 06:25:54.877 2436 2436 F DEBUG : #07 pc 000000000006e460 /system/lib64/libc++.so (std::1::stdinbuf::imbue(std::1::locale const&)+32) (BuildId: bc850c2b884ffd2f060de392e1cf9d7a)
05-09 06:25:54.877 2436 2436 F DEBUG : #08 pc 000000000006dad8 /system/lib64/libc++.so (std::1::ios_base::Init::Init()+296) (BuildId: bc850c2b884ffd2f060de392e1cf9d7a)
05-09 06:25:54.877 2436 2436 F DEBUG : #09 pc 000000000006ed58 /system/lib64/libc++.so (_GLOBALsub_I_iostream.cpp+24) (BuildId: bc850c2b884ffd2f060de392e1cf9d7a)
05-09 06:25:54.877 2436 2436 F DEBUG : #10 pc 00000000000614d0 /apex/com.android.runtime/bin/linker64 (dlZN6soinfo17call_constructorsEv+752) (BuildId: d8b61717b702b9fee4d1fbc84c282fed)
05-09 06:25:54.879 2436 2436 F DEBUG : #11 pc 0000000000061274 /apex/com.android.runtime/bin/linker64 (dlZN6soinfo17call_constructorsEv+148) (BuildId: d8b61717b702b9fee4d1fbc84c282fed)
05-09 06:25:54.880 2436 2436 F DEBUG : #12 pc 0000000000061274 /apex/com.android.runtime/bin/linker64 (dlZN6soinfo17call_constructorsEv+148) (BuildId: d8b61717b702b9fee4d1fbc84c282fed)
05-09 06:25:54.880 2436 2436 F DEBUG : #13 pc 0000000000061274 /apex/com.android.runtime/bin/linker64 (dlZN6soinfo17call_constructorsEv+148) (BuildId: d8b61717b702b9fee4d1fbc84c282fed)
05-09 06:25:54.880 2436 2436 F DEBUG : #14 pc 00000000000d6684 /apex/com.android.runtime/bin/linker64 (dlZL29linker_init_post_relocationR19KernelArgumentBlockR6soinfo+4260) (BuildId: d8b61717b702b9fee4d1fbc84c282fed)
05-09 06:25:54.880 2436 2436 F DEBUG : #15 pc 00000000000d558c /apex/com.android.runtime/bin/linker64 (dl___linker_init+1516) (BuildId: d8b61717b702b9fee4d1fbc84c282fed)
05-09 06:25:54.880 2436 2436 F DEBUG : #16 pc 0000000000064134 /apex/com.android.runtime/bin/linker64 (dl__start+4) (BuildId: d8b61717b702b9fee4d1fbc84c282fed)
Anyone can help me :( , Thank you so much