RUNLOCALAIv38
→WILL IT RUNBEST GPUCOMPARETROUBLESHOOTSTARTPULSEMODELSHARDWARETOOLSBENCH
RUNLOCALAI

Operator-grade instrument for local-AI hardware intelligence. Hand-written verdicts. Real benchmarks. Reproducible commands.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
  • Will it run?
GUIDES
  • Best GPU
  • Best laptop
  • Best Mac
  • Best used GPU
  • Best budget GPU
  • Best GPU for Ollama
  • Best GPU for SD
  • AI PC build $2K
  • CUDA vs ROCm
  • 16 vs 24 GB
  • Compare hardware
  • Custom compare
REF
  • Systems
  • Ecosystem maps
  • Pillar guides
  • Methodology
  • Glossary
  • Errors KB
  • Troubleshooting
  • Resources
  • Public API
EDITOR
  • About
  • About the author
  • Changelog
  • Latest
  • Updates
  • Submit benchmark
  • Send feedback
  • Trust
  • Editorial policy
  • How we make money
  • 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 →

SYS · ONLINEUPTIME · 100%2026 · operator-owned
RUNLOCALAI · v38
Errors / ROCm / AMD / ROCm: HIP error: invalid device function
ROCm / AMD

ROCm: HIP error: invalid device function

HIP error: invalid device function
By Fredoline Eruo · Last verified May 8, 2026

Cause

The HIP kernel was compiled for a different GPU architecture than the one you're running on. Each AMD GPU has a gfx target (gfx1100 = RX 7900 XTX, gfx1030 = RX 6900 XT, gfx906 = MI50, etc.). PyTorch ROCm wheels and llama.cpp ROCm builds embed kernels for a specific subset of targets; if your GPU's gfx isn't in the list, every kernel launch fails this way.

Solution

1. Identify your gfx target:

rocminfo | grep gfx
# or
rocm-smi --showproductname

2. For PyTorch: override with HSA_OVERRIDE_GFX_VERSION to the closest officially-supported target. Common case: RX 6700/6800 (gfx1031/1032) needs to pretend it's gfx1030:

export HSA_OVERRIDE_GFX_VERSION=10.3.0
python your_script.py

3. For llama.cpp: rebuild with your gfx explicitly:

make GGML_HIPBLAS=1 \
  AMDGPU_TARGETS=gfx1100 \
  HIPCXX=/opt/rocm/llvm/bin/clang++ -j

4. Use the official AMD PyTorch wheels matching your ROCm version:

pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm6.2

5. RDNA3 (RX 7000) specific: ROCm 6.0+ supports gfx1100 natively — older 5.x toolchains do not. Update if you're on an older release.

Related errors

  • ROCm: HIP error: invalid device — no GPU detected
  • ROCm: HSA_STATUS_ERROR_INVALID_DEVICE — GPU not detected

Did this fix it?

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