halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.86k stars 1.07k forks source link

[HVX] Blur example fails with: Failed to write shared object to 'libhalide_shared_runtime.so' #8201

Open FabianSchuetze opened 5 months ago

FabianSchuetze commented 5 months ago

I am trying to execute the blur example on an Snapdragon SM8250 (Samung Galaxy Tablet S7), but running the blur example fails with the error:

Aborted

Adb Logcat | grep Halide says:

 04-18 14:03:48.835  5712  5712 I halide  : Target: arm-64-android-debug-hvx-hvx_128
04-18 14:03:48.835  5712  5712 I halide  :  Input Buffer input: 0x7ff274b340 -> buffer(0, 0x0, 0xb40000775b80a100, 1, uint16, {0, 648, 1}, {0, 482, 648})
04-18 14:03:48.835  5712  5712 I halide  :  Output Buffer blur_y: 0x7ff274b3a8 -> buffer(0, 0x0, 0xb4000076db1e6200, 0, uint16, {0, 640, 1}, {0, 480, 640})
04-18 14:03:48.835  5712  5712 I halide  : Hexagon: init_hexagon_runtime (user_context: 0x0)
04-18 14:03:48.835  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_load_library') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c2f9c
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_get_symbol_v4') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c30e4
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_run') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c486c
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_release_library') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c394c
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_host_malloc_init') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c4100
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_host_malloc_deinit') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c433c
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_host_malloc') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c43b8
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_host_free') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c4730
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_poll_log') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3a5c
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_poll_profiler_state') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3b80
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_profiler_set_current_func') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3c94
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_power_hvx_on') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3218
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_power_hvx_off') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3314
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_set_performance') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3eb4
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_set_performance_mode') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3da4
04-18 14:03:48.836  5712  5712 I halide  :     halide_get_library_symbol('halide_hexagon_remote_set_thread_priority') -> 
04-18 14:03:48.836  5712  5712 I halide  :         0x76db0c3ff0
04-18 14:03:48.836  5712  5712 I halide  : Hexagon: halide_hexagon_initialize_kernels (user_context: 0x0, state_ptr: 0x5c7e39f380, *state_ptr: 0x0, code: 0x5c7e336600, code_size: 8672)
04-18 14:03:48.836  5712  5712 I halide  : , code: 0x5c7e3387e0, code_size: 86776)
04-18 14:03:48.836  5712  5712 I halide  :     Initializing shared runtime
04-18 14:03:48.836  5712  5712 I halide  :     Writing shared object 'libhalide_shared_runtime.so'
04-18 14:03:48.836  5712  5712 I halide  :     failed to write shared object to 'libhalide_shared_runtime.so'
04-18 14:03:48.836  5712  5712 I halide  :     halide_remote_load_library(libhalide_shared_runtime.so) -> 
04-18 14:03:48.868  5712  5718 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/libhalide_hexagon_remote_skel.so
04-18 14:03:48.875  5712  5712 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:815: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for halide_hexagon_remote on domain 3 (dlerror _rtld_map_object_ex: cannot open oemconfig.so, errno 2 (no such file or directory))
04-18 14:03:48.875  5712  5712 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:828: Error 0x80000406: remote_handle_open failed for halide_hexagon_remote
04-18 14:03:48.877  5712  5718 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/libhalide_hexagon_remote_skel.so
04-18 14:03:48.879  5712  5712 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:815: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for halide_hexagon_remote on domain 3 (dlerror signature verify start failed for libhalide_hexagon_remote_skel.so)
04-18 14:03:48.879  5712  5712 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:828: Error 0x80000406: remote_handle_open failed for halide_hexagon_remote
04-18 14:03:48.879  5712  5712 I halide  : Hexagon: remote_poll_log failed 44
04-18 14:03:48.879  5712  5712 I halide  : Error: Initialization of Hexagon kernels failed

and adb locgact | grep dsp says:

04-18 14:09:39.641  5836  5836 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:2030: fastrpc_apps_user_init done
04-18 14:09:39.643  5836  5836 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1683: Error 0xd: open_shell failed for domain 3
04-18 14:09:39.646  1005  1036 I cdsprpcd: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:722: Successfully opened file /vendor/dsp/cdsp/fastrpc_shell_3
04-18 14:09:39.668  5836  5836 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1815: Successfully created user PD on domain 3 (attrs 0x0, debug_trace 0x0)
04-18 14:09:39.668  5836  5836 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_perf.c:233: fastrpc_perf_init: enabled RPC traces (kernel 0, dsp 0) with frequency 1000
04-18 14:09:39.671  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/mod_table.c:655: open_mod_table_open_from_static: reverse module apps_std opened with handle 0x269b5088 (idx 0)
04-18 14:09:39.671  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/mod_table.c:655: open_mod_table_open_from_static: reverse module apps_std opened with handle 0x269b5088 (idx 1)
04-18 14:09:39.672  5836  5842 W test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:750: Warning: apps_std_fopen_with_env failed with 0xd for oemconfig.so (Permission denied)
04-18 14:09:39.672  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/libhalide_hexagon_remote_skel.so
04-18 14:09:39.672  1005  1036 W cdsprpcd: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:750: Warning: apps_std_fopen_with_env failed with 0x2 for oemconfig.so (No such file or directory)
04-18 14:09:39.674  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig-0xeb998f36.so
04-18 14:09:39.675  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig-0xeb998f36.so
04-18 14:09:39.676  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig-0xeb998f36.so
04-18 14:09:39.677  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig-0xeb998f36.so
04-18 14:09:39.679  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig.so
04-18 14:09:39.679  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig.so
04-18 14:09:39.681  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig.so
04-18 14:09:39.682  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/testsig.so
04-18 14:09:39.683  5836  5836 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:815: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for halide_hexagon_remote on domain 3 (dlerror _rtld_map_object_ex: cannot open oemconfig.so, errno 2 (no such file or directory))
04-18 14:09:39.683  5836  5836 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:828: Error 0x80000406: remote_handle_open failed for halide_hexagon_remote
04-18 14:09:39.686  5836  5842 I test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:741: Successfully opened file /data/local/tmp/blur/libhalide_hexagon_remote_skel.so
04-18 14:09:39.688  5836  5836 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:815: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for halide_hexagon_remote on domain 3 (dlerror signature verify start failed for libhalide_hexagon_remote_skel.so)
04-18 14:09:39.688  5836  5836 E test    : vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:828: Error 0x80000406: remote_handle_open failed for halide_hexagon_remote

I can sign the device to permit running all DSP libraries. The device is not rooted. I signed the device with the 4.5 Hexagon SDK. I presume the error is related to #3608 .

I decided to open a new ticket because the old ticket does not have a solution and I am not sure whether the same participants are still active.

Is there anything i can do to debug this issue further?

FabianSchuetze commented 5 months ago

@aankit-quic : Sorry to tag you, but I realize you are writing a lot of Hexagon related commits. Do you have an idea what I can do in the case above? I'd be grateful for some help.