ONNX Runtime with DirectML execution provider for hardware-accelerated ML inference on Windows devices with DirectX 12 compatible GPUs. Version 1.24.4 requires Python >=3.11 and is maintained by Microsoft. Release cadence follows ONNX Runtime releases.
pip install onnxruntime-directmlVerified import paths — ran on the pinned version, not inferred.
Basic inference using DirectML provider. Ensure model.onnx exists and is compatible.
Upgrade Python to 3.11 or later, or use an older onnxruntime-directml version (but note older versions may lack features).
Check platform before using DirectML: import sys; if not sys.platform.startswith('win'): raise RuntimeError('DirectML requires Windows').Use Liberica JDK 8 or 11 as the Java runtime for QuickSight.
Always place DirectML provider first: providers=['DmlExecutionProvider', 'CPUExecutionProvider'].