Building & Installation Guide
Instructions for building the native C++ PJRT plugin library and installing the Python package across Windows on ARM and Linux.
1. Prerequisites
- Python 3.10+ with
pip and development headers
- CMake >= 3.20
- C++17 Compiler:
- Windows: Visual Studio 2022 (MSVC ARM64 toolchain) or Clang
- Linux / Android: Clang 14+ or GCC 11+
- Qualcomm QAIRT / QNN SDK (v2.37+): Download from Qualcomm Software Center.
2. Configure Environment Variables
Set QNN_SDK_ROOT to your installed SDK directory:
Windows PowerShell:
$env:QNN_SDK_ROOT = "C:\Qualcomm\QAIRT\2.37.0.250724"
Linux / Bash:
export QNN_SDK_ROOT="/opt/qualcomm/qairt/2.37.0.250724"
3. Building the C++ PJRT Plugin (`pjrt_qnn.dll`)
# 1. Clone the repository
git clone https://github.com/carrycooldude/JAX-QNN.git
cd JAX-QNN
# 2. Configure build with CMake
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DQNN_SDK_ROOT=$QNN_SDK_ROOT
# 3. Compile shared library (pjrt_qnn.dll on Windows, pjrt_qnn.so on Linux)
cmake --build . --config Release
4. Installing the Python Package
# Install in editable development mode
pip install -e ".[dev]"
5. Verifying the Installation
# Run the test suite
pytest tests/ -v
Note on STUB Mode: If QNN_SDK_ROOT is omitted during CMake configuration, the plugin will automatically compile in STUB mode with reference CPU execution for development and continuous integration.