Setup

This page will outline the setup required for using Qualcomm® Genie. First, please make sure the QNN SDK setup is done as per the instructions in <QNN_SDK_ROOT>/docs/QNN/general/setup.html.

Environment setup

Python

If using the QNN GenAiTransformer backend, also make sure to follow the Python setup found here: <QNN_SDK_ROOT>/docs/QNN/general/setup.html. Also, the qnn-genai-transformer-composer tool will require installation specific version of packages as mentioned in the following table.

Package

Version

transformers

4.31.0

tokenizers

0.19.1

sentencepiece

0.1.98

tiktoken

0.7.0

tqdm

4.65.0

Linux

The user environment can be set by calling the <QNN_SDK_ROOT>/bin/envsetup.sh script.

Open a command shell on Linux host and run:

# Replace <QNN_SDK_ROOT> with path where QNN SDK was installed
source <QNN_SDK_ROOT>/bin/envsetup.sh

This will set/update the following environment variables:

  • QNN_SDK_ROOT

  • PYTHONPATH

  • PATH

  • LD_LIBRARY_PATH

${QNN_SDK_ROOT} represents the full path to Qualcomm® AI Engine Direct SDK root.

Windows

The user environment can be set by calling <QNN_SDK_ROOT>/bin/envsetup.ps1 script.

First, open Developer PowerShell for VS2022 as Administrator.

Set-ExecutionPolicy RemoteSigned

Then, execute the following script.

# Replace <QNN_SDK_ROOT> with path where QNN SDK was installed
> & "<QNN_SDK_ROOT>\bin\envsetup.ps1"

This will set/update the following environment variables:

  • QNN_SDK_ROOT

  • PATH

  • PYTHONPATH

${QNN_SDK_ROOT} represents the full path to Qualcomm® AI Engine Direct SDK root.