jax-ml/jax · error · RuntimeError

Unknown backend: ' ' requested, but no platforms that are…

Error message

Unknown backend: '{platform}' requested, but no platforms that are instances of {platform} are present. Platforms present are: 

What it means

Raised by canonicalize_platform when a platform alias (e.g. 'gpu') was requested but none of the concrete platforms it maps to (cuda/rocm/oneapi) are registered/initialized. Indicates no matching hardware/backend is available for the requested platform.

Solutions

  1. Set JAX_PLATFORMS='' to let JAX auto-select an available backend
  2. Install/repair the backend plugin for the requested platform (e.g. jax[cuda])
  3. Check the platform name spelling against the registered backends
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at jax/_src/xla_bridge.py:745 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27). Data as JSON: /api/errors/1a370335f588147f. Report an issue: GitHub.

Appendix: source

Thrown at jax/_src/xla_bridge.py:745


def canonicalize_platform(platform: str) -> str:
  """Replaces platform aliases with their concrete equivalent.

  In particular, replaces "gpu" with either "cuda", "oneapi" or "rocm", depending on which
  hardware is actually present. We want to distinguish "cuda", "oneapi" and "rocm" for
  purposes such as MLIR lowering rules, but in many cases we don't want to
  force users to care.
  """
  platforms = _alias_to_platforms.get(platform, None)
  if platforms is None:
    return platform

  b = backends()
  for p in platforms:
    if p in b.keys():
      return p
  raise RuntimeError(f"Unknown backend: '{platform}' requested, but no "
                     f"platforms that are instances of {platform} are present. "
                     "Platforms present are: " + ",".join(b.keys()))


def expand_platform_alias(platform: str) -> list[str]:
  """Expands, e.g., "gpu" to ["cuda", "rocm", "oneapi"].

  This is used for convenience reasons: we expect cuda and rocm to act similarly
  in many respects since they share most of the same code.
  """
  return _alias_to_platforms.get(platform, [platform])


def backends_are_initialized() -> bool:
  "Returns true if backends have already been initialized."
  with _backend_lock:
    return len(_backends) != 0

View on GitHub (pinned to 1e1c6a8fc0)