xpu-container-run
Launch a Docker container with Intel GPU access on Linux. Encodes the correct combination of `--device /dev/dri`, render-group access, `--ipc=host`…
от intel★ 54 звезды на GitHub
Установить xpu-container-run в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
xpu-container-run
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 cheat sheet
| 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.
Image source
Comes from the runner skill:
- vLLM serving → vllm-xpu-run (
vllm/vllm-openai-xpu:latest) - SGLang → sglang-xpu-run (
lmsysorg/sglang:v<version>-xpu; that skill pins a validated tag — there is nolatest-xpu) - PyTorch / Transformers → torch-xpu-run
<image> below is whichever you picked.
Quickstart — interactive shell, one GPU
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. |
When --privileged is needed
Exception, not rule. Required only for:
unitrace/ VTune collectors that read PMU MSRs.- GPU firmware updates (
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.
Server mode, multi-GPU, --net=host
See 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.
Verifying the container sees the GPU
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 |
Common errors
failed to create shim task: permission denied→ container runtime can't open/dev/dri/card0. Add--privilegedor check host file mode.LIBZE_LOADER: Failed to load level-zero loader→ image missinglibze1/intel-level-zero-gpu. Use a different image.RuntimeError: Cannot find any XPU devices(PyTorch) → Level Zero loaded but no device visible. Re-checkZE_AFFINITY_MASKand runxpu-smi discoveryin the container.bus errorearly in vLLM/PyTorch startup → shared memory too small. Use--ipc=hostor 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) →-itneeds a terminal; CI jobs, agents, andssh host cmdhave none. Drop-itand 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— thendocker exec <name> <cmd>.
Env vars
| Variable | Purpose |
|---|---|
ZE_AFFINITY_MASK |
Which XPU(s) |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/server-and-multi-gpu.md
FAQ
Что делает скилл xpu-container-run?
Launch a Docker container with Intel GPU access on Linux. Encodes the correct combination of `--device /dev/dri`, render-group access, `--ipc=host`, `ZE_AFFINITY_MASK` pinning, Hugging Face cache mount, and `--entrypoint /bin/bash` for interactive use. Use when running any Intel-XPU container (vLLM-XPU, sglang-xpu, torch-XPU, llama.cpp SYCL, etc.) and the device must be visible inside. The CUDA analogue is `docker run --gpus all` — Intel has no `--gpus` flag, you pass the Direct Rendering Manager (DRM) nodes directly.
Как установить скилл xpu-container-run?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл xpu-container-run запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…