Host Daemon Setup (Host-Daemon Mode)
In the default host-daemon mode, run pxl_resourced on the host before using XCENA hardware from Docker. pxl_resourced is the background service that coordinates device resource allocation. Each container connects to the service through a Unix domain socket, a local communication endpoint exposed as a filesystem path. Mount the socket directory into every hardware container so all clients use the same resource manager. This applies to a single container as well as to multiple containers.
Independent SDK containers (shared-device coordinator) are the other mode: each container runs its own daemon, the host daemon stays disabled, and the
--privileged,--ipc=hostand/run/pxloptions below must not be used. Follow that guide instead of this page.
Prerequisites
- XCENA driver installed on the host
pxl_resourcedinstalled and running on the host- Host
libpxl1.4.9 or later (thepxl_resourced.servicemust setRuntimeDirectoryPreserve=yes). On older versions a daemon restart recreates/run/pxl, leaving a container’s mount pointing at a removed directory so it can no longer reach the socket. - Host
libxptiandlibpxlfrom the same SDK release as the container image, installed together as in step 1. The host’s profiling servicexpti-profiledcomes from thatlibxpti. Anxtopthat profiles through it needs the service of its own SDK (XPTI 1.6.0 or newer for this release) and refuses an older one withprofiling daemon lacks compact catalog recording. - Docker Engine installed on the host
1. Install libpxl on the host
The host needs libpxl (which includes pxl_resourced) installed so it can manage device resources across containers.
If you have the SDK package:
wget <URL_to_sdk_xxx.tar.xz>
tar -xvf sdk_xxx.tar.xz
cd sdk_xxx
sudo dpkg --auto-deconfigure --force-overwrite -i lib/xpti/libxpti_*.deb lib/pxl/libpxl_*.deb
Or copy the deb packages from an existing Docker container. docker cp does not expand wildcards inside the container, so copy the directories and select the packages locally:
# e.g., docker cp xcena_sdk:/work/lib/pxl ./pxl
docker cp <container>:/work/lib/pxl ./pxl
docker cp <container>:/work/lib/xpti ./xpti
sudo dpkg --auto-deconfigure --force-overwrite -i xpti/libxpti_*.deb pxl/libpxl_*.deb
Keep XPTI and PXL in the same transaction. --auto-deconfigure lets dpkg temporarily deconfigure an installed older PXL while replacing XPTI; the new PXL is then configured against the matching runtime. Omitting it can leave the new PXL unpacked beside the old XPTI because of the ABI Breaks relation. --force-overwrite matches the SDK installer and transfers XPTI headers that older PXL packages incorrectly claimed, avoiding a file ownership collision during the paired upgrade.
2. Verify pxl_resourced is running on the host
Installing the libpxl deb package automatically registers pxl_resourced as a systemd service. Verify that it is running:
systemctl status pxl_resourced
Verify that the service socket is created:
ls -la /run/pxl/pxld.sock
3. Run Docker containers
Start each container with the following options to connect to the host daemon:
mkdir -p "$PWD/xtop-out"
docker run -it --rm \
--privileged \
--pid=host \
--ipc=host \
--cgroupns=host \
-e SYSTEMD_IGNORE_CHROOT=1 \
-v /run/systemd:/run/systemd \
-v /run/dbus:/run/dbus \
-v /tmp/pxl:/tmp/pxl \
-v /run/pxl:/run/pxl \
-v /dev:/dev \
-v /sys:/sys \
-v "$PWD/xtop-out:/xtop-out" \
--name <container> xcenadev/sdk:<tag> \
/bin/bash
| Option | Purpose |
|---|---|
--privileged | Grants access to host devices |
--pid=host | Shares the host PID namespace |
--ipc=host | Shares the host IPC namespace (System V / POSIX shared memory) |
--cgroupns=host | Shares the host cgroup namespace |
-e SYSTEMD_IGNORE_CHROOT=1 | Lets systemd tooling run inside the container |
-v /run/systemd:/run/systemd | Exposes the host systemd runtime |
-v /run/dbus:/run/dbus | Exposes the host D-Bus (for systemd communication) |
-v /run/pxl:/run/pxl | Mounts the pxl_resourced UDS socket (pxld.sock) for daemon communication |
-v /tmp/pxl:/tmp/pxl | Mounts the daemon log / legacy fallback socket directory |
-v /dev:/dev | Exposes host device nodes |
-v /sys:/sys | Exposes host sysfs |
-v "$PWD/xtop-out:/xtop-out" | Persists attach .xpti files on the host |
4. Verify
Inside the container, check that the host daemon’s socket is visible:
ls -la /run/pxl/pxld.sock
Then verify device access:
xcena_cli num-device
Each container should report the same device(s) as the host.
Check the command’s error output as well as the device count. If libpxl cannot connect to the resource daemon, it prints Resource Manager daemon is not running and starts an in-process manager. Device enumeration can still succeed in that state. Resolve the socket connection before running hardware workloads in containers.
Security note:
--privileged,--pid=host,--ipc=host,--cgroupns=host, and the host/runbind mounts (/run/systemd,/run/dbus,/run/pxl) reduce container isolation. Use these options only in controlled environments with trusted images.
Attach inside Docker
The pxl_resourced setup above provides hardware access. Use the canonical xtop attach Docker workflow for the target/PID procedure. This page only adds the Docker-specific requirements:
- Keep the target and
xtop attachin the same container and run both as the same user. Save and reuse the target PID from the shell that started it; do not reselect a host-wide PID withps -eowhen--pid=hostis enabled. - The
docker runcommand above mounts./xtop-outfrom the host. Pass-o /xtop-outso the.xptifiles survive the--rmcontainer. - The hardware mount may expose
/run/pxl/pxl_prof.sock, which makesxtoptry shared daemon mode first. For the standalone per-process flow, force the per-process endpoint with:
XPTI_DAEMON_SOCKET=/dev/null xtop attach --pid "$target_pid" -o /xtop-out
/dev/null is intentionally not a Unix socket. It disables daemon autodiscovery for this command. For daemon-mode capture instead, configure the target to report to the shared profiling daemon and omit the override.