jax-ml/jax · error · BufferError

JAX does not support any version below {MIN_DLPACK_VERSION}

Error message

JAX does not support any version below {MIN_DLPACK_VERSION} but version ({max_version}) was requested.

What it means

The consumer requested a DLPack protocol max_version lower than JAX's minimum supported version (MIN_DLPACK_VERSION), so JAX cannot produce a compatible capsule.

Source

Thrown at jax/_src/dlpack.py:172

  # current _to_dlpack as a legacy path for (0,5) <= max_version < (1,0).
  if max_version is None or max_version >= DLPACK_VERSION:
    # Latest
    return _to_dlpack(
      x, stream=stream,
      src_device=src_device,
      device=device,
      copy=copy
    )
  elif max_version >= MIN_DLPACK_VERSION:
    # Oldest supported
    return _to_dlpack(
      x, stream=stream,
      src_device=src_device,
      device=device,
      copy=copy
    )
  else:
    raise BufferError(
      f"JAX does not support any version below {MIN_DLPACK_VERSION} but "
      f"version ({max_version}) was requested."
    )

def _check_device(device, dlpack_device, copy):
  if device and dlpack_device != device:
    if copy is not None and not copy:
      raise ValueError(
        f"Specified {device=} which requires a copy since the source device "
        f"is {repr(dlpack_device)}, however copy=False. Set copy=True or "
        "copy=None to perform the requested operation."
      )

def _place_array(_arr, device, dlpack_device, copy):
  if device and dlpack_device != device:
    return device_put(_arr, device)
  if copy:
    return jnp.array(_arr, copy=True)

View on GitHub (pinned to 1e1c6a8fc0)

Solutions

  1. Upgrade the consuming library (numpy/pytorch) so it requests a supported DLPack version
  2. Omit max_version (or pass None) so the default negotiation is used
  3. Pin JAX to a version whose DLPACK minimum matches your consumer stack

Example fix

# before
jax_arr.__dlpack__(max_version=0)

# after
jax_arr.__dlpack__(max_version=1)  # or omit max_version
Defensive patterns

Strategy: fallback

Validate before calling

from jax._src.dlpack import MIN_DLPACK_VERSION
max_version = max(max_version or 0, MIN_DLPACK_VERSION)

Try / catch

try:
    arr.__dlpack__(max_version=v)
except BufferError:
    arr.__dlpack__()

Prevention

When it happens

Trigger: Calling __dlpack__(max_version=0) or a low version (e.g. requesting legacy DLPack 1.0-unsupported range) from a library pinned to an older DLPack protocol.

Common situations: Older NumPy/PyTorch/torchvision builds calling __dlpack__ with max_version below JAX's floor after a JAX upgrade; mismatched DLPack protocol expectations across library versions.

Related errors


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