Docker Compose XPU profile builds CUDA PyTorch (+cu130) instead of XPU PyTorch on Intel Arc
Summary
The Docker Compose xpu profile does not produce an Intel XPU-enabled PyTorch environment.
Although the container is named/tagged as athomasson2/ebook2audiobook:xpu and /dev/dri is passed into the container, it contains CUDA PyTorch:
torch: 2.11.0+cu130
torch.xpu.is_available(): Falseebook2audiobook subsequently reports that XPU is unsupported and falls back to CPU.
Environment
- Host OS: CachyOS (Arch Linux)
- GPU: Intel Arc B580 / Battlemage G21 (
8086:e20b) - Kernel driver:
xe - Docker version:
29.7.1 - Compose version:
v2.17.2 - ebook2audiobook commit:
4b182a3dc60e642901042de333b2f4e1b69dfe72
Host-side XPU works correctly outside the container:
Torch version: 2.13.0+xpu
XPU available: True
XPU device: Intel(R) Arc(TM) B580 GraphicsReproduction
git clone https://github.com/DrewThomasson/ebook2audiobook.git
cd ebook2audiobook
DEVICE_TAG=xpu docker compose --profile xpu up --buildThen, after the container starts:
docker compose exec ebook2audiobook-xpu python -c \
'import torch; print(torch.__version__); print("XPU:", torch.xpu.is_available())'Actual result
2.11.0+cu130
XPU: FalseThe UI reports XPU is not supported and falls back to CPU.
Expected result
The xpu profile should install an XPU PyTorch wheel, such that:
<torch version ending in +xpu>
XPU: True
Intel(R) Arc(TM) B580 GraphicsSuspected cause
docker-compose.yml passes only DEVICE_TAG:
build:
args:
APP_VERSION: ${APP_VERSION:-26.8.3}
DEVICE_TAG: ${DEVICE_TAG:-cpu}However, Dockerfile defaults DOCKER_DEVICE_STR to a CUDA descriptor:
ARG DOCKER_DEVICE_STR='{"name": "cuda", ..., "tag": "cu130", ...}'The Dockerfile then invokes:
RUN ./ebook2audiobook.command --script_mode build_docker \
--docker_device "$DOCKER_DEVICE_STR"Therefore DEVICE_TAG=xpu changes the image tag to :xpu, but the build process is still given a CUDA device descriptor and installs CUDA PyTorch.
I could not find an XPU DOCKER_DEVICE_STR definition in the repository or an XPU Docker build in the GitHub Actions workflow; the workflow only includes CPU and CUDA device descriptors.
Separate container-start issue
The unmodified XPU Compose profile also failed on startup with:
Error response from daemon: unable to find group render: no matching entries in group fileThe service uses:
group_add:
- renderbut the container image does not contain a group named render.
As a local workaround, I changed that entry to the numeric GID of /dev/dri/renderD128 on the host. Using a numeric configurable render GID, or creating the render group in the image, would make the XPU profile start without manual edits.
❯ git rev-parse HEAD docker version docker compose version lspci -k -s 03:00.0 4b182a3dc60e642901042de333b2f4e1b69dfe72 Client: Version: 29.7.2 API version: 1.55 Go version: go1.26.5-X:nodwarf5 Git commit: a7dcaa6fdb Built: Thu Aug 6 16:36:45 2026 OS/Arch: linux/amd64 Context: default
Server: Engine: Version: 29.7.1 API version: 1.55 (minimum version 1.40) Go version: go1.26.5-X:nodwarf5 Git commit: c5b8ce9274 Built: Sun Aug 2 15:01:26 2026 OS/Arch: linux/amd64 Experimental: false containerd: Version: v2.3.3 GitCommit: aad11006b869517fcd3009450b6f82da282e1a9b.m runc: Version: 1.5.1 GitCommit: 1.5.1-1-0-gce23c4c-dirty docker-init: Version: 0.19.0 GitCommit: de40ad0 Docker Compose version v2.17.2 03:00.0 VGA compatible controller: Intel Corporation Battlemage G21 [Arc B580] Subsystem: Sparkle Computer Co., Ltd. Device 4215 Kernel driver in use: xe Kernel modules: xe
~/Documents/ebook2audiobook main* ❯ docker inspect -f '{{.Config.Image}}' ebook2audiobook-ebook2audiobook-xpu-1 athomasson2/ebook2audiobook:xpu
~/Documents/ebook2audiobook main*
❯ docker compose exec ebook2audiobook-xpu python -c
'import torch; print(torch.version); print("XPU:", torch.xpu.is_available())'
2.11.0+cu130
XPU: False
~/Documents/ebook2audiobook main*
❯ python_env/bin/python -c
'import torch; print(torch.version); print("XPU:", torch.xpu.is_available()); print(torch.xpu.get_device_name(0) if torch.xpu.is_available() else "N/A")'
2.11.0+cpu
XPU: False
N/A
Source: DrewThomasson/ebook2audiobook