Hexagon_rpc_open failed

I tried to run the test_launcher.py using pytest on the Hexagon DSP. However, this error is preventing me from going forward:

Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "/home/osboxes/tvm/python/tvm/rpc/client.py", line 524, in connect
    sess = _ffi_api.Connect(url, port, key, enable_logging, *session_constructor_args)
  File "/home/osboxes/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 238, in __call__
    raise get_last_ffi_error()
tvm.error.RPCError: Traceback (most recent call last):
  8: TVMFuncCall
  7: tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#1}> >::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)
  6: tvm::runtime::RPCClientConnect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, tvm::runtime::TVMArgs)
  5: tvm::runtime::RPCConnect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, tvm::runtime::TVMArgs)
  4: tvm::runtime::RPCEndpoint::InitRemoteSession(tvm::runtime::TVMArgs)
  3: tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::function<void (tvm::runtime::TVMArgs)>)
  2: tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::function<void (tvm::runtime::TVMArgs)>)
  1: tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::function<void (tvm::runtime::TVMArgs)>)
  0: tvm::runtime::RPCEndpoint::EventHandler::HandleReturn(tvm::runtime::RPCCode, std::function<void (tvm::runtime::TVMArgs)>)
  [bt] (8) ./tvm_rpc_android(+0x1a3d4) [0x556727c3d4]
  [bt] (7) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCServerLoop(int)+0xb4) [0x7f977b98f4]
  [bt] (6) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::ServerLoop()+0xe8) [0x7f9779ae38]
  [bt] (5) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::function<void (tvm::runtime::TVMArgs)>)+0x124) [0x7f9779a6fc]
  [bt] (4) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::function<void (tvm::runtime::TVMArgs)>)+0x154) [0x7f977a50ec]
  [bt] (3) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::function<void (tvm::runtime::TVMArgs)>)+0x1c4) [0x7f977a4edc]
  [bt] (2) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::EventHandler::HandleInitServer()+0xb8c) [0x7f977a4234]
  [bt] (1) ./tvm_rpc_android(tvm::runtime::detail::LogFatal::Entry::Finalize()+0x88) [0x556726f5b0]
  [bt] (0) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::Backtrace[abi:cxx11]()+0x30) [0x7f97716d30]
  [bt] (8) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::ServerLoop()+0xe8) [0x7f9779ae38]
  [bt] (7) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::function<void (tvm::runtime::TVMArgs)>)+0x124) [0x7f9779a6fc]
  [bt] (6) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::EventHandler::HandleNextEvent(bool, bool, std::function<void (tvm::runtime::TVMArgs)>)+0x154) [0x7f977a50ec]
  [bt] (5) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::EventHandler::HandleProcessPacket(std::function<void (tvm::runtime::TVMArgs)>)+0x1c4) [0x7f977a4edc]
  [bt] (4) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::RPCEndpoint::EventHandler::HandleInitServer()+0x1b4) [0x7f977a385c]
  [bt] (3) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(+0x186578) [0x7f977fa578]
  [bt] (2) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(+0x186178) [0x7f977fa178]
  [bt] (1) ./tvm_rpc_android(tvm::runtime::detail::LogFatal::Entry::Finalize()+0x88) [0x556726f5b0]
  [bt] (0) /data/local/tmp/hexagon_test/2023-06-13T09-53-07-kxwxwmwsge/libtvm_runtime.so(tvm::runtime::Backtrace[abi:cxx11]()+0x30) [0x7f97716d30]
  File "/home/osboxes/tvm/src/runtime/rpc/rpc_endpoint.cc", line 376
RPCError: Error caught from RPC call:
[16:30:11] /home/osboxes/tvm/src/runtime/rpc/rpc_endpoint.cc:529: Server[SockServerLoop]: Error caught from session constructor tvm.contrib.hexagon.create_hexagon_session:
[16:30:11] /home/osboxes/tvm/src/runtime/hexagon/rpc/android/session.cc:56: 
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
  Check failed: (rc == AEE_SUCCESS) is false: hexagon_rpc_open failed. URI: file:///libhexagon_rpc_skel.so?hexagon_rpc_skel_handle_invoke&_modver=1.0&_dom=cdsp

Any guess on how to fix this?

@kparzysz

Could you connect to the device with mini-dm (it’s in the Hexagon SDK) and see what messages are printed? This tool will show diagnostic messages from Hexagon (in real time, so have it running when you run your TVM code), and they usually contain clues as to what went wrong.

