# Windows Setup

## Instructions for Windows Host (10, 11, and Snapdragon)

Follow these instructions to install the Qualcomm AI Engine Direct SDK **(commonly referred to as the QNN SDK)** and all necessary dependencies.

Note

This guide is for a host machine running Windows 10, 11, or Windows on Snapdragon.
If you are using a Linux machine or are using a WSL environment, follow the instructions
[here](https://docs.qualcomm.com/doc/80-63442-10/topic/linux_setup.html).

The QNN SDK allows you to convert an AI model (ex. a `.pt` model from PyTorch) into instructions
that can be run on a target device’s various processing units (CPU, GPU, HTP or LPAI).

Note

To learn about acronyms which are new to you, see the glossary.

You will need the following to use the QNN SDK:

Step 1: The QNN SDK binary and its immediate dependencies.

Step 2: Install QNN SDK Dependencies

Step 3: Install model frameworks to interpret your AI model files. (e.g., `PyTorch`)

Step 4: Install Target Device OS-Specific Tool Chain Code

Step 5: Install Dependencies for Target Hardware Processors

Step 6 (Optional step): Additional Packages for Evaluating Model Accuracy.

Note

This guide contains many recommendations about specific versions of code to use that have been verified to work.
Other versions of those dependencies may or may not work, so use them at your own risk.

## Step 1: Install Qualcomm AI Engine Direct (aka the “QNN SDK”)

1. Go to the QNN SDK product page: [https://www.qualcomm.com/developer/software/qualcomm-ai-engine-direct-sdk](https://www.qualcomm.com/developer/software/qualcomm-ai-engine-direct-sdk)
2. Click “Get Software” to download the QNN SDK

    1. Note: The QNN SDK is ~2 Gb when unzipped.
3. Unzip the downloaded SDK.

    1. The zipped file will have the version name, for example: `v2.22.6.240515`.
    2. When unzipped, the folder should be named `qairt` with a sub-folder that looks like `2.22.6.240515`.

### Set up your environment

1. Open an admin Powershell terminal by:

    1. Pressing the “Windows” button to search for applications
    2. Searching for “Powershell”
    3. Right clicking “Windows Powershell” and selecting “Run as Administrator”
    4. Saying “Yes” when prompted for permission to run this application as an administrator.
2. Navigate to `qairt/<SDK_VERSION>` inside the unzipped QNN SDK.

    1. Replace `<SDK_VERSION>` with the name of the file directly under `qairt` - it should look something like `2.22.6.240515`.
3. Setup the environment using the below commands:

cd bin
        Unblock-File ./envsetup.ps1
        ./envsetup.ps1
        Copy to clipboard
4. This will automatically set the following environment variables:

    - `QAIRT_SDK_ROOT` — full path to the SDK root

Warning

The `envsetup.ps1` script only updates environment variables for this Powershell instance.
If you need to set `QAIRT_SDK_ROOT` again, then just re-run this script. Alternatively, consider
persisting the environment variables set by the script to your shell environment.

Warning

The `QNN_SDK_ROOT` and `SNPE_ROOT` environment variables are currently set to `QAIRT_SDK_ROOT` for backwards
compatibility. They will be deprecated in favor of `QAIRT_SDK_ROOT` in a future release. Please update any
relevant workflows to use `QAIRT_SDK_ROOT` instead.
5. Run `Unblock-File "${QAIRT_SDK_ROOT}/bin/check-windows-dependency.ps1"`.
6. Run `& "${QAIRT_SDK_ROOT}/bin/check-windows-dependency.ps1"`

    This will install the core Windows build tools.

    1. Each time you run the script it will install more dependencies.
You will likely have to re-run the command after it helps you install Visual Studio and Visual Studio Build Tools.
    2. When you have installed all the necessary dependencies, the script will say “All Done”.
7. Run `Unblock-File "${QAIRT_SDK_ROOT}/bin/envcheck.ps1"`.
8. Run `& "${QAIRT_SDK_ROOT}/bin/envcheck.ps1" -m`.

    This will verify that you have installed the Microsoft Visual Studio C++ (MSVC) toolchain successfully.

Note

It’s normal to see that only one of “Visual C++(x86)” and “Visual C++(arm64)” is installed.
The installed version should match the hardware of your host machine.

    You should see an output like this:

Checking MSVC Toolchain
        --------------------------------------------------------------
        WARNING: The version of VS BuildTools 14.40.33807 found has not been validated. Recommended to use known stable VS
        BuildTools version 14.34
        WARNING: The version of Visual C++(x64) 19.40.33812 found has not been validated. Recommended to use known stable
        Visual C++(x64) version 19.34
        WARNING: The version of CMake 3.28.3 found has not been validated. Recommended to use known stable CMake version 3.21
        WARNING: The version of clang-cl 17.0.3 found has not been validated. Recommended to use known stable clang-cl version
        15.0.1
        Name              Version
        ----              -------
        Visual Studio     17.10.35027.167
        VS Build Tools    14.40.33807
        Visual C++(x86)   19.40.33812
        Visual C++(arm64) Not Installed
        Windows SDK       10.0.22621
        CMake             3.28.3
        clang-cl          17.0.3
        --------------------------------------------------------------
        Copy to clipboard

## Step 2: Install QNN SDK dependencies

1. Install Python 3.10.4 - [python.org/downloads/release/python-3104/](http://python.org/downloads/release/python-3104/)

Warning

Windows currently supports Python 3.10 only. Python 3.12 is not yet supported on Windows.
2. Verify the installation worked by running:

py --list
        Copy to clipboard

    You should see `-V:3.10` as one of the options.
3. Open the folder at `QAIRT_SDK_ROOT` in Visual Studio.
4. Open a new Powershell terminal in Visual Studio by going to the top-menu “Terminal” and clicking “New Terminal”.

Warning

Ensure the new terminal is a Powershell instance.
5. From the `QAIRT_SDK_ROOT` folder, run the following command to create and activate a new virtual environment:

py -3.10 -m venv "venv"
        & "venv\Scripts\Activate.ps1"
        Copy to clipboard

Warning

If your environment is in WSL, the `venv` directory must be under `$HOME`.
6. Update all dependencies by running the following commands in Powershell:

python -m pip install --upgrade pip
        python "$env:QAIRT_SDK_ROOT\bin\check-python-dependency"
        Copy to clipboard

Note

The above installs all required packages. To install optional packages pass `o|--with-optional`

## Step 3: Install Model Frameworks

QNN supports the following model frameworks.

Install the ones that are relevant for the AI model files you want to use.

Warning

You do not need to install **all** packages here.

Note

You can install a package by running `pip install package==version`.
e.g., `pip install torch==1.13.1`
This may update some of the dependency packages installed earlier via check-python-dependency script.

| Package | Version | Description |
| --- | --- | --- |
| [torch (SNPE/QNN)](https://pypi.org/project/torch/) | 1.13.1 | PyTorch is used for building and training deep learning models with a focus on flexibility and speed. Used with .pt files.<br>Install by downloading the proper binary from [PyTorch previous versions](https://pytorch.org/get-started/previous-versions/#v1130) if pip install does not work. |
| [torch (QAIRT)](https://pypi.org/project/torch/) | 2.4.1 | PyTorch is used for building and training deep learning models with a focus on flexibility and speed. Used with .pt files.<br>Install by downloading the proper binary from [PyTorch previous versions](https://pytorch.org/get-started/previous-versions/#v240) if pip install does not work. |
| [torchvision](https://pypi.org/project/torchvision/) | 0.14.1 (SNPE/QNN) / 0.19.1 (QAIRT) | Torchvision is used for computer vision tasks with PyTorch, providing datasets, model architectures, and image transforms. |
| [tensorflow](https://pypi.org/project/tensorflow/) | 2.10.1 | TensorFlow is used for building and training machine learning models, particularly deep learning models. Used with .pb files.<br>**Note:** The envcheck script may incorrectly report this package as not installed on Ubuntu.<br>**Warning:** TensorFlow is not supported with Python 3.12 (Ubuntu 24.04). Use Python 3.10 (Ubuntu 22.04) for TensorFlow workflows. |
| [tflite](https://pypi.org/project/tflite/) | 2.18.0 | TFLite is used for running TensorFlow models on mobile and edge devices with optimized performance. Used with .tflite files. |
| [onnx](https://pypi.org/project/onnx/) | 1.19.1 | ONNX stands for Open Neural Network Exchange. It is used for defining and exchanging deep learning models between different frameworks. Used with .onnx files. |
| [onnxruntime](https://pypi.org/project/onnxruntime/) | 1.23.2 | ONNX Runtime is used for running ONNX models with high performance across various hardware platforms. Used with .onnx files. |
| [onnxsim](https://pypi.org/project/onnxsim/) | 0.6.2 | Onnxsim is used for simplifying ONNX models to reduce complexity and improve inference efficiency. Used with .onnx files. |

Note

You can verify your installation by calling `& "${QAIRT_SDK_ROOT}/bin/envcheck.ps1" -a` which will check to see
whether these dependencies are installed. These are optional, so just verify that the dependencies you intended
to install are actually installed.

## Step 4: Install Target Device OS-Specific Toolchain Code

Depending on the target device’s operating system there may be additional installation requirements.

### Working with an Android Target Device

For working with Android devices, you will need to install a corresponding Android NDK (Native Developer Kit).
You can install the recommended version (Android NDK version `r26c`) by following these steps:

1. Download the Android NDK: [https://dl.google.com/android/repository/android-ndk-r26c-linux.zip](https://dl.google.com/android/repository/android-ndk-r26c-linux.zip)
2. Unzip the file.

Warning

If your environment is in WSL, the Android NDK must be unzipped under $HOME with the WSL `unzip` command.
3. Copy the path to your unzipped Android NDK root (the folder should be named `android-ndk-r26c`).
4. Open a Powershell terminal.
5. Add the location of the unzipped file to your PATH by running:

Warning

Ensure you update the `<path-to-your-android-ndk-root-folder>` below to be the path to the
unzipped `android-ndk-r26c` folder before running the below commands!
(Ex. `/home/usr/Documents/android-ndk-r26c`)

$env:ANDROID_NDK_ROOT = "<path-to-your-android-ndk-root-folder>"
        [System.Environment]::SetEnvironmentVariable("ANDROID_NDK_ROOT", "<path-to-your-android-ndk-root-folder>", "User")
        
        $env:PATH = "$env:ANDROID_NDK_ROOT;$env:PATH"
        [System.Environment]::SetEnvironmentVariable("PATH", "$env:ANDROID_NDK_ROOT;$env:PATH", "User")
        Copy to clipboard
6. Run `Unblock-File "${QAIRT_SDK_ROOT}/bin/envcheck.ps1"`.
7. Run `& "${QAIRT_SDK_ROOT}/bin/envcheck.ps1" -n`.

    This will verify your environment variables are properly configured.

### Working with a Linux Target Device

For Linux target devices you will likely need to use clang++14 to build models for them using the QNN SDK.
Later versions may work but have not been verified.

You can update your Visual Studio to use a specific version of clang++ by following these instructions:
[https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170).

## Step 5: Install Dependencies for Target Hardware Processors

Some of the target processors (CPU, GPU, HTP or HTA) require additional dependencies to build models.

### CPU (Central Processing Unit)

The x86\_64 targets are built using clang-14. You can update your Visual Studio to use a
specific version of clang++ by following these instructions:
[https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170).

The ARM CPU targets are built using the Android NDK (see
[Working With an Android Target Device](https://docs.qualcomm.com/doc/80-63442-10/topic/windows_setup.html#windows-setup-android-target)).

### GPU (Graphical Processing Unit)

The GPU backend kernels are written based on OpenCL. The GPU operations must be implemented
based on OpenCL headers with minimum version OpenCL 2.0.

Note

Ensure that the OpenCL shared library (`libOpenCL.so`) is accessible to the system runtime loader at execution time.

The library must either be installed in a standard system library location searched by the dynamic loader, or placed in a custom directory that is added to the library search path.

If `libOpenCL.so` is not installed in a standard location, configure the runtime environment accordingly for the loader to locate it. This can be done by adding the location path to `LD_LIBRARY_PATH`
(relevant for WSL2 environments).

### HTP

Compiling for HTP hardware requires the use of the Qualcomm Hexagon SDK and
Hexagon SDK Tools which you can install by following these steps.

1. If you do not already have Qualcomm Package Manager 3 (QPM3) installed, install it
by following the steps below:

    1. Sign into [https://qpm.qualcomm.com/#/main/tools/details/QPM3](https://qpm.qualcomm.com/#/main/tools/details/QPM3).

Warning

**You may have to reclick the link after logging in to have the QPM3 product page load properly.**
    2. Download the Windows version of Qualcomm Package Manager 3 (QPM3).
2. Start QPM3 by running the QPM3 executable. It should have a similar name to `QPM.3.0.92.3.Windows-AnyCPU.exe`.
3. Create a Qualcomm account or log in to your existing one when prompted.
4. Look up which “Hexagon Architecture” your chip supports in the
supported Snapdragon devices table. (It should look like “V00”)
5. Use the below table to determine the proper Hexagon SDK version for your Hexagon architecture:

Note

You can find the “Hexagon Architecture” of your chip by looking it up in the
supported Snapdragon devices table - it should look something like “V00”.

    | Backend | Hexagon Architecture | Hexagon SDK Version | Additional Notes |
    | --- | --- | --- | --- |
    | HTP | V81 | 6.4.0 | Pre-packaged. |
    | HTP | V73 | 5.5.5 | Pre-packaged. |
    | HTP | V68 | 5.5.5 | Not pre-packaged with Hexagon SDK Tools. |

Warning

Hexagon SDK Tools version 8.6.02 is **not** currently pre-packaged into
Hexagon SDK version 5.5.5. It needs to be downloaded separately
and placed at the location `$HEXAGON_SDK_ROOT/tools/HEXAGON_Tools/`.
6. In the QPM3, search for “Hexagon SDK”.
7. Download the specified version in the above table.
8. If your version of Use the table below to determine which version of the Hexagon Tools software corresponds
to your Hexagon Architecture from before. (You can look it up again in the
supported Snapdragon devices table)

    | Backend | Hexagon Architecture | Hexagon Tools Version | Additional Notes |
    | --- | --- | --- | --- |
    | HTP | V81 | 19.0.04 | Not Pre-packaged with Hexagon SDK 6.2.0 Tools. |
    | HTP | V73 | 8.7.06 | Pre-packaged. |
    | HTP | V68 | 8.6.02 | Not pre-packaged Hexagon SDK 5.5.5 Tools. |

Warning

Hexagon SDK Tools version 8.6.02 is **not** currently pre-packaged into
Hexagon SDK version 5.5.5. It needs to be downloaded separately
and placed at the location `$HEXAGON_SDK_ROOT/tools/HEXAGON_Tools/`.
9. In QPM3, search for “Hexagon Tools”.
10. Install the proper version from the above table for your Hexagon Architecture.
11. Install clang++ so you can compile code for HTP hardware.
12. Follow the instructions at `$HEXAGON_SDK_ROOT/docs/readme.html` (where $HEXAGON\_SDK\_ROOT is the location of the Hexagon SDK installation).

### LPAI (Low Power AI)

The LPAI backend is designed for offline model preparation only. In order to use QNN with LPAI, you must download the LPAI code using Qualcomm Package Manager.

1. If you do not already have Qualcomm Package Manager 3 (QPM3) installed, install it by following the steps below:

    1. Sign into [https://qpm.qualcomm.com/#/main/tools/details/QPM3](https://qpm.qualcomm.com/#/main/tools/details/QPM3).

Warning

You may have to reclick the link after logging in to have it load properly.
    2. Download the Windows version of Qualcomm Package Manager 3 (QPM3).
2. Start QPM3 by running the QPM3 executable. It should have a similar name to `QPM.3.0.92.3.Windows-AnyCPU.exe`.
3. Create a Qualcomm account or log in to your existing one when prompted.
4. Once logged in to the Qualcomm Package Manager, search for “LPAI” and click the “Extract” button.

    1. This will attempt to install the LPAI code, **but will likely fail** because it is missing the Hexagon SDK dependency.
    2. Use the error message to determine which version of the Hexagon SDK you need to install first.

        1. Ex. For v2.4.0 of the LPAI code, it requires version 5.x of the Hexagon SDK.
    3. Install the necessary version of the Hexagon SDK.
    4. Then re-install the LPAI code.

## Step 5 (Optional): Additional Packages for Evaluating Model Accuracy

If you want to evaluate model accuracy in real time, you may also need to install some of the following dependencies.

You can install each relevant package by running:

`pip3 install dependency==version`

Ex. `pip3 install pycocotools==2.0.7`

| Package | Version | Description |
| --- | --- | --- |
| [pycocotools](https://pypi.org/project/pycocotools/) | 2.0.7 | Use for working with COCO datasets for object detection, segmentation, and keypoint tasks. |
| [transformers](https://pypi.org/project/transformers/) | 4.57.1 | Use for leveraging pre-trained models for various NLP tasks like text classification, translation, and more. |
| [tokenizers](https://pypi.org/project/tokenizers/) | 0.19.1 | Use for efficient tokenization of text data, particularly when dealing with large datasets. |
| [sacrebleu](https://pypi.org/project/sacrebleu/) | 2.3.1 | Use for evaluating the quality of machine translation models. |
| [scikit-learn](https://pypi.org/project/scikit-learn/) | 1.3.0 | Use for implementing machine learning algorithms and models for various predictive tasks. |
| [OpenNMT-py](https://pypi.org/project/OpenNMT-py/) | 2.3.0 | Use for building and training neural machine translation models. |
| [sentencepiece](https://pypi.org/project/sentencepiece/) | 0.2.0 | Use for unsupervised text tokenization and preprocessing for language models. |
| [onnxruntime-genai](https://pypi.org/project/onnxruntime-genai/) | 0.8.2 | Use for running LLMs with ONNX Runtime. |
| [gguf](https://pypi.org/project/gguf/) | 0.9.1 | Use for reading and writing binary files in the GGUF (GGML Universal File) format. |
| [onnx-graphsurgeon](https://pypi.org/project/onnx-graphsurgeon/) | 0.5.8 | Used to modify and create ONNX Models. |
| [onnxscript](https://pypi.org/project/onnxscript/) | 0.5.6 | Enables developers to author ONNX functions and models in Python. |
| [islpy](https://pypi.org/project/islpy/) | 2025.2.5 | Used for manipulating sets and relations of integer points bounded by linear constraints. |
| [tiktoken](https://pypi.org/project/tiktoken/) | 0.7.0 | Use for fast tokenization of text, particularly for OpenAI models. |
| [tqdm](https://pypi.org/project/tqdm/) | 4.65.0 | Use for displaying progress bars in loops and command-line scripts. |

## Next Steps

Now that you’ve finished with setting up QNN SDK and its dependencies, you can use the QNN SDK.
Follow the CNN to QNN tutorial to
learn how to transform your AI models, build them for your target device, and use them to generate
inferences on the information processing cores you choose. Use the QNN SDK to allow your AI models
to execute on your specific target device’s cores.

Last Published: Jun 04, 2026

[Previous Topic
Linux Setup](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/linux_setup.md) [Next Topic
Backend](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/backend.md)