# Tutorial: Running QNN on SA8797 QC Linux PVM (HTP and LPAI Backends) This tutorial covers QNN SDK usage on the SA8797 QC Linux PVM target for both the HTP and LPAI backends. SA8397 is also covered. | SoC | Hexagon SDK version | Tool version | Architecture / file directory | JSON Config `soc_id` | | --- | --- | --- | --- | --- | | SA8797, SA8397 | 6.4.0 | 19.0.4 | v81 | 72 | Note Due to an issue within the SA8797P.HGY.5.1.7.0/ES3.5 meta, the QNN HTPv81 MultiCore feature cannot be supported on that meta release. QNN SDK 2.41.0 and earlier versions support SA8797P.HGY.5.1.7.0.r1 up to ES5; otherwise use QNN SDK 2.42.0+ for all newer HGY meta releases (warning: mixing them will crash). - [HTP Backend](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#htp-backend) - [Converting Models for QNN HTP BE](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#converting-models-for-qnn-htp-be) - [Launching QNN HTP Dependencies on the QC Linux PVM Target](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#launching-qnn-htp-dependencies-on-the-qc-linux-pvm-target) - [Push Files onto QC Linux (PVM) Target](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#push-files-onto-qc-linux-pvm-target) - [Execute Neural Network using HTP](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#execute-neural-network-using-htp) - [LPAI Backend](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#lpai-backend) - [Converting Models for QNN LPAI BE](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#converting-models-for-qnn-lpai-be) - [Launching QNN LPAI Dependencies on the QC Linux PVM Target](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#launching-qnn-lpai-dependencies-on-the-qc-linux-pvm-target) - [Binary Signing](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#binary-signing) - [Host-Based QNN LPAI](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#host-based-qnn-lpai) - [DSP-Based QNN LPAI](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#dsp-based-qnn-lpai) ## [HTP Backend](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id1) ### [Converting Models for QNN HTP BE](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id2) Follow Tutorial #2: Running QNN HTP on SA-series up to the point where you have a `*.serialized.bin` context binary. For MultiCore support, see **Backend → Backend Specific Pages → HTP → Multicore** within the “Preparing graph offline for Multicore” section. ### [Launching QNN HTP Dependencies on the QC Linux PVM Target](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id3) The QNN HTP backend depends on a few external services. Please consult the metabuild release notes for more details. To check if FastRPC services are running: ps -x | grep fastrpc Copy to clipboard If the `fastrpc-rm` process is already running, no further action is required. If the `fastrpc-rm` process is **not** running by default, enable it with: ulimit -q unlimited fastrpc-rm & Copy to clipboard These steps must be repeated after each reboot. The FastRPC services must be running before attempting any QNN HTP backend use cases. ### [Push Files onto QC Linux (PVM) Target](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id4) 1. Execute `adb root && adb remount` for your target, then create directories: mkdir -p /data/local/tmp/lib mkdir -p /data/local/tmp/bin Copy to clipboard 2. Push the following binaries to your target: $ adb push ${QNN_SDK_ROOT}/lib/aarch64-oe-linux-gcc11.2/libQnnHtpV81Stub.so /data/local/tmp/lib $ adb push ${QNN_SDK_ROOT}/lib/aarch64-oe-linux-gcc11.2/libQnnHtp.so /data/local/tmp/lib $ adb push ${QNN_SDK_ROOT}/bin/aarch64-oe-linux-gcc11.2/qnn-net-run /data/local/tmp/bin $ adb push ${QNN_SDK_ROOT}/bin/aarch64-oe-linux-gcc11.2/qnn-profile-viewer /data/local/tmp/bin Copy to clipboard 3. Enable permissions for QNN binaries: $ chmod 777 /data/local/tmp/bin/qnn-net-run $ chmod 777 /data/local/tmp/bin/qnn-profile-viewer Copy to clipboard 4. Push the HTP skel binary to the target: $ adb push ${QNN_SDK_ROOT}/lib/hexagon-v81/unsigned/libQnnHtpV81Skel.so /data/local/tmp/lib Copy to clipboard 5. Push an input list and input images to `/data/local/tmp/bin`. 6. Push the `*.serialized.bin` (from the Convert Models step) to `/data/local/tmp/bin`. 7. Reset the target. ### [Execute Neural Network using HTP](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id5) After completing [Push Files onto QC Linux (PVM) Target](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#qclinux-htp-push): 1. Remount and set up the execution environment: mount -o rw,remount / adb root && adb remount # adb shell into the target: cd /data/local/tmp/bin export PATH=/data/local/tmp/bin:$PATH export VENDOR_LIB=/data/local/tmp/lib export LD_LIBRARY_PATH=$VENDOR_LIB:$LD_LIBRARY_PATH Copy to clipboard 2. Copy the skel library to the FastRPC search path: cp /data/local/tmp/lib/libQnnHtpV81Skel.so /usr/share/fastrpc Copy to clipboard 3. Execute `qnn-net-run`: $ ./qnn-net-run --backend libQnnHtp.so \ --input_list \ --retrieve_context Copy to clipboard For MultiCore support, see **Backend → Backend Specific Pages → HTP → Multicore**, “Preparing graph offline for Multicore referencing example for HTP Backend extension configuration”. ## [LPAI Backend](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id6) ### [Converting Models for QNN LPAI BE](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id7) Follow the SDK Documentation under **Backend → Backend Specific Pages → LPAI**. Set the hardware version environment variable: export HW_VER=v5_1 Copy to clipboard Use the following backend config for conversion: { "lpai_backend": { "target_env": "x86", "enable_hw_ver": "v5_1" }, "lpai_device": { "device_id": "0" } } Copy to clipboard { "backend_extensions": { "shared_library_path": "${QNN_SDK_ROOT}/lib/x86_64-linux-clang/libQnnLpaiNetRunExtentions.so", "config_file_path": "./lpaiParams.conf" } } Copy to clipboard ### [Launching QNN LPAI Dependencies on the QC Linux PVM Target](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id8) The QNN LPAI backend depends on a few external services. Please consult the metabuild release notes for more details. To check if FastRPC services are running: ps -x | grep fastrpc Copy to clipboard If the `fastrpc-rm` process is already running, no further action is required. If the `fastrpc-rm` process is **not** running by default, enable it with: ulimit -q unlimited fastrpc-rm & Copy to clipboard These steps must be repeated after each reboot. ### [Binary Signing](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id9) The following binaries must be signed to execute successfully. *Host-based QNN:* libQnnLpaiSkel.so Copy to clipboard *DSP-based QNN:* libQnnLpai.so libQnnLpaiNetRunExtensions.so libQnnHexagonSkel_dspApp.so libQnnNetRunDirectV81Skel.so Copy to clipboard ### [Host-Based QNN LPAI](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id10) **Push Files onto QC Linux (PVM) Target — Host-Based QNN** 1. Execute `adb root && adb remount` for your target, then create directories: mkdir -p /data/local/tmp/LPAI Copy to clipboard 2. Push the following binaries to your target: $ adb push ${QNN_SDK_ROOT}/lib/aarch64-oe-linux-gcc9.3/libQnnLpai.so /data/local/tmp/lib/LPAI $ adb push ${QNN_SDK_ROOT}/lib/aarch64-oe-linux-gcc9.3/libQnnLpaiStub.so /data/local/tmp/lib/LPAI $ adb push ${QNN_SDK_ROOT}/lib/aarch64-oe-linux-gcc9.3/libQnnLpaiNetRunExtensions.so /data/local/tmp/lib/LPAI $ adb push ${QNN_SDK_ROOT}/bin/aarch64-oe-linux-gcc9.3/qnn-net-run /data/local/tmp/bin/LPAI Copy to clipboard 3. Enable permissions for QNN binaries: $ chmod 777 /data/local/tmp/bin/LPAI/qnn-net-run Copy to clipboard 4. Push the LPAI skel binary to the target: $ adb push ${QNN_SDK_ROOT}/lib/lpai-v5_1/unsigned/libQnnLpaiSkel.so /data/local/tmp/lib/LPAI Copy to clipboard 5. Push an input list and input images to `/data/local/tmp/bin/LPAI`. 6. Push the `*.serialized.bin` (from the Convert Models step) to `/data/local/tmp/bin/LPAI`. 7. Reset the target. **Execute Neural Network using LPAI (Host-Based)** After completing qclinux-lpai-host-push: 1. Remount and set up the execution environment: mount -o rw,remount / adb root && adb remount # adb shell into the target: cd /data/local/tmp/LPAI export LD_LIBRARY_PATH=/data/local/tmp/LPAI:/data/local/tmp/LPAI/adsp export ADSP_LIBRARY_PATH="/data/local/tmp/LPAI/adsp" Copy to clipboard 2. Execute `qnn-net-run`: $ ./qnn-net-run --backend libQnnLpai.so \ --device_options device_id:0 \ --input_list \ --retrieve_context Copy to clipboard ### [DSP-Based QNN LPAI](https://docs.qualcomm.com/doc/80-63442-10/topic/htp_auto_qclinux.html#id11) **Push Files onto QC Linux (PVM) Target — DSP-Based QNN** 1. Execute `adb root && adb remount` for your target, then create directories: mkdir -p /data/local/tmp/LPAI Copy to clipboard 2. Push the following binaries to your target: $ adb push ${QNN_SDK_ROOT}/lib/lpai-v5_1/unsigned/libQnnLpaiNetRunExtensions.so /data/local/tmp/lib/LPAI $ adb push ${QNN_SDK_ROOT}/bin/hexagon-v81/unsigned/libQnnHexagonSkel_app.so /data/local/tmp/bin/LPAI $ adb push ${QNN_SDK_ROOT}/bin/aarch64-oe-linux-gcc9.3/qnn-net-run /data/local/tmp/bin/LPAI $ adb push ${QNN_SDK_ROOT}/bin/hexagon-v81/unsigned/libQnnNetRunDirectV81Skel.so /data/local/tmp/bin/LPAI $ adb push ${QNN_SDK_ROOT}/lib/hexagon-v81/unsigned/libQnnNetRunDirectV81Stub.so /data/local/tmp/bin/LPAI Copy to clipboard 3. Enable permissions for QNN binaries: $ chmod 777 /data/local/tmp/bin/LPAI/qnn-net-run Copy to clipboard 4. Push the LPAI backend binary to the target: $ adb push ${QNN_SDK_ROOT}/lib/lpai-v5_1/unsigned/libQnnLpai.so /data/local/tmp/lib/LPAI Copy to clipboard 5. Push an input list and input images to `/data/local/tmp/bin/LPAI`. 6. Push the `*.serialized.bin` (from the Convert Models step) to `/data/local/tmp/bin/LPAI`. 7. Reset the target. **Execute Neural Network using LPAI (DSP-Based)** After completing qclinux-lpai-dsp-push: 1. Remount and set up the execution environment: mount -o rw,remount / adb root && adb remount # adb shell into the target: cd /data/local/tmp/LPAI export LD_LIBRARY_PATH=/data/local/tmp/LPAI:/data/local/tmp/LPAI/adsp export ADSP_LIBRARY_PATH="/data/local/tmp/LPAI/adsp" Copy to clipboard 2. Prepare `config.json` for direct mode (`is_persistent_binary` is required): { "backend_extensions": { "shared_library_path": "/data/local/tmp/LPAI/libQnnLpaiNetRunExtentions.so", "config_file_path": "./lpaiParams.conf" }, "context_configs": { "is_persistent_binary": true } } Copy to clipboard 3. Execute `qnn-net-run`: $ ./qnn-net-run --backend libQnnLpai.so \ --direct_mode \ --input_list \ --retrieve_context \ --config_file Copy to clipboard Last Published: Aug 06, 2026 [Previous Topic Tutorial: GPU Backend on SA-series — LV (GVM or PVM)](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/lv_gvm.md) [Next Topic Tutorial: Running QNN HTP on x86 Using QEMU Emulation](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/htp_auto_qemu.md)