Independent SDK Containers

Run different compatible SDK builds in separate containers while sharing the same XCENA device. Each container runs its own application and resource daemon (pxl_resourced). The host prepares the devices and monitors usage; it does not run a shared SDK daemon.

flowchart TB
    subgraph Host["One host"]
        direction TB
        A["Container A<br/>SDK X · application · own daemon"]
        B["Container B<br/>SDK Y · application · own daemon"]
        subgraph Device["Shared XCENA device"]
            direction TB
            Metadata["Shared metadata in CXL memory"]
            Resources["Compute resources (Subs)<br/>and device memory"]
            Metadata ---|records ownership| Resources
        end
        A -->|reserve / release| Metadata
        B -->|reserve / release| Metadata
    end

Each application connects to its own container’s daemon. The daemons use the device metadata to coordinate Sub and memory allocations. Containers share a resource pool, not separate virtual devices or automatically equal shares.

Your requirement Use
Containers connect to one host daemon Host Daemon Setup
Each container has its own SDK and daemon This guide

Requirements

  • One Linux x86-64 host, Docker, and compatible coordinator-enabled SDK images.
  • Compatible host SDK tools, mxdriver and ccma, with non-interleaved CXL regions in devdax mode. Setup checks the supported device geometry.
  • A kernel and container seccomp profile that let each daemon obtain a pidfd for a connecting application: SO_PEERPIDFD (Linux 6.5 and later) or pidfd_open (Linux 5.3 and later). Otherwise the daemon refuses the connection, SDK initialization fails, and the daemon log names the failed call.
  • Cooperating, trusted containers. This is not a security boundary against malicious tenants. Rootless Docker and physical multi-host deployments are outside this guide’s supported configuration.

Version compatibility

Each application must use its own container’s SDK and daemon. Different container builds must support the same required device-metadata features; arbitrary older SDK releases are not compatible. A compatible image can replace one tenant at a time. Changing the device-metadata requirements needs device-cold maintenance.

Host preparation

Prepare the host during a maintenance window, with all device users stopped. Install the matching SDK tools and drivers following SDK Installation, keeping ccma installed.

Disable the host SDK daemon and device profiler:

sudo systemctl disable --now pxl_resourced.service xpti-profiled.service

If an older EventHub installation uses pxl_resourced@shared, stop and disable that instance too. Do not mix these modes. That mode required removing ccma; reinstall it with driver/ccma/install.sh and reboot before setup. Recheck the host services after every package upgrade, while tenants are stopped.

If the CXL regions are not in devdax mode, run the host setup from the SDK directory. See devdax mode.

sudo ./scripts/setup_host.sh

Its changes take effect after the power cycle in the next section.

Format the devices

Formatting is destructive to the coordinator metadata. Stop every device user and cold-reset the devices by powering the host off and on. A warm reboot or an empty process list is not proof that the devices are idle. Keep other hosts disconnected.

After startup, wait for the devdax conversion and check the selected devices:

daxctl list -D
sudo pxl-coordinator-setup --devices=0,1 --cold-exclusive-device
sudo pxl-coordinator-status

This example configures devices 0 and 1; use --devices=0 for one device. Setup prints each formatted device’s epoch; record it for device-cold maintenance. The cold-exclusive option is your confirmation of the preparation above; setup cannot verify that preparation for you.

Setup creates the current boot’s configuration and state files and protects the device’s metadata prefix from memory allocation. Start the containers after setup succeeds. Do not repeat setup or delete state files to repair a running tenant. See When setup refuses.

Container start

Use the exact device nodes in /run/pxl-coordinator/config.json; IDs and DAX paths can change after a reboot. The example below assumes configured devices 0/1 use /dev/dax0.0 and /dev/dax12.0. For one device, pass only its nodes.

Replace SDK_IMAGE_A and SDK_IMAGE_B with compatible SDK image references. Both containers get the same configured devices, but their daemon sockets remain private.

coordinator_devices=(--device /dev/ccma --device /dev/dax0.0 --device /dev/dax12.0)
for device in 0 1; do for channel in data context ioctl event bdf; do coordinator_devices+=(--device "/dev/mx_dma/mx_dma${device}_${channel}"); done; done
coordinator_files=(--mount type=bind,src=/run/pxl-coordinator/config.json,dst=/run/pxl-coordinator/config.json,readonly)
for file in /run/pxl-coordinator/*/state /run/pxl-coordinator/*/slots; do coordinator_files+=(--mount "type=bind,src=$file,dst=$file"); done
sudo docker run -d --name pxl-a --init "${coordinator_devices[@]}" "${coordinator_files[@]}" --cap-drop=ALL --security-opt no-new-privileges --tmpfs /run/pxl:mode=0755 -e PXL_COORDINATOR_CONFIG=/run/pxl-coordinator/config.json --entrypoint /usr/local/bin/pxl_resourced SDK_IMAGE_A
sudo docker run -d --name pxl-b --init "${coordinator_devices[@]}" "${coordinator_files[@]}" --cap-drop=ALL --security-opt no-new-privileges --tmpfs /run/pxl:mode=0755 -e PXL_COORDINATOR_CONFIG=/run/pxl-coordinator/config.json --entrypoint /usr/local/bin/pxl_resourced SDK_IMAGE_B
  • Run the daemon and SDK applications as UID 0 inside each container. All capabilities can still be dropped; this is not a rootless setup.
  • Keep the individual file binds above. Do not bind the whole coordinator directory, mount the host daemon socket, or use --privileged or --ipc=host.
  • On SELinux-enabled hosts, these trusted containers may also need --security-opt label=disable; this disables their SELinux confinement.

