run qnn-net-run in android app
Join Date: 24 Apr 24
Posts: 3
Posted: Wed, 2024-04-24 05:44
I call qnn-net-run from the shell command in the android app:
II used android studio create an android project that can call c++ code through jni. I use std::system(char *cmd) function execute command,
but I got the following error:
normalize_path - invalid input: "$/data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd", the input path should be absolute
The full command is:
std::string cmd = "sh -c \"export LD_LIBRARY_PATH=/data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd && export ADSP_LIBRARY_PATH=/data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd && /data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd/qnn-net-run --retrieve_context /data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd/text_encoder_888.serialized.bin --backend /data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd/libQnnHtp.so --input_list /data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd/input_list.txt --output_dir /data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd/outputs --config_file /data/user/0/com.meishe.testandroidqt/files/QNN_binaries_ori_sd/htp_config_888.json --log_level verbose\"";
std::system(cmd.c_str());
I Would like to ask the engineers, in the android app through the command line to call qnn-net-run this way is feasible? How to solve this problem? Why is there a $ in front of the path?
The directory structure of my files in the sandbox is shown below: