{"id":24144,"library":"onnxruntime-directml","title":"ONNX Runtime DirectML","description":"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.","status":"active","version":"1.24.4","language":"python","source_language":"en","source_url":"https://github.com/microsoft/onnxruntime","tags":["onnx","onnxruntime","directml","machine-learning","inference","windows"],"install":[{"cmd":"pip install onnxruntime-directml","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for tensor operations in ONNX Runtime.","package":"numpy","optional":false},{"reason":"Used for serializing ONNX models.","package":"protobuf","optional":false},{"reason":"Required for shape inference in some operators.","package":"sympy","optional":true}],"imports":[{"note":"Onnxruntime-directml does not expose its own InferenceSession; it uses the standard onnxruntime session. DirectML is enabled via session options.","wrong":"from onnxruntime_directml import InferenceSession","symbol":"InferenceSession","correct":"from onnxruntime import InferenceSession"},{"note":"SessionOptions is in the onnxruntime package, not a separate directml package.","wrong":"import onnxruntime_directml","symbol":"SessionOptions","correct":"from onnxruntime import SessionOptions"}],"quickstart":{"code":"import onnxruntime\nfrom onnxruntime import InferenceSession, SessionOptions\n\n# Enable DirectML execution provider\noptions = SessionOptions()\noptions.enable_training = False\nproviders = ['DmlExecutionProvider', 'CPUExecutionProvider']\nsession = InferenceSession('model.onnx', options, providers=providers)\n# Run inference\nimport numpy as np\ninput_name = session.get_inputs()[0].name\nresult = session.run(None, {input_name: np.random.randn(1, 3, 224, 224).astype(np.float32)})","lang":"python","description":"Basic inference using DirectML provider. Ensure model.onnx exists and is compatible."},"warnings":[{"fix":"Upgrade Python to 3.11 or later, or use an older onnxruntime-directml version (but note older versions may lack features).","message":"Python 3.11 minimum required as of version 1.24.x. Older Python versions are unsupported.","severity":"breaking","affected_versions":">=1.24.0"},{"fix":"Check platform before using DirectML: import sys; if not sys.platform.startswith('win'): raise RuntimeError('DirectML requires Windows').","message":"DirectML execution provider requires Windows 10/11 with DirectX 12 GPU. It will not work on Linux or macOS. Trying to use DmlExecutionProvider on unsupported OS raises an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Liberica JDK 8 or 11 as the Java runtime for QuickSight.","message":"Using Oracle JDK is deprecated; only Liberica JDK is fully supported. The default JDK download in some documentation points to Oracle, which may cause compatibility issues.","severity":"deprecated","affected_versions":"all"},{"fix":"Always place DirectML provider first: providers=['DmlExecutionProvider', 'CPUExecutionProvider'].","message":"Manually specifying the execution provider order can cause performance degradation if CPU provider is placed before DirectML. Setting providers list correctly is essential.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.24.4':25 '12':21 '3.11':28 'acceler':13 'cadenc':35 'compat':22 'devic':18 'directml':3,7,42 'directx':20 'execut':8 'follow':36 'gpus':23 'hardwar':12 'hardware-acceler':11 'infer':15,46 'learn':45 'machin':44 'machine-learn':43 'maintain':31 'microsoft':33 'ml':14 'onnx':1,4,37,40 'onnxruntim':41 'provid':9 'python':27 'releas':34,39 'requir':26 'runtim':2,5,38 'version':24 'window':17,47","created_at":"2026-05-01T08:11:31.637087+00:00","updated_at":"2026-05-01T08:11:31.637087+00:00","problems":{"verify_error":"× No solution found when resolving dependencies:\n  ╰─▶ Because only the following versions of onnxruntime-directml are\n      available:\n          onnxruntime-directml==1.9.0\n          onnxruntime-directml==1.10.0\n          onnxruntime-directml==1.11.0\n          onnxruntime-directml==1.11.1\n         "},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.24.4","cli_name":"","cli_version":null,"type":"library","homepage":"https://onnxruntime.ai","github":"https://github.com/microsoft/onnxruntime","docs":null,"changelog":null,"pypi":"https://pypi.org/project/onnxruntime-directml/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-06","install_tag":null}}