{"record":{"id":"e26ccda86a69135e","repo":"docling-project/docling","slug":"xpu-is-not-available-in-the-system-please-ensure","errorCode":null,"errorMessage":"XPU is not available in the system. Please ensure PyTorch with Intel XPU support is installed, or use --device auto/cpu.","messagePattern":"XPU is not available in the system\\. Please ensure PyTorch with Intel XPU support is installed, or use --device auto/cpu\\.","errorType":"exception","errorClass":"AcceleratorDeviceNotAvailableError","httpStatus":null,"severity":"error","filePath":"docling/utils/accelerator_utils.py","lineNumber":119,"sourceCode":"        else:\n            raise AcceleratorDeviceNotAvailableError(\n                \"MPS is not available in the system. \"\n                \"Please ensure you are running on Apple Silicon with MPS support, or use --device auto/cpu.\"\n            )\n\n    elif accelerator_device == AcceleratorDevice.XPU.value:\n        if (\n            supported_devices is not None\n            and AcceleratorDevice.XPU not in supported_devices\n        ):\n            raise AcceleratorDeviceNotAvailableError(\n                f\"XPU is not supported by this model. Supported devices: {[d.value for d in supported_devices]}\"\n            )\n\n        if has_xpu:\n            device = \"xpu\"\n        else:\n            raise AcceleratorDeviceNotAvailableError(\n                \"XPU is not available in the system. \"\n                \"Please ensure PyTorch with Intel XPU support is installed, or use --device auto/cpu.\"\n            )\n\n    elif accelerator_device == AcceleratorDevice.CPU.value:\n        device = \"cpu\"\n\n    else:\n        raise AcceleratorDeviceNotAvailableError(\n            f\"Unknown device option '{accelerator_device}'. \"\n            f\"Valid options are: auto, cpu, cuda, mps, xpu, or cuda:N\"\n        )\n\n    _log.info(\"Accelerator device: '%s'\", device)\n    return device\n","sourceCodeStart":101,"sourceCodeEnd":135,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/utils/accelerator_utils.py#L101-L135","documentation":"AcceleratorDeviceNotAvailableError raised by decide_device() when the user requests 'xpu' but the runtime lacks Intel XPU: torch has no 'xpu' attribute or torch.xpu.is_available() is false. PyTorch must be a build with Intel XPU support (e.g. intel-extension builds / upstream XPU-enabled wheels) and an Intel GPU driver must be present.","triggerScenarios":"Setting accelerator_device='xpu' on machines without Intel discrete GPUs, with stock CPU/CUDA PyTorch wheels (no torch.xpu module), or with missing/old Intel GPU drivers; also when supported_devices filtering cleared the has_xpu flag.","commonSituations":"Config written for Intel GPU nodes run elsewhere; installing regular pip torch which lacks XPU; driver/intel-extension version mismatch after upgrades.","solutions":["Verify with python -c \"import torch; print(hasattr(torch, 'xpu') and torch.xpu.is_available())\"","Install a PyTorch build with Intel XPU support and matching drivers (intel-extension-for-pytorch where required)","Or switch to accelerator_device='auto'/'cpu'","Keep the xpu setting scoped to the Intel GPU hosts only"],"exampleFix":"# before\naccelerator_options.accelerator_device = \"xpu\"  # stock torch wheel\n\n# after\naccelerator_options.accelerator_device = \"auto\"","handlingStrategy":"validation","validationCode":"import torch\n\nxpu_ok = hasattr(torch, \"xpu\") and torch.xpu.is_available()\nif not xpu_ok:\n    accelerator_options.accelerator_device = \"auto\"","typeGuard":"def xpu_available() -> bool:\n    import torch\n    return hasattr(torch, \"xpu\") and torch.xpu.is_available()","tryCatchPattern":"from docling.exceptions import AcceleratorDeviceNotAvailableError\n\ntry:\n    device = decide_device(\"xpu\")\nexcept AcceleratorDeviceNotAvailableError:\n    device = decide_device(\"auto\")","preventionTips":["Check hasattr(torch, 'xpu') and torch.xpu.is_available() before requesting XPU","Install XPU-enabled PyTorch builds with matching Intel drivers","Don't reuse Intel-node configs on CUDA/CPU machines","Use 'auto' for portable configuration"],"tags":["xpu","accelerator","environment","intel-gpu","pytorch"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}