Thanks a lot for the answer @kparzysz . I tried running mini-dm, but it shows the following error:

QUTS is not installed. Exiting...

I cannot find any information about QUTS and how it should be installed.

@kparzysz Icouldn’t run the latest version of mini-dm due to the QUTS not installed. So, I decided to switch to the deprecated mini-dm. It connected to the device but didn’t print any log. I used logcat instead and now I see some errors:

--------- beginning of main
06-15 09:04:55.615  2848  2848 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/fastrpc_apps_user.c:2329: fastrpc_apps_user_init done
06-15 09:04:55.717  2851  2851 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/fastrpc_apps_user.c:1960: Successfully opened fastrpc_shell_unsigned_3
06-15 09:04:55.740  2851  2851 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/fastrpc_apps_user.c:2111: Successfully created user PD on domain 3 (attrs 0x8, debug_trace 0x0)
06-15 09:04:55.742  2851  2852 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/fastrpc_apps_user.c:392: Successfully set remote user thread priority to 192 and stack size to 262144
06-15 09:04:55.743  2851  2851 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/fastrpc_perf.c:233: fastrpc_perf_init: enabled RPC traces (kernel 0, dsp 0) with frequency 1000
06-15 09:04:55.746  2851  2852 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/apps_std_imp.c:770: Successfully opened file /data/local/tmp/hexagon_test/2023-06-15T03-04-36-kbmevdihnp/libhexagon_rpc_skel.so
06-15 09:04:55.750  2851  2853 E tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/log_config.c:184:Found tvm_rpc_android.farf. adspmsgd enabled 
06-15 09:04:55.750  2851  2854 V adsprpc : HAP_utils.c:303:0xa0e6:13: Logging mask set to 30
06-15 09:04:55.766  2851  2852 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/apps_std_imp.c:770: Successfully opened file /usr/lib/rfsa/adsp/libc++.so.1
06-15 09:04:55.775  2851  2852 I tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/apps_std_imp.c:770: Successfully opened file /usr/lib/rfsa/adsp/libc++abi.so.1
06-15 09:04:55.786  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.786  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.788  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.788  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.788  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.793  2851  2854 V adsprpc : symbol.c:350:0xa0e7:13: undefined symbol PLT  #731 posix_memalign in ./libhexagon_rpc_skel.so
06-15 09:04:55.793  2851  2854 V adsprpc : mdreloc.c:274:0xa0e7:13: plt object relocation failure
06-15 09:04:55.796  2851  2854 V adsprpc : symbol.c:350:0xa0e7:13: undefined symbol PLT  #1049 qurt_sleep in ./libhexagon_rpc_skel.so
06-15 09:04:55.796  2851  2854 V adsprpc : mdreloc.c:274:0xa0e7:13: plt object relocation failure
06-15 09:04:55.798  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.798  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.798  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.798  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.798  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.799  2851  2854 V adsprpc : rtld.c:1292:0xa0e7:13: RX VA 0xFFF00000 outside ELF segment
06-15 09:04:55.803  2851  2854 V adsprpc : rtld.c:859:0xa0e7:13: Error: dlopen_ex failed for libhexagon_rpc_skel.so (flags 258)
06-15 09:04:55.810  2851  2854 V adsprpc : mod_table.c:541:0xa0e7:13: Error 0x80000406: open_mod_table_open_dynamic failed for file:///libhexagon_rpc_skel.so?hexagon_rpc_skel_handle_invoke&_modver=1.0&_dom=cdsp
06-15 09:04:55.810  2851  2854 V adsprpc : mod_table.c:568:0xa0e7:13: Error: open_mod_table_open_dynamic: failed to load libhexagon_rpc_skel.so, resetting default vote as no other modules loaded
06-15 09:04:55.811  2851  2851 E tvm_rpc_android: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-ubuntu-fullstack-perf/tmp-glibc/work/qrb5165_rb5-oe-linux/adsprpc/git-r1/adsprpc/src/fastrpc_apps_user.c:991: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for file:///libhexagon_rpc_skel.so?hexagon_rpc_skel_handle_invoke&_modver=1.0&_dom=cdsp on domain 3 (dlerror RX VA 0xFFF00000 outside ELF segment)

It seems that libhexagon_rpc_skel.so cannot find the following symbols:

  1. posix_memalign
  2. qurt_sleep

Someone else also had a similar issue, but it seems the problem still exists:

