I am trying to execute a model using QNN C++ api on htp backend following the SampleApp docs.
However, the documentation is quite confusing regarding which files must be placed where on the target, and after following the steps, my program exits silently with no errors, warnings, or logs.
Check the steps I follow and tell me if I am missing something.
Sdk versions and Host environment.
- On Ubuntu 22.04(x86_64) host
- Qairt
2.37.1.250807 - Hexagon_SDK
4.2.0.3
# set the evn vars and build for board on host
source ${QNN_SDK_ROOT}/bin/envsetup.sh
source ${HEXAGON_SDK_ROOT}/setup_sdk_env.source
cd ${QNN_SDK_ROOT}/examples/QNN/SampleApp/SampleApp
make hexagon V=v68
This builds libQnnSampleAppv68.so for htp backend.
<user> ls bin/hexagon/
libQnnSampleAppv68.so
Building the quantized serlialized binary model for board execution.
$QNN_SDK_ROOT/bin/x86_64-linux-clang/qnn-context-binary-generator \
--backend $QNN_SDK_ROOT/lib/x86_64-linux-clang/libQnnHtp.so \
--model $QNN_SDK_ROOT/examples/QNN/example_libs/x86_64-linux-clang/libqnn_model_8bit_quantized.so \
--binary_file qnn_model_8bit_quantized.serialized
This outputs the qnn_model_8bit_quantized.serialized.bin in output folder.
Files transferred to the board.
${HEXAGON_SDK_ROOT}/libs/run_main_on_hexagon/ship/ubuntu_aarch64/run_main_on_hexagonto/vendor/bin/${HEXAGON_SDK_ROOT}/libs/run_main_on_hexagon/ship/hexagon_toolv84_v68/librun_main_on_hexagon_skel.soto/vendor/lib/rfsa/adsp/${QNN_SDK_ROOT}/examples/QNN/SampleApp/SampleApp/bin/hexagon/libQnnSampleAppv68.so to/home/ubuntu/qnn-model`qnn_model_8bit_quantized.serialized.binto/home/ubuntu/qnn-modelinput_data_floatandinput_list_float.txtto/home/ubuntu/qnn-model
Now I ssh into the board for model execution and running the command below fails without any error logs or warnings.
cd /vendor/bin
echo $ADSP_LIBRARY_PATH
/home/ubuntu/2.37.1.250807/lib/hexagon-v/unsigned /vendor/lib/rfsa
echo $LD_LIBRARY_PATH
/usr/lib/aarch64-linux-gnu/ /usr/lib/
./run_main_on_hexagon 3 ~/qnn-model/libQnnSampleAppv68.so \
unsigned_pd=0 \
--backend $QNN_SDK_ROOT/lib/hexagon-v68/unsigned/libQnnHtpV68.so \
--system_library $QNN_SDK_ROOT/lib/hexagon-v68/unsigned/libQnnSystem.so \
--retrieve_context ~/qnn-model/qnn_model_8bit_quantized.serialized.bin \
--input_list ~/qnn-model/input_list_float.txt
See the logs with strace.
strace.txt (31.9 KB)
