RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Errors / Configuration / Windows DirectML model runs on CPU instead of GPU
Configuration

Windows DirectML model runs on CPU instead of GPU

(no error — onnxruntime falls back to CPUExecutionProvider despite DirectML wheel installed)
By Fredoline Eruo · Last verified Jun 12, 2026

Cause

Environment: Windows 10/11 running ONNX Runtime with DirectML provider — typical for AMD/Intel GPUs and integrated graphics where CUDA isn't available.

Severity: medium — works, but at a fraction of expected speed.

  • onnxruntime (CPU-only) was installed instead of onnxruntime-directml
  • DmlExecutionProvider isn't first in the providers list — ORT picks the highest-priority one
  • Model uses fp16 ops that the GPU's DirectML driver doesn't support; ORT silently falls back
  • Old GPU driver predates DirectML 1.13 features the model uses
  • Mixed environment with both onnxruntime and onnxruntime-directml installed; pip resolves to the wrong one

Solution

1. Install the DirectML build (and only the DirectML build):

pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-directml
pip install onnxruntime-directml

2. Force DmlExecutionProvider first:

import onnxruntime as ort
sess = ort.InferenceSession(
    "model.onnx",
    providers=[
        ("DmlExecutionProvider", {"device_id": 0}),
        "CPUExecutionProvider"
    ]
)
print(sess.get_providers())  # should show DmlExecutionProvider first

3. Check the GPU is actually picked up:

# In another window while inference runs
Get-Counter '\GPU Engine(*engtype_3D)\Utilization Percentage'

If GPU stays at 0%, DML isn't being used.

4. Update the GPU driver — DirectML rides on DXGI/D3D12. AMD Adrenalin or Intel Arc Control should be the latest stable.

5. Convert fp16-only ops to fp32 if a specific operator is unsupported:

from onnxruntime.transformers.float16 import convert_float_to_float16
# Inverse: convert specific ops back to fp32

6. Verify the wheel target:

python -c "import onnxruntime; print(onnxruntime.get_available_providers())"
# Must include 'DmlExecutionProvider'

Related errors

  • Ollama: Error: model 'X' not found
  • Ollama: bind: address already in use (port 11434)
  • Ollama: connection refused on localhost:11434
  • Ollama truncates input — default context length is only 2048
  • Token generation slows as conversation gets longer

Did this fix it?

If your case was different, email Contact support with what you saw and we'll update the page. If it worked but took different commands on your platform, we want to know that too.