DirectML: GPU machine learning via DirectX 12, now maintenance-only
DirectML exists to give every DirectX 12-capable Windows GPU a common, low-level compute backend for machine learning frameworks and real-time applications.

What it does
DirectML is a native C++ library built on DirectX 12 that exposes common machine learning tasks as GPU-accelerated compute operations. It targets virtually any DirectX 12-capable hardware—AMD GCN 1st-gen and newer, Intel Haswell integrated graphics and up, NVIDIA Kepler+, and Qualcomm Adreno 600+—and acts as the GPU backend for higher-level frameworks including ONNX Runtime, PyTorch, TensorFlow, and Windows ML. When used standalone, it is positioned as a low-latency option for games and real-time applications that need ML inference tightly coupled to the graphics pipeline.
The interesting bit
Instead of creating a separate GPU compute stack, DirectML piggybacks on the DirectX 12 driver model and hardware abstraction, allowing a game engine to interleave ML operators with rendering work using the same Direct3D 12 pipeline. Microsoft also ships it as a standalone redistributable NuGet package so applications can lock to a fixed version rather than relying solely on the Windows system component.
Key highlights
- Broad hardware support: runs on any DirectX 12 GPU from AMD, Intel, NVIDIA, and Qualcomm.
- Framework integrations: backend for Windows ML, ONNX Runtime, PyTorch via
torch-directml, and TensorFlow 1.15 viatensorflow-directml. - Low-level interoperability: designed for high-performance, low-latency scenarios where reliability and predictability across hardware are critical.
- Standalone distribution: available as a system component in Windows 10 1903+ and as a redistributable NuGet package (
Microsoft.AI.DirectML) since version 1.4.0. - Sample code: includes C++ samples (
HelloDirectML, YOLOv4, super-resolution) and Python bindings via PyDirectML.
Caveats
- The project is explicitly in maintenance mode: no new functionality is planned, repository issues and samples will not be updated, and Microsoft recommends Windows ML for Windows 11 version 24H2 and later.
- TensorFlow support is limited to version 1.15 and remains in Public Preview.
- The API is low-level DirectX 12, so using it directly requires fluency in Direct3D 12 resource management and command submission; most developers will prefer the framework integrations.
Verdict
DirectML is worth studying if you are building a Windows game engine or real-time renderer that needs to fuse ML operators with graphics work, or if you are supporting legacy Windows deployments. For new projects on recent Windows 11 systems, Microsoft itself suggests considering Windows ML instead.
Frequently asked
- What is microsoft/DirectML?
- DirectML exists to give every DirectX 12-capable Windows GPU a common, low-level compute backend for machine learning frameworks and real-time applications.
- Is DirectML open source?
- Yes — microsoft/DirectML is open source, released under the MIT license.
- What language is DirectML written in?
- microsoft/DirectML is primarily written in C++.
- How popular is DirectML?
- microsoft/DirectML has 2.6k stars on GitHub.
- Where can I find DirectML?
- microsoft/DirectML is on GitHub at https://github.com/microsoft/DirectML.