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 / 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: hipErrorInvalidDeviceFunction on RX 7000-series
  • ROCm: HSA_STATUS_ERROR_INVALID_DEVICE — GPU not detected

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.