In older versions of the SDK the function posix_memalign was not present in the libraries. Initially, we added our own implementation. See commit 02d3a59b962cfce9dc9200d530f0f5ca62181076, file src/runtime/hexagon/hexagon_posix.cc.

You can similarly provide your own qurt_sleep that does nothing. Here’s the header:

void qurt_sleep (unsigned long long int duration);

I met a very similar problem, almost every step same to [Hexagon] Error opening FastRPC channel - #9 by lvsss, while set -DTVM_LOG_CUSTOMIZE=1 in hexagon_launcher/cmake/hexagon/CMakeLists.txt can’t solve the problem. Using last commit with id 7767de9c39a724df6ca4f2bf028630d99f3ee746, hardware snapdragon 870 without root permission.

Could you give some advice? Here’s the adb log.

 06-16 20:32:10.666 12530 12530 W launcher_androi: type=1400 audit(0.0:5023663): avc: denied { search } for name="nativetest" dev="dm-42" ino=9 scontext=u:r:shell:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=dir permissive=0
    06-16 20:32:10.666 12530 12530 W launcher_androi: type=1400 audit(0.0:5023664): avc: denied { search } for name="nativetest64" dev="dm-42" ino=10 scontext=u:r:shell:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=dir permissive=0
    06-16 20:32:10.666 12530 12530 W launcher_androi: type=1400 audit(0.0:5023665): avc: denied { search } for name="nativetest" dev="dm-42" ino=9 scontext=u:r:shell:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=dir permissive=0
    06-16 20:32:10.666 12530 12530 W launcher_androi: type=1400 audit(0.0:5023666): avc: denied { search } for name="nativetest64" dev="dm-42" ino=10 scontext=u:r:shell:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=dir permissive=0
    06-16 20:32:10.666 12530 12530 W launcher_androi: type=1400 audit(0.0:5023667): avc: denied { search } for name="nativetest" dev="dm-42" ino=9 scontext=u:r:shell:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=dir permissive=0
    06-16 20:32:10.666 12530 12530 W launcher_androi: type=1400 audit(0.0:5023668): avc: denied { search } for name="nativetest64" dev="dm-42" ino=10 scontext=u:r:shell:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=dir permissive=0
    06-16 20:32:10.692 12530 12530 I launcher_android: vendor/qcom/proprietary/adsprpc/src/rpcmem_android.c:159: rpcmem_init_internal: opened ION device fd 3, configured heap IDs: system (0x2000000), contig (0x400000), secure (0x200), secure flags (0x80080000)
    06-16 20:32:10.692 12530 12530 I launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:3061: fastrpc_apps_user_init done with default domain:3 and &fastrpc_trace:0x755358cfa0
    06-16 20:32:10.693 12530 12530 I launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:2015: remote_session_control DSP info request for domain 3, thread priority -1, stack size 131072
    06-16 20:32:10.693 12530 12530 E launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:2631: Error 0xd: open_shell failed for domain 3 search paths used are /dsp/, /vendor/dsp/, /vendor/dsp/xdsp/ (errno Permission denied)
    06-16 20:32:10.693 12530 12530 I launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_config.c:200: Reading configuration file: launcher_android.debugconfig
    06-16 20:32:10.686 12530 12530 W launcher_androi: type=1400 audit(0.0:5023669): avc: denied { read } for name="adsprpc-smd-secure" dev="tmpfs" ino=11370 scontext=u:r:shell:s0 tcontext=u:object_r:vendor_xdsp_device:s0 tclass=chr_file permissive=0
    06-16 20:32:10.686 12530 12530 W launcher_androi: type=1400 audit(0.0:5023670): avc: denied { search } for name="/" dev="sde10" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:adsprpcd_file:s0 tclass=dir permissive=0
    06-16 20:32:10.686 12530 12530 W launcher_androi: type=1400 audit(0.0:5023671): avc: denied { search } for name="/" dev="sde10" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:adsprpcd_file:s0 tclass=dir permissive=0
    06-16 20:32:10.696  1787  1800 I cdsprpcd: vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:848: Successfully opened file /vendor/dsp/cdsp/fastrpc_shell_unsigned_3
    06-16 20:32:10.719 12530 12530 I launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:2819: Created user PD on domain 3 (attrs 0x8, debug_trace 0x0)
    06-16 20:32:10.721 12530 12532 I launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:475: Successfully set remote user thread priority to 192 and stack size to 131072 for domain 3
    06-16 20:32:10.722 12530 12532 I launcher_android: vendor/qcom/proprietary/adsprpc/src/listener_android.c:111: listener thread starting
    06-16 20:32:10.722 12530 12530 I launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_perf.c:273: fastrpc_perf_init: enabled systrace 0x0 and RPC traces (kernel 0, dsp 0) with frequency 1000
    06-16 20:32:10.722 12530 12533 I launcher_android: vendor/qcom/proprietary/adsprpc/src/log_config.c:345: file_watcher_thread starting for domain 3
    06-16 20:32:10.723 12530 12533 E launcher_android: vendor/qcom/proprietary/adsprpc/src/log_config.c:268:Error 0x200: fopen failed for /data/local/tmp/dsp/launcher_android.farf. (No such file or directory)
    06-16 20:32:10.723 12530 12533 E launcher_android: vendor/qcom/proprietary/adsprpc/src/log_config.c:268:Error 0x200: fopen failed for /vendor/lib/rfsa/adsp/launcher_android.farf. (No such file or directory)
    06-16 20:32:10.724 12530 12532 I launcher_android: vendor/qcom/proprietary/adsprpc/src/mod_table.c:687: open_mod_table_open_from_static: reverse module apps_std opened with handle 0x5358f9e8 (idx 0)
    06-16 20:32:10.724 12530 12532 I launcher_android: vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:868: Successfully opened file /data/local/tmp/dsp/liblauncher_rpc_skel.so
    06-16 20:32:10.725 12530 12532 I launcher_android: vendor/qcom/proprietary/adsprpc/src/mod_table.c:687: open_mod_table_open_from_static: reverse module apps_mem opened with handle 0x5358fae8 (idx 1)
    06-16 20:32:10.743 12530 12532 I launcher_android: vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:868: Successfully opened file /data/local/tmp/dsp/libc++.so.1
    06-16 20:32:10.754 12530 12532 I launcher_android: vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:868: Successfully opened file /data/local/tmp/dsp/libc++abi.so.1
    06-16 20:32:10.756 26960 27362 I SmartThreadExecutor: handleMessage: start check 0
    06-16 20:32:10.756 26960 27362 I SmartThreadExecutor: handleMessage: check end 0 -135 false
    06-16 20:32:10.774 12530 12530 E launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1316: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for file:///liblauncher_rpc_skel.so?launcher_rpc_skel_handle_invoke&_modver=1.0&_dom=cdsp on domain 3 (dlerror RX VA 0xFFF00000 outside ELF segment) (errno Success)
    06-16 20:32:10.774 12530 12530 E launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1380: Error 0x80000406: remote_handle64_open failed for file:///liblauncher_rpc_skel.so?launcher_rpc_skel_handle_invoke&_modver=1.0&_dom=cdsp (errno Success)

