Forums - run qnn-net-run in android app

3 posts / 0 new
Last post
run qnn-net-run in android app
516288725
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?
  • Up0
  • Down0
516288725
Join Date: 24 Apr 24
Posts: 3
Posted: Wed, 2024-04-24 05:45
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?
  • Up0
  • Down0
516288725
Join Date: 24 Apr 24
Posts: 3
Posted: Wed, 2024-04-24 05:46

The directory structure of my files in the sandbox is shown below:

  • 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.