Check startup with sudo docker logs pxl-a and sudo docker logs pxl-b before running applications.

Run applications

Run your application inside its own SDK container. For example, if the application is installed as /work/my_app in each image:

sudo docker exec pxl-a /work/my_app
sudo docker exec pxl-b /work/my_app

Use the application’s normal device and resource settings. For concurrent work on one device, both workloads’ Sub and memory requests must fit together. An application that reserves all Subs can leave none for another workload.

If the application calls XIF directly rather than only through PXL, and its SDK provides pxl/xif_interop.hpp, call pxl::initializeExternalXif() before its first XIF device call. If it returns false, do not access the devices.

Monitoring

Monitor shared Sub and memory reservations on the host:

sudo pxltop
sudo pxl-coordinator-status

Reported CXL capacity excludes the protected metadata prefix. Reserved usage includes resources still awaiting recovery; missing data is not zero usage. pxltop shows one row per workload, labelled P<participant slot>/W<workload index>.<generation> rather than a host PID, and lists retained resources on a Retained: line. A device whose snapshot cannot be read shows DevN resources unavailable: REASON.

pxl-coordinator-status also reports each device’s recorded_conditions. A condition such as reset_failed_workloads_require_device_maintenance means the retained resources come back only through device-cold maintenance. Each device has 64 participant slots; repeated failures can exhaust them so that a new daemon cannot join. participant_slot_budgets in the status output shows them.

Profiling

Run profiling tools such as xtop inside the application’s container. The host runs no SDK daemon; use pxltop and pxl-coordinator-status there. Profiling capabilities depend on the SDK build in each tenant. Where tenants can capture, concurrent captures on one device share one sampling interval: a capture that asks for another interval is refused until the others end, so match the interval or stop the other capture and retry. Use the profiling instructions and supported tools for that exact release; compatible device metadata alone does not guarantee identical capture or observer behavior.

Shutdown, restart and upgrades

  • Application exit: allocations are released. After a crash, wait for recovery and check usage before assuming resources are reusable.
  • Container stop/start within the same host boot: use docker stop and docker start. After daemon loss, relaunch its applications; in-flight work is not transparently replayed.
  • SDK upgrade: stop that tenant’s applications, then replace its container with a compatible image. Do not overwrite libraries used by live processes.
  • Return to standalone: stop every tenant and power-cycle the host (steps 1-2 of device-cold maintenance), then remove /etc/pxl-coordinator/enabled and enable pxl_resourced and xpti-profiled again. While the marker exists, host SDK processes select coordinator mode and the host pxl_resourced unit does not start. Removing the marker does not release any live allocation.
  • Host reboot or changed metadata requirements: keep tenants stopped and follow the maintenance procedure below. Recreate containers with the new boot’s coordinator file mounts.

Device-cold maintenance

Use this procedure after a host reboot, for an incompatible metadata upgrade, a firmware update, or when recovery of retained resources requires a new device epoch:

  1. Have each device’s epoch at hand: setup printed it at the last format, and sudo pxl-coordinator-status shows it while the boot is provisioned (not after a host reboot). Then stop every tenant and host service using the devices. If changing host packages, install them now and disable the host services.
  2. Power the host off and on to cold-reset the devices. For a firmware update, remove /etc/pxl-coordinator/enabled now (xcena_cli cannot open the devices while it exists), update as in Firmware Update, and power-cycle again. Setup in the next step writes the marker again.
  3. Wait for devdax mode, recheck device IDs, and run setup with the selected devices and --cold-exclusive-device.
  4. If setup refuses an existing epoch, verify it against the recorded epoch and use the exact --replace-epoch option it prints. Do not bypass this check while any device user may still be active.
  5. Recreate the containers using the new configuration and file mounts.

When setup refuses

Read the reason setup prints. Nothing was changed on this host or device. means it refused before device initialization. Fix the cause, but do not delete a valid configuration or reformat a live image.

Failures after device initialization can leave boot-local driver or ccma state. Follow the failure message’s cleanup instructions only for that failed attempt, or schedule device-cold maintenance. Restarting a daemon does not clear an uncertain hardware transaction.

Known limitations

  • Do not pause tenants with docker pause, SIGSTOP or a stopping debugger: a paused process can block other tenants. Stop the tenant normally instead.
  • Reset failures can retain resources; an unanswered reset can block further resets and crash reclamation. Use device-cold maintenance when required; do not retry or clear state to force reuse.
  • Do not submit tasks to a Sub during its reset. Normal SDK Job teardown follows this rule; violating it can stop coordination for the shared device.
  • For Python multiprocessing, use spawn. A child forked after SDK initialization must exec before using the SDK.