There seem to be some missing files:

06-16 20:32:10.723 12530 12533 E launcher_android: vendor/qcom/proprietary/adsprpc/src/log_config.c:268:Error 0x200: fopen failed for /data/local/tmp/dsp/launcher_android.farf. (No such file or directory)
06-16 20:32:10.723 12530 12533 E launcher_android: vendor/qcom/proprietary/adsprpc/src/log_config.c:268:Error 0x200: fopen failed for /vendor/lib/rfsa/adsp/launcher_android.farf. (No such file or directory)

and also permission issue:

6-16 20:32:10.693 12530 12530 E launcher_android: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:2631: Error 0xd: open_shell failed for domain 3 search paths used are /dsp/, /vendor/dsp/, /vendor/dsp/xdsp/ (errno Permission denied)

Anyway, in my case, running mini-dm helped me better to find out the real problem. Try running that and send here the errors.

Changing to memalign didn’t solve the problem, as it seems that the current libc++.so on my QRB5165 already contains the posix_memalign. See below:

$ readelf -a /usr/lib/rfsa/adsp/libc++.so.1 | grep memalign
000875cc  00034022 unrecognized: 22      00000000   posix_memalign + 0
   832: 00000000     0 FUNC    GLOBAL DEFAULT  UND posix_memalign
   860: 00000000     0 FUNC    GLOBAL DEFAULT  UND posix_memalign

Since posix_memalign is actually implemented in libc.so, I added the path to libc.so in Hexagon/5.3.0.0/tools/HEXAGON_Tools/8.6.06/Tools/target/hexagon/lib/v68/G0/pic to ADSP_LIBRARY_PATH but it still cannot find posix_memalign. Any guess how to fix this?

