ROCm / AMD
Verified by owner

ROCm: HIP error: invalid device — no GPU detected

HIP error: invalid device function / hipErrorNoDevice
By Fredoline Eruo · Last verified May 6, 2026

Cause

Common on AMD GPU + Linux when ROCm doesn't see your card. Causes:

  • GPU isn't on the supported list for your ROCm version (officially supports Vega 20, RDNA 2/3/4 — RDNA 1 is partial, Polaris is unsupported as of ROCm 6)
  • User isn't in the render and video groups
  • Conflicting GPU driver (proprietary vs amdgpu)
  • ROCm version mismatch with kernel

Solution

1. Verify your card is supported:

# Check ROCm version
rocminfo | grep -i version
# Check detected devices
rocm-smi

RX 6000 / 7000 / 9000 series and Radeon PRO W6800+ are supported on Linux. RX 5000 (RDNA 1) is hit-or-miss. RX 580 (Polaris) needs old ROCm 5.

2. Add yourself to the right groups:

sudo usermod -a -G render,video $USER
# Log out and back in for the change to take effect

3. Force the right device via env var (helpful for unsupported cards that ALMOST work):

export HSA_OVERRIDE_GFX_VERSION=10.3.0  # for RDNA 2 / RX 6000 series
export HSA_OVERRIDE_GFX_VERSION=11.0.0  # for RDNA 3 / RX 7000 series

4. Check kernel module:

lsmod | grep amdgpu
# If missing:
sudo modprobe amdgpu

Windows: ROCm support is incomplete. Use Vulkan backend in llama.cpp instead, or run in WSL2 with ROCm-on-WSL.

Did this fix it?

If your case was different, email hello@runlocalai.co 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.