Launches Docker containers with Intel GPU (XPU) access on Linux by passing DRM nodes, render-group GID, IPC host, and ZE_AFFINITY_MASK. Use for vLLM-XPU, sglang-xpu, torch-XPU, or llama.cpp SYCL containers.
Ships in xpu-container-run. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Intel GPUs do not plug into Docker via --gpus all. There is no
nvidia-container-toolkit equivalent. Pass the kernel's Direct
Rendering Manager (DRM) character devices into the container and
grant the right group ownership.
| CUDA | Intel |
|---|---|
docker run --gpus all | --device /dev/dri --group-add "$(getent group render | cut -d: -f3)" |
docker run --gpus '"device=0"' | -e ZE_AFFINITY_MASK=0 |
--ipc=host | same |
--shm-size=16g | same (alternative to --ipc=host) |
--runtime nvidia | nothing — xe/i915 is in-kernel |
nvidia-smi inside container | xpu-smi discovery |
No "Intel container toolkit" needed; passing the DRM nodes is enough.
Comes from the runner skill:
vllm/vllm-openai-xpu:latest)lmsysorg/sglang:v<version>-xpu; that skill
pins a validated tag — there is no latest-xpu)<image> below is whichever you picked.
Confirm the image name with the user before running — this binds host GPU devices into the container.
docker run --rm -it \
--device /dev/dri \
--group-add "$(getent group render | cut -d: -f3)" \
--ipc=host \
-e ZE_AFFINITY_MASK=0 \
-e HF_TOKEN="$HF_TOKEN" \
-v "$HOME/.cache/huggingface:/root/.cache/huggingface" \
--entrypoint /bin/bash \
<image>
| Flag | Why |
|---|---|
--rm -it | Interactive shell, removed on exit. -it needs a real terminal — from CI, an agent, or ssh host cmd, drop it (see Common errors). |
--device /dev/dri | Pass every Intel GPU's DRM nodes. Use --device /dev/dri/renderD128 for just the first GPU's render node (least privilege). |
--group-add "$(getent group render | cut -d: -f3)" | Joins the container user to the host's render group by GID (not name) so it works in images where a render group with a different GID — or no render group at all — exists. Required when nodes are mode 0660/0640. Skip causes EACCES on Level Zero init. |
--ipc=host | vLLM and torch.distributed use /dev/shm and POSIX semaphores. --shm-size=16g is a private-IPC alternative. |
-e ZE_AFFINITY_MASK=0 | Pin to GPU 0. See xpu-discover for IDs. Always set explicitly. |
-v ~/.cache/huggingface:... | Share the host model cache; avoid re-download. |
--entrypoint /bin/bash | Override server-image autostart for interactive use. |
--privileged is neededException, not rule. Required only for:
unitrace / VTune collectors that read PMU MSRs.xpu-smi updatefw).xpu-smi diag --singletest 5 (PCIe bandwidth) and similar
low-level diag tests.For running models and most profiling, --device /dev/dri is
enough. Add --privileged only when you hit a specific permission
failure pointing at it.
--net=hostSee references/server-and-multi-gpu.md for daemon-style server
launches, one-process-per-GPU vs single-process TP / PP layouts,
the oneCCL CCL_ZE_IPC_EXCHANGE=pidfd setting for multi-XPU TP,
and when --net=host is actually needed.
xpu-smi discovery
| Symptom | Cause | Fix |
|---|---|---|
xpu-smi: command not found | image lacks xpu-smi | use a different image or skip this check |
empty discovery table | no /dev/dri passed | add --device /dev/dri |
Level Zero init failed / EACCES | user not in render group | add `--group-add "$(getent group render |
| wrong GPU count | ZE_AFFINITY_MASK inherited from host | pass mask explicitly with -e |
diag works on host, fails in container | container not privileged | add --privileged, or skip diag inside container |
failed to create shim task: permission denied → container
runtime can't open /dev/dri/card0. Add --privileged or check
host file mode.LIBZE_LOADER: Failed to load level-zero loader → image missing
libze1 / intel-level-zero-gpu. Use a different image.RuntimeError: Cannot find any XPU devices (PyTorch) → Level
Zero loaded but no device visible. Re-check ZE_AFFINITY_MASK
and run xpu-smi discovery in the container.bus error early in vLLM/PyTorch startup → shared memory too
small. Use --ipc=host or raise --shm-size.the input device is not a TTY (newer Docker: cannot attach stdin to a TTY-enabled container because stdin is not a terminal) → -it needs a
terminal; CI jobs, agents, and ssh host cmd have none. Drop -it and pass
the command: docker run --rm ... --entrypoint /bin/bash <image> -c "<cmd>".
For several steps, keep it alive instead — docker run -d --name <name> ... --entrypoint sleep <image> infinity — then docker exec <name> <cmd>.| Variable | Purpose |
|---|---|
ZE_AFFINITY_MASK | Which XPU(s) visible. |
HF_TOKEN | Hugging Face auth. |
HF_HOME | Override in-container HF cache path. |
HUGGINGFACE_HUB_CACHE | Older alias; some images still use it. |
OMP_NUM_THREADS | Cap CPU threads; 1 for single-process serving. |
CCL_ZE_IPC_EXCHANGE=pidfd | Multi-GPU-friendly oneCCL IPC mechanism. |
IGC_EnableAluBinding=1 | Battlemage matmul-codegen hint; bench both. |
ONEAPI_DEVICE_SELECTOR=level_zero:0 | Belt-and-suspenders pin alongside ZE_AFFINITY_MASK. |
references/server-and-multi-gpu.md — server mode, multi-GPU, --net=hostxe driver: https://docs.kernel.org/gpu/xe/index.htmlWhat SKILL.md sets; muted values are Claude Code's defaults
/xpu-container-run:xpu-container-runfrom xpu-container-run
npx claudepluginhub intel/gpu-ai-skills --plugin xpu-container-runOther plugins' skills for the same job