I’m now wondering if TVM can support QRB5165 at all. The feature matrix in Hexagon SDK doc mentions that QRB5165 support v66, but TVM needs v68 and above due to the dma instructions.

The posix_memalign should be defined in the fast rpc shell. If you’re using unsigned PD, the shell is /vendor/dsp/cdsp/fastrpc_shell_unsigned_3, otherwise it’s /vendor/dsp/cdsp/fastrpc_shell_3. The shell is the process that loads the skel library, and it has the libc symbols linked into it.

BTW, the ADSP_LIBRARY_PATH variable contains paths on the device, adding a path that’s on the host won’t have any effect.

We currently focus on supporting v68 and later and only run tests on v68+. For targeting v66, the USE_HEXAGON_QHL should be set to FALSE, and the UserDMA code should be replaced with memcpy. In any case, even without any of these changes you should at least get a run time crash (due to an invalid instruction), not an unresolved symbol. Let me know if posix_memalign is defined in the fastrpc shell.

Thanks for your prompt reply! I got such error message by setting launcher_android.farf and using adb logcat -s adsprpc command .

06-17 00:40:12.392 18236 18239 V adsprpc : mod_table.c:823:0x30db:12: Error 0x80000414: open_mod_table_handle_invoke failed for handle 0x4, sc 0x8020000
06-17 00:40:12.393 18236 18239 V adsprpc : HAP_utils.c:303:0x30db:12: Logging mask set to 31
06-17 00:40:12.436 18236 18239 V adsprpc : rtld.c:1292:0x60dc:12: RX VA 0xFFF00000 outside ELF segment
06-17 00:40:12.436 18236 18239 V adsprpc : rtld.c:1292:0x60dc:12: RX VA 0xFFF00000 outside ELF segment
06-17 00:40:12.437 18236 18239 V adsprpc : symbol.c:350:0x60dc:12: undefined symbol   #1471 _ZN3tvm7runtime6detail10LogMessage14level_strings_E in ./liblauncher_rpc_skel.so
06-17 00:40:12.437 18236 18239 V adsprpc : rtld.c:859:0x60dc:12: Error: dlopen_ex failed for liblauncher_rpc_skel.so (flags 258)
06-17 00:40:12.442 18236 18239 V adsprpc : mod_table.c:541:0x60dc:12: Error 0x80000406: open_mod_table_open_dynamic failed for file:///liblauncher_rpc_skel.so?launcher_rpc_skel_handle_invoke&_modver=1.0&_dom=cdsp
06-17 00:40:12.442 18236 18239 V adsprpc : mod_table.c:568:0x60dc:12: Error: open_mod_table_open_dynamic: failed to load liblauncher_rpc_skel.so, resetting default vote as no other modules loaded

Looks like the symbol definition for tvmruntime_detail_LogMessage_level_strings is missing, similar to the case at [Hexagon] Error opening FastRPC channel - #6 by lvsss, but the missing symbol is different. Do you have any idea about this missing symbol?

Hi again, Sorry for the long delay. fastrpc_shell_3 is in /dsp/cdsp on my device. However, there is no sign of posix_memalign:

readelf -a /dsp/cdsp/fastrpc_shell_unsigned_3 | grep memalign
   118: 00075f64     4 FUNC    GLOBAL DEFAULT    7 memalign_int
   875: 000764d0     8 FUNC    GLOBAL DEFAULT    7 rpc_memalign
  1542: 00077960     8 FUNC    GLOBAL DEFAULT    7 memalign_llc
  1767: 00076e74   740 FUNC    GLOBAL DEFAULT    7 __wrap_memalign
  3286: 0002ebc0     4 FUNC    GLOBAL DEFAULT    7 qurt_memalign
  3299: 0007a170   608 FUNC    GLOBAL DEFAULT    7 fastrpc_mem_memalign
  1273: 0002ebc0     4 FUNC    GLOBAL DEFAULT    7 qurt_memalign
  3206: 00075f64     4 FUNC    GLOBAL DEFAULT    7 memalign_int
  3211: 000764d0     8 FUNC    GLOBAL DEFAULT    7 rpc_memalign
  3216: 00076e74   740 FUNC    GLOBAL DEFAULT    7 __wrap_memalign
  3226: 00077960     8 FUNC    GLOBAL DEFAULT    7 memalign_llc
  3242: 0007a170   608 FUNC    GLOBAL DEFAULT    7 fastrpc_mem_memalign

hi, @8bitpd , May I ask if have you solved this issue?