{"record":{"id":"d2dc226bf8c057e0","repo":"jax-ml/jax","slug":"jax-does-not-support-any-version-below-min-dlpack","errorCode":null,"errorMessage":"JAX does not support any version below {MIN_DLPACK_VERSION} but version ({max_version}) was requested.","messagePattern":"JAX does not support any version below (.+?) but version \\((.+?)\\) was requested\\.","errorType":"exception","errorClass":"BufferError","httpStatus":null,"severity":"error","filePath":"jax/_src/dlpack.py","lineNumber":172,"sourceCode":"  # current _to_dlpack as a legacy path for (0,5) <= max_version < (1,0).\n  if max_version is None or max_version >= DLPACK_VERSION:\n    # Latest\n    return _to_dlpack(\n      x, stream=stream,\n      src_device=src_device,\n      device=device,\n      copy=copy\n    )\n  elif max_version >= MIN_DLPACK_VERSION:\n    # Oldest supported\n    return _to_dlpack(\n      x, stream=stream,\n      src_device=src_device,\n      device=device,\n      copy=copy\n    )\n  else:\n    raise BufferError(\n      f\"JAX does not support any version below {MIN_DLPACK_VERSION} but \"\n      f\"version ({max_version}) was requested.\"\n    )\n\ndef _check_device(device, dlpack_device, copy):\n  if device and dlpack_device != device:\n    if copy is not None and not copy:\n      raise ValueError(\n        f\"Specified {device=} which requires a copy since the source device \"\n        f\"is {repr(dlpack_device)}, however copy=False. Set copy=True or \"\n        \"copy=None to perform the requested operation.\"\n      )\n\ndef _place_array(_arr, device, dlpack_device, copy):\n  if device and dlpack_device != device:\n    return device_put(_arr, device)\n  if copy:\n    return jnp.array(_arr, copy=True)","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/dlpack.py#L154-L190","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade the consuming library (numpy/pytorch) so it requests a supported DLPack version","Omit max_version (or pass None) so the default negotiation is used","Pin JAX to a version whose DLPACK minimum matches your consumer stack"],"exampleFix":"# before\njax_arr.__dlpack__(max_version=0)\n\n# after\njax_arr.__dlpack__(max_version=1)  # or omit max_version","handlingStrategy":"fallback","validationCode":"from jax._src.dlpack import MIN_DLPACK_VERSION\nmax_version = max(max_version or 0, MIN_DLPACK_VERSION)","typeGuard":null,"tryCatchPattern":"try:\n    arr.__dlpack__(max_version=v)\nexcept BufferError:\n    arr.__dlpack__()","preventionTips":["Keep numpy/pytorch current so DLPack negotiation matches JAX","Prefer omitting max_version to use defaults"],"tags":["jax","dlpack","version-negotiation","protocol"],"backgroundTag":"protocol-version-mismatch","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}