Installation
ONNX Runtime GenAI can be installed via package managers for Python and C#, or downloaded as binaries for C++. Choose the installation method that matches your development environment.System Requirements
Before installing, ensure your system meets these requirements:- General
- GPU Acceleration
- Operating System: Windows, Linux, or macOS
- Architecture: x64, x86, or arm64
- Python: 3.8 or later (for Python API)
- .NET: .NET 8.0 or later (for C# API)
- C++ Compiler: MSVC, GCC, or Clang (for C++ API)
Python Installation
Nightly Builds (Python)
To install the latest nightly build with cutting-edge features:C# Installation
Choose Execution Provider (Optional)
For GPU acceleration, use the appropriate package:
- CUDA
- DirectML
The C# package supports .NET 8.0, .NET Standard 2.0, and mobile platforms (Android, iOS, Mac Catalyst).
C++ Installation
Download Binaries
Download the pre-built binaries for your platform from the GitHub Releases page.Choose the appropriate package:
- Windows:
onnxruntime-genai-win-x64-{version}.zip - Linux:
onnxruntime-genai-linux-x64-{version}.tar.gz - macOS:
onnxruntime-genai-osx-{arch}-{version}.tar.gz
Extract and Configure
- Windows
- Linux
- macOS
- Extract the archive to your desired location
- Add the
bindirectory to your PATH - Link against the library in your CMake or Visual Studio project:
Build from Source (C++)
For advanced users who need custom builds:Platform-Specific Notes
Windows
Windows
- Visual C++ Redistributable 2019 or later is required
- For DirectML, ensure Windows 10 version 1903 or later
- CUDA builds require CUDA toolkit to be installed
Linux
Linux
- GLIBC 2.27 or later is required
- For CUDA support, install CUDA 11.8+ and cuDNN
- Ubuntu 20.04+ and CentOS 8+ are officially supported
macOS
macOS
- macOS 11.0 (Big Sur) or later
- Both Intel (x64) and Apple Silicon (arm64) are supported
- No GPU acceleration on macOS (CPU only)
Android
Android
- Android API level 27 or higher
- Available through .NET MAUI or build from source
- QNN execution provider for Qualcomm devices
Troubleshooting
Import Error (Python)
Import Error (Python)
If you encounter import errors, ensure:
- NumPy is installed:
pip install numpy - You’re using Python 3.8 or later
- The package matches your platform architecture (x64/arm64)
DLL/Shared Library Not Found
DLL/Shared Library Not Found
Version Mismatch
Version Mismatch
If using examples from the repository, ensure they match your installed version:
Next Steps
Quickstart Guide
Now that you have ONNX Runtime GenAI installed, follow the quickstart guide to run your first model.