From d152ccb9f3699eb939dab2eb1b158f10aa976ef2 Mon Sep 17 00:00:00 2001 From: scott Date: Mon, 6 Apr 2026 20:48:18 -0400 Subject: [PATCH] =?UTF-8?q?Fall=20back=20to=20CPU=20=E2=80=94=20onnxruntim?= =?UTF-8?q?e-rocm=20PyPI=20build=20lacks=20RDNA2=20(gfx1031)=20kernels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit onnxruntime-rocm is compiled for CDNA datacenter GPUs (gfx908/gfx90a/gfx942). RX 6700 XT (gfx1031/RDNA2) has no matching HIP kernel binary, causing hipErrorNoBinaryForGpu at inference time. CPU execution provider works correctly; GPU path can be revisited with a custom onnxruntime build. Co-Authored-By: Claude Sonnet 4.6 --- engine.py | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/engine.py b/engine.py index 3b7fe93..28b92c4 100644 --- a/engine.py +++ b/engine.py @@ -26,30 +26,19 @@ _cond_cache: Dict[str, Dict[str, np.ndarray]] = {} def detect_device() -> str: - try: - import onnxruntime as ort - available = ort.get_available_providers() - if "ROCMExecutionProvider" in available or "MIGraphXExecutionProvider" in available: - return "rocm" - except Exception: - pass return "cpu" def _get_providers(device: str) -> list: - if device not in ("rocm", "cuda"): - return ["CPUExecutionProvider"] - + # onnxruntime-rocm from PyPI is compiled for CDNA datacenter GPUs only + # (gfx908/gfx90a/gfx942). RDNA2 (gfx1031) has no compatible HIP kernel + # binary, producing hipErrorNoBinaryForGpu at inference time even though + # the session creates successfully. CPU provider used until a ROCm build + # that includes RDNA2 targets is available. import onnxruntime as ort - available = set(ort.get_available_providers()) - providers = [] - # MIGraphXExecutionProvider excluded — symbol mismatch between onnxruntime-rocm - # and apt migraphx; ROCMExecutionProvider covers GPU execution adequately. - if "ROCMExecutionProvider" in available: - providers.append(("ROCMExecutionProvider", {"device_id": 0})) - providers.append("CPUExecutionProvider") - logger.info(f"Available ORT providers: {available}") - return providers + available = ort.get_available_providers() + logger.info(f"Available ORT providers: {available} — using CPUExecutionProvider (RDNA2 not supported by this onnxruntime-rocm build)") + return ["CPUExecutionProvider"] def _ort_type_to_np(ort_type: str):