Skip to content

Commit 8f50849

Browse files
authored
Qualcomm AI Engine Direct - [doc] QNN ExecuTorch on Windows (pytorch#22502)
### Summary - Add documentation for QNN ExecuTorch on Windows, including build, test, and inference instructions. - Add support for the `SC8380XP` SoC model. Refer to the [Supported Snapdragon devices](https://docs.qualcomm.com/doc/80-63442-10/topic/QNN_general_overview.html#supported-snapdragon-devices) for details. ### Test plan ```powershell python -m examples.qualcomm.scripts.deeplab_v3 --build_folder build-x86_64-windows --soc_model SC8380XP --compile_only --download ```
1 parent 135a109 commit 8f50849

4 files changed

Lines changed: 184 additions & 57 deletions

File tree

‎backends/qualcomm/serialization/qc_compiler_spec.fbs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ enum QcomChipset: int {
4747
UNKNOWN_SM = 0,
4848
SA8295 = 39,
4949
SA8797 = 72,
50+
SC8380XP = 60,
5051
SM8350 = 30,
5152
SM8450 = 36,
5253
SM8475 = 42,

‎backends/qualcomm/serialization/qc_schema.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class QcomChipset(IntEnum):
5454
UNKNOWN_SM = 0
5555
SA8295 = 39 # v68
5656
SA8797 = 72 # v81
57+
SC8380XP = 60 # v73
5758
SM8350 = 30 # v68
5859
SM8450 = 36 # v69
5960
SM8475 = 42 # v69
@@ -84,6 +85,7 @@ class SocInfo:
8485
_soc_info_table = {
8586
QcomChipset.SA8295: SocInfo(QcomChipset.SA8295, HtpInfo(HtpArch.V68, 8)),
8687
QcomChipset.SA8797: SocInfo(QcomChipset.SA8797, HtpInfo(HtpArch.V81, 16)),
88+
QcomChipset.SC8380XP: SocInfo(QcomChipset.SC8380XP, HtpInfo(HtpArch.V73, 8)),
8789
QcomChipset.SM8350: SocInfo(QcomChipset.SM8350, HtpInfo(HtpArch.V68, 4)),
8890
QcomChipset.SM8450: SocInfo(QcomChipset.SM8450, HtpInfo(HtpArch.V69, 8)),
8991
QcomChipset.SM8475: SocInfo(QcomChipset.SM8475, HtpInfo(HtpArch.V69, 8)),

‎backends/qualcomm/utils/utils.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,7 @@ def get_soc_to_htp_arch_map():
13221322
return {
13231323
"SA8295": HtpArch.V68,
13241324
"SA8797": HtpArch.V81,
1325+
"SC8380XP": HtpArch.V73,
13251326
"SM8350": HtpArch.V68,
13261327
"SM8450": HtpArch.V69,
13271328
"SM8475": HtpArch.V69,
@@ -1355,6 +1356,7 @@ def get_soc_to_chipset_map():
13551356
return {
13561357
"SA8295": QcomChipset.SA8295,
13571358
"SA8797": QcomChipset.SA8797,
1359+
"SC8380XP": QcomChipset.SC8380XP,
13581360
"SM8350": QcomChipset.SM8350,
13591361
"SM8450": QcomChipset.SM8450,
13601362
"SM8475": QcomChipset.SM8475,

‎docs/source/backends-qualcomm.md‎

Lines changed: 179 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,24 @@ Currently, this ExecuTorch Backend can delegate AI computations to Hexagon proce
3636

3737
### Host OS
3838

39-
The QNN Backend is currently verified on the following Linux host operating systems:
39+
The QNN Backend is verified on the following host operating systems:
4040

4141
- **Ubuntu 22.04 LTS (x64)**
4242
- **CentOS Stream 9**
43+
- **Windows 10 / 11 (x64)**
44+
- **Windows 10 / 11 (ARM64)** with Qualcomm NPU
4345
- **Windows Subsystem for Linux (WSL)** with Ubuntu 22.04
4446

4547
In general, we verify the backend on the same OS versions that the QNN SDK is officially validated against.
4648
The exact supported versions are documented in the QNN SDK.
4749

50+
#### Windows (x64 / ARM64) Setup
51+
52+
To build on native Windows platforms, the MSVC toolchain must be installed.
53+
The required MSVC Build Tools can be installed through **Visual Studio Installer**.
54+
55+
For installation instructions, refer to the official [Microsoft Visual Studio Downloads page](https://visualstudio.microsoft.com/downloads/).
56+
4857
#### Windows (WSL) Setup
4958

5059
To install Ubuntu 22.04 on WSL, run the following command in PowerShell or Windows Terminal:
@@ -55,24 +64,23 @@ wsl --install -d ubuntu 22.04
5564

5665
This command will install WSL and set up Ubuntu 22.04 as the default Linux distribution.
5766

58-
For more details and troubleshooting, refer to the official Microsoft WSL installation guide:
59-
👉 [Install WSL | Microsoft Learn](https://learn.microsoft.com/en-us/windows/wsl/install)
67+
For more details and troubleshooting, refer to the official Microsoft WSL installation guide: [Install WSL | Microsoft Learn](https://learn.microsoft.com/en-us/windows/wsl/install).
6068

6169
### Hardware:
62-
You will need an Android / Linux device with adb-connected running on one of Qualcomm SoCs listed in `QcomChipset`. Please navigate to [qc_schema.py](https://github.com/pytorch/executorch/blob/main/backends/qualcomm/serialization/qc_schema.py).
6370

64-
This example is verified with SM8550 and SM8450.
71+
The QNN backend runs on Qualcomm SoCs (Systems on Chips) across two device families:
72+
73+
- **Android / Linux devices** — connected over `adb`. This example is verified with SM8550 and SM8450.
74+
- **Windows on ARM64 (WoA) devices** — This example is verified with SC8380XP (Qualcomm Snapdragon X Elite).
75+
76+
The target SoC must be one of those listed in the `QcomChipset` enum; see [qc_schema.py](https://github.com/pytorch/executorch/blob/main/backends/qualcomm/serialization/qc_schema.py).
6577

6678
### Software:
6779

68-
- Follow ExecuTorch recommended Python version.
69-
- A compiler to compile AOT parts, e.g., the GCC compiler comes with Ubuntu LTS. g++ version need to be 13 or higher.
70-
- [Android NDK](https://developer.android.com/ndk). This example is verified with NDK 26c.
71-
- (Optional) Target toolchain for linux embedded platform.
72-
- [Qualcomm AI Engine Direct SDK](https://developer.qualcomm.com/software/qualcomm-ai-engine-direct-sdk)
73-
- Click the "Get Software" button to download the latest version of the QNN SDK.
74-
- Although newer versions are available, we have verified and recommend using QNN 2.37.0 for stability.
75-
- You can download it directly from the following link: [QNN 2.37.0](https://softwarecenter.qualcomm.com/api/download/software/sdks/Qualcomm_AI_Runtime_Community/All/2.37.0.250724/v2.37.0.250724.zip)
80+
[Qualcomm AI Engine Direct SDK](https://developer.qualcomm.com/software/qualcomm-ai-engine-direct-sdk)
81+
- Click the "Get Software" button to download the latest version of the QNN SDK.
82+
- Although newer versions are available, we have verified and recommend using QNN 2.37.0 for stability.
83+
- You can download it directly from the following link: [QNN 2.37.0](https://softwarecenter.qualcomm.com/api/download/software/sdks/Qualcomm_AI_Runtime_Community/All/2.37.0.250724/v2.37.0.250724.zip)
7684

7785
The directory with installed Qualcomm AI Engine Direct SDK looks like:
7886
```
@@ -94,6 +102,18 @@ The directory with installed Qualcomm AI Engine Direct SDK looks like:
94102
└── share
95103
```
96104

105+
On Android / Linux devices:
106+
107+
- Follow ExecuTorch recommended Python version.
108+
- A compiler to compile AOT parts, e.g., the GCC compiler comes with Ubuntu LTS. g++ version need to be 13 or higher.
109+
- [Android NDK](https://developer.android.com/ndk). This example is verified with NDK 26c.
110+
- (Optional) Target toolchain for linux embedded platform.
111+
112+
On Windows on ARM64 (WoA) devices:
113+
114+
- Install the **AMD64 version of Python** to run AOT compilation under x64 emulation. This is required because certain Python modules used in the AOT workflow do not currently provide ARM64 prebuilt wheels.
115+
- MSVC Build Tools.
116+
97117

98118
## Setting up your developer environment
99119

@@ -106,87 +126,113 @@ i.e., the directory containing `QNN_README.txt`.
106126

107127
`$EXECUTORCH_ROOT` refers to the root of executorch git repository.
108128

109-
### Setup environment variables
129+
### Setup QNN SDK paths and environment variables
110130

111-
Source the QNN SDK environment setup script to configure paths and environment variables:
131+
For Linux platform:
112132

113133
```bash
114134
source $QNN_SDK_ROOT/bin/envsetup.sh
115135
```
116136

117137
This sets up `LD_LIBRARY_PATH` and other required variables for the QNN SDK tools and libraries.
118138

119-
Additionally, set `PYTHONPATH` for ExecuTorch Python APIs:
139+
For Windows platform:
140+
141+
```powershell
142+
& "$env:QNN_SDK_ROOT\bin\envsetup.ps1"
143+
```
144+
145+
### Setup `PYTHONPATH` for ExecuTorch Python APIs
146+
147+
For Linux platform:
120148

121149
```bash
122150
export PYTHONPATH=$EXECUTORCH_ROOT/..:$PYTHONPATH
123151
```
124152

153+
For Windows platform:
154+
155+
```powershell
156+
$env:PYTHONPATH="$env:EXECUTORCH_ROOT\..;$env:PYTHONPATH"
157+
```
158+
125159
## Build
126160

127-
An example script for the below building instructions is [here](https://github.com/pytorch/executorch/blob/main/backends/qualcomm/scripts/build.sh).
161+
**On Linux platform**, an example script for the below building instructions is [`build.sh`](https://github.com/pytorch/executorch/blob/main/backends/qualcomm/scripts/build.sh).
128162
We recommend to use the script because the ExecuTorch build-command can change from time to time.
129163
The above script is actively used. It is updated more frequently than this tutorial.
130164
An example usage is
131165
```bash
132166
cd $EXECUTORCH_ROOT
133-
# android target
167+
# Android target
134168
./backends/qualcomm/scripts/build.sh
135-
# (optional) linux embedded target
169+
# (Optional) Linux embedded target
136170
./backends/qualcomm/scripts/build.sh --enable_linux_embedded
137-
# for release build
171+
# Android target for release build
138172
./backends/qualcomm/scripts/build.sh --release
139173
```
140174

175+
**On Windows platform**, use the PowerShell script [`build.ps1`](https://github.com/pytorch/executorch/blob/main/backends/qualcomm/scripts/build.ps1) for the building instructions. Both Windows x64 and ARM64 architectures are supported.
176+
Here's the example usage
177+
```powershell
178+
cd $env:EXECUTORCH_ROOT
179+
# Generate both Windows x64 and ARM64 target libraries
180+
.\backends\qualcomm\scripts\build.ps1 -Release
181+
# Generate only Windows x64 target libraries
182+
.\backends\qualcomm\scripts\build.ps1 -SkipArm64Windows -Release
183+
# Generate only Windows ARM64 target libraries
184+
.\backends\qualcomm\scripts\build.ps1 -SkipX86Windows -Release
185+
```
186+
187+
> **Notes**
188+
>
189+
> The script supports building both x64 and cross-compiling ARM64 target artifacts on Windows x64 host. After the build completes, the ARM64 libraries and executables can be copied to a Windows on Snapdragon (WoS) device using `scp`.
190+
> This allows a `.pte` generated on Windows x64 host to be executed on WoS device.
141191
142192
## Deploying and running on device
143193

144194
### AOT compile a model
145195

146196
Refer to [this script](https://github.com/pytorch/executorch/blob/main/examples/qualcomm/scripts/deeplab_v3.py) for the exact flow.
147-
We use deeplab-v3-resnet101 as an example in this tutorial. Run below commands to compile:
197+
We use deeplab-v3-resnet101 as an example in this tutorial.
198+
Run below commands to compile on Linux platform:
148199

149200
```bash
150201
cd $EXECUTORCH_ROOT
151202

152203
python -m examples.qualcomm.scripts.deeplab_v3 --build_folder build-android --soc_model SM8550 --compile_only --download
153204
```
154205

155-
You might see something like below:
206+
For Windows x64 and ARM64 platforms, run the following commands for the AOT compilation:
156207

208+
```powershell
209+
cd $env:EXECUTORCH_ROOT
210+
python -m examples.qualcomm.scripts.deeplab_v3 --build_folder build-x86_64-windows --soc_model SC8380XP --compile_only --download
157211
```
158-
[INFO][Qnn ExecuTorch] Destroy Qnn context
159-
[INFO][Qnn ExecuTorch] Destroy Qnn device
160-
[INFO][Qnn ExecuTorch] Destroy Qnn backend
161212

162-
Finish compile_only and save to ./deeplab_v3/dlv3_qnn.pte
213+
> **Notes**
214+
>
215+
> AOT compilation on Windows on ARM64 (WoA) device currently relies on an AMD64 Python environment running under x64 emulation, since some AOT dependencies are not yet distributed as ARM64 prebuilt wheels.
216+
217+
You might see something like below:
218+
219+
```
220+
Completed stage: Finalizing Graph Sequence (8966 us)
221+
Starting stage: Completion
222+
Completed stage: Completion (1388 us)
223+
[INFO] [Qnn ExecuTorch]: Destroy Qnn context
224+
[INFO] [Qnn ExecuTorch]: Destroy Qnn device
225+
[INFO] [Qnn ExecuTorch]: Destroy Qnn backend
163226
```
164227

165228
The compiled model is `./deeplab_v3/dlv3_qnn.pte`.
166229

167230
Note that the model is compiled for specific backend (e.g., HTP), so you can specify the target backend via `--backend gpu` or `--backend lpai`. If not specified, it will be default to HTP.
168231

169232

170-
### Test model inference on QNN HTP emulator / QNN LPAI emulator
171-
172-
We can test model inferences before deploying it to a device by HTP emulator.
173-
174-
Let's build `qnn_executor_runner` for a x64 host:
175-
```bash
176-
# assuming the AOT component is built.
177-
cd $EXECUTORCH_ROOT/build-x86
178-
cmake ../examples/qualcomm \
179-
-DCMAKE_PREFIX_PATH="$PWD/lib/cmake/ExecuTorch;$PWD/third-party/gflags;" \
180-
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \
181-
-DPYTHON_EXECUTABLE=python3 \
182-
-Bexamples/qualcomm
183-
184-
cmake --build examples/qualcomm -j$(nproc)
233+
### Test model inference on Linux x64 host with QNN HTP emulator / QNN LPAI emulator
185234

186-
# qnn_executor_runner can be found under examples/qualcomm/executor_runner
187-
# The full path is $EXECUTORCH_ROOT/build-x86/examples/qualcomm/executor_runner/qnn_executor_runner
188-
ls examples/qualcomm/executor_runner
189-
```
235+
Before deploying a model to a physical device, inference execution can be tested and validated on a Linux x64 host using the HTP / LPAI emulator.
190236

191237
To run the HTP emulator / LPAI emulator, the dynamic linker needs to access QNN libraries and `libqnn_executorch_backend.so`.
192238
We set the below two paths to `LD_LIBRARY_PATH` environment variable:
@@ -199,27 +245,55 @@ The second path is for `libqnn_executorch_backend.so`.
199245

200246
So, we can run `./deeplab_v3/dlv3_qnn.pte` by:
201247
```bash
202-
cd $EXECUTORCH_ROOT/build-x86
248+
cd $EXECUTORCH_ROOT
203249
export LD_LIBRARY_PATH=$EXECUTORCH_ROOT/build-x86/lib/:$LD_LIBRARY_PATH
204-
examples/qualcomm/executor_runner/qnn_executor_runner --model_path ../deeplab_v3/dlv3_qnn.pte
250+
build-x86/examples/qualcomm/executor_runner/qnn_executor_runner --model_path ./deeplab_v3/dlv3_qnn.pte
205251
```
206252

207253
We should see some outputs like the below. Note that the emulator can take some time to finish.
208254
```bash
209-
I 00:00:00.354662 executorch:qnn_executor_runner.cpp:213] Method loaded.
210-
I 00:00:00.356460 executorch:qnn_executor_runner.cpp:261] ignoring error from set_output_data_ptr(): 0x2
211-
I 00:00:00.357991 executorch:qnn_executor_runner.cpp:261] ignoring error from set_output_data_ptr(): 0x2
212-
I 00:00:00.357996 executorch:qnn_executor_runner.cpp:265] Inputs prepared.
213-
214-
I 00:01:09.328144 executorch:qnn_executor_runner.cpp:414] Model executed successfully.
215-
I 00:01:09.328159 executorch:qnn_executor_runner.cpp:421] Write etdump to etdump.etdp, Size = 424
216-
[INFO] [Qnn ExecuTorch]: Destroy Qnn backend parameters
255+
I 00:00:00.174364 executorch:qnn_executor_runner.cpp:416] Method loaded.
256+
E 00:00:00.179250 executorch:method.cpp:1373] Output 0 is memory planned, or is a constant. Cannot override the existing data pointer.
257+
I 00:00:00.179264 executorch:qnn_executor_runner.cpp:473] ignoring error from set_output_data_ptr(): 0x2
258+
E 00:00:00.183296 executorch:method.cpp:1373] Output 1 is memory planned, or is a constant. Cannot override the existing data pointer.
259+
I 00:00:00.183305 executorch:qnn_executor_runner.cpp:473] ignoring error from set_output_data_ptr(): 0x2
260+
I 00:00:00.183310 executorch:qnn_executor_runner.cpp:479] Inputs prepared.
261+
I 00:00:00.184008 executorch:qnn_executor_runner.cpp:684] Input list not provided. Inputs prepared with default values set.
262+
I 00:01:19.663283 executorch:qnn_executor_runner.cpp:695] Model executed successfully.
263+
I 00:01:19.663299 executorch:qnn_executor_runner.cpp:698] Perform 0 inferences for warming up
264+
I 00:01:53.881349 executorch:qnn_executor_runner.cpp:715] 1 inferences took 34218.046000 ms, avg 34218.046000 ms
265+
I 00:01:53.881426 executorch:qnn_executor_runner.cpp:727] Write etdump to etdump.etdp, Size = 576
217266
[INFO] [Qnn ExecuTorch]: Destroy Qnn context
218267
[INFO] [Qnn ExecuTorch]: Destroy Qnn device
219268
[INFO] [Qnn ExecuTorch]: Destroy Qnn backend
220269
```
221270

222-
### Run model inference on an Android smartphone with Qualcomm SoCs
271+
### Test model inference on Windows x64 host with QNN HTP emulator / QNN LPAI emulator
272+
273+
Unlike Linux, which set `LD_LIBRARY_PATH` to access shared libraries, Windows uses the `$env:PATH` environment variable. To enable runtime loading of `qnn_executorch_backend.dll`, ensure that it is discoverable by the Windows DLL loader.
274+
275+
This can be achieved by either:
276+
- Placing `qnn_executorch_backend.dll` in the same directory as `qnn_executor_runner.exe`; or
277+
- Adding the directory containing `qnn_executorch_backend.dll` to `$env:PATH` environment variable.
278+
279+
The generated artifacts can be found at:
280+
- `$env:EXECUTORCH_ROOT\build-x86_64-windows\examples\qualcomm\executor_runner\Release\qnn_executor_runner.exe`
281+
- `$env:EXECUTORCH_ROOT\build-x86_64-windows\backends\qualcomm\Release\qnn_executorch_backend.dll`
282+
283+
To add the directory containing `qnn_executorch_backend.dll` to the `$env:PATH` environment variable:
284+
```powershell
285+
$env:PATH="$env:EXECUTORCH_ROOT\build-x86_64-windows\backends\qualcomm\Release;$env:PATH"
286+
```
287+
288+
Once configured, `qnn_executorch_backend.dll` will be accessed by `qnn_executor_runner.exe` at runtime.
289+
290+
To test the model inference on Windows x64 host with QNN HTP emulator / QNN LPAI emulator:
291+
```powershell
292+
cd $env:EXECUTORCH_ROOT\build-x86_64-windows\examples\qualcomm\executor_runner\Release
293+
.\qnn_executor_runner.exe --model_path $env:EXECUTORCH_ROOT\deeplab_v3\dlv3_qnn.pte
294+
```
295+
296+
### Run model inference on Android smartphone with Qualcomm SoCs
223297

224298
***Step 1***. We need to push required QNN libraries to the device.
225299

@@ -251,7 +325,7 @@ adb push ${QNN_SDK_ROOT}/lib/aarch64-android/libQnnGpu.so ${DEVICE_DIR}
251325
adb push ${QNN_SDK_ROOT}/lib/aarch64-android/libQnnLpai.so ${DEVICE_DIR}
252326
adb push ${QNN_SDK_ROOT}/lib/aarch64-android/libQnnLpaiStub.so ${DEVICE_DIR}
253327
adb push ${QNN_SDK_ROOT}/lib/aarch64-android/libQnnSystem.so ${DEVICE_DIR}
254-
# make sure the skel lib is signed for LPAI backend.
328+
# Make sure the skel lib is signed for LPAI backend.
255329
adb push ${QNN_SDK_ROOT}/lib/lpai-v6/signed/libQnnLpaiSkel.so ${DEVICE_DIR}
256330
```
257331

@@ -298,6 +372,54 @@ After the above command, pre-processed inputs and outputs are put in `$EXECUTORC
298372
The command-line arguments are written in [utils.py](https://github.com/pytorch/executorch/blob/main/examples/qualcomm/utils.py#L139).
299373
The model, inputs, and output location are passed to `qnn_executorch_runner` by `--model_path`, `--input_list_path`, and `--output_folder_path`.
300374

375+
### Run model inference on Windows on Snapdragon (WoS) with Qualcomm SoCs
376+
377+
Before running inference on Windows on Snapdragon (WoS) with Qualcomm SoCs, ensure that `qnn_executorch_backend.dll` and all required QNN libraries are discoverable by the Windows loader. This can be achieved by either:
378+
- Copying `qnn_executorch_backend.dll` and the required QNN libraries into the same directory as `qnn_executor_runner.exe`; or
379+
- Adding the directories containing these libraries to the `$env:PATH` environment variable.
380+
381+
The generated artifacts can be found at:
382+
- `$env:EXECUTORCH_ROOT\build-arm64-windows\examples\qualcomm\executor_runner\Release\qnn_executor_runner.exe`
383+
- `$env:EXECUTORCH_ROOT\build-arm64-windows\backends\qualcomm\Release\qnn_executorch_backend.dll`
384+
385+
Depending on the selected QNN backend, the corresponding QNN libraries can be found under:
386+
387+
```powershell
388+
# For HTP
389+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnHtp.dll
390+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnSystem.dll
391+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnHtpV69Stub.dll
392+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnHtpV73Stub.dll
393+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnHtpV75Stub.dll
394+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnHtpV79Stub.dll
395+
$env:QNN_SDK_ROOT\lib\hexagon-v69\unsigned\libQnnHtpV69Skel.so
396+
$env:QNN_SDK_ROOT\lib\hexagon-v73\unsigned\libQnnHtpV73Skel.so
397+
$env:QNN_SDK_ROOT\lib\hexagon-v75\unsigned\libQnnHtpV75Skel.so
398+
$env:QNN_SDK_ROOT\lib\hexagon-v79\unsigned\libQnnHtpV79Skel.so
399+
```
400+
401+
```powershell
402+
# For GPU
403+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnGpu.dll
404+
```
405+
406+
```powershell
407+
# For LPAI
408+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnLpai.dll
409+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnLpaiStub.dll
410+
$env:QNN_SDK_ROOT\lib\aarch64-windows-msvc\QnnSystem.dll
411+
# Make sure the skel lib is signed for LPAI backend.
412+
$env:QNN_SDK_ROOT\lib\lpai-v6\signed\libQnnLpaiSkel.so
413+
```
414+
415+
Once configured, `qnn_executorch_backend.dll` and the required QNN libraries can be accessed by `qnn_executor_runner.exe` at runtime.
416+
417+
To test the model inference on Windows on Snapdragon (WoS) with Qualcomm SoCs:
418+
```powershell
419+
cd $env:EXECUTORCH_ROOT
420+
.\qnn_executor_runner.exe --model_path .\deeplab_v3\dlv3_qnn.pte
421+
```
422+
301423
### Run [Android LlamaDemo](https://github.com/meta-pytorch/executorch-examples/tree/main/llm/android/LlamaDemo) with QNN backend
302424

303425
`$DEMO_APP` refers to the root of the executorch android demo, i.e., the directory containing `build.gradle.kts`.

0 commit comments

Comments
 (0)