ComputeDomain workloads
For background on what a ComputeDomain is and how it fits together, see
ComputeDomains.
Prerequisites
Refer to Prerequisites for hardware and software requirements, including the ComputeDomain-specific requirements for Multi-Node NVLink hardware, nvidia.com/gpu.clique label ownership, and nvidia-imex service configuration.
Create a ComputeDomain
The minimal ComputeDomain spec requires only the name of the ResourceClaimTemplate the controller will create for channel allocation:
apiVersion: resource.nvidia.com/v1beta1
kind: ComputeDomain
metadata:
name: my-compute-domain
spec:
numNodes: 0
channel:
resourceClaimTemplate:
name: imex-channel-0
numNodes is deprecated. Set it to 0 (the recommended value when IMEXDaemonsWithDNSNames is enabled — its default state).
After applying this resource, the controller creates:
- A per-domain
DaemonSetofcompute-domain-daemonpods, one per GPU node. - A
ResourceClaimTemplatenamedimex-channel-0, which workload pods use to request a channel.
These objects describe the default driverManaged mode.
In hostManaged mode, the controller creates the workload ResourceClaimTemplate but does not create the per-domain daemon DaemonSet.
The host service must be ready through its configured command socket before a workload claim can prepare.
Host-managed mode currently provides domain isolation and channel 0 only, even if the ComputeDomain requests allocationMode: All.
See Host-managed IMEX before you select this mode.
Use the channel in a workload
Reference the ResourceClaimTemplate name you set in spec.channel.resourceClaimTemplate.name when writing your workload:
apiVersion: v1
kind: Pod
metadata:
name: my-workload
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: nvidia.com/gpu.clique
operator: Exists
containers:
- name: app
image: ubuntu:22.04
command: ["bash", "-c"]
args:
- |
set -eu
test -c /dev/nvidia-caps-imex-channels/channel0
echo "IMEX channel0 is available"
ls -la /dev/nvidia-caps-imex-channels
sleep 9999
resources:
claims:
- name: imex-channel-0
resourceClaims:
- name: imex-channel-0
resourceClaimTemplateName: imex-channel-0
The required node affinity prevents the workload from being used as a false-positive
test on a node that is not part of an NVLink clique.
The pod will not start until the local IMEX daemon is ready, and its startup command
fails unless channel0 is a character device.
After the pod starts, verify the device explicitly; Running by itself is not a
successful IMEX validation:
kubectl exec my-workload -- test -c /dev/nvidia-caps-imex-channels/channel0
kubectl logs my-workload
The first command must exit successfully, and the logs must include
IMEX channel0 is available.
Channel allocation modes
In driverManaged mode, the spec.channel.allocationMode field controls how many
IMEX channels are injected:
| Mode | Value | Description |
|---|---|---|
| Single | Single (default) | Injects a single IMEX channel into the workload container |
| All | All | Injects all available IMEX channels (up to the hardware maximum) |
Use All only in driverManaged mode for workloads that need access to every
channel in the IMEX domain.
In hostManaged mode, domain isolation shares channel 0 among workloads.
The controller forces the generated workload claim to Single, so a requested
All is equivalent to Single when using host-managed mode and does not expose additional channels.
Check status
kubectl get computedomain my-compute-domain -o yaml
Interpret status.status according to the configured lifecycle mode:
In
driverManagedmode,Readyreflects the readiness of the per-ComputeDomain daemons managed by the driver. WhenComputeDomainCliquesis enabled, inspect theComputeDomainCliqueobjects for daemon membership:kubectl get computedomainclique -n dra-driver-nvidia-gpuIn
hostManagedmode,Readymeans only that the controller admitted theComputeDomainand created its workloadResourceClaimTemplate. It does not report the health of the administrator-managednvidia-imexservice. Host daemon health is checked later, on each node, when the kubelet plugin prepares a workload channel claim. Host-managed mode does not createComputeDomainCliqueobjects.
Validate host-managed IMEX
Use this validation after installing the driver with both
featureGates.HostManagedIMEXDaemon=true and
resources.computeDomains.imex.mode=hostManaged.
Complete the host-managed prerequisites
first, including configuring the same command socket path in the host service and
the Helm value.
On every node that can run the workload, verify the administrator-managed service and command socket:
sudo systemctl is-active nvidia-imex.service sudo /usr/bin/nvidia-imex-ctl -q --u=/etc/nvidia-imex/imex_ctrl.sockThe first command must report
activeand the second must reportREADY. Substitute the configuredresources.computeDomains.imex.hostSocketPathwhen it is not the default.Create the
ComputeDomainshown above, then verify that the controller created only its workload claim template:CD_UID="$(kubectl get computedomain my-compute-domain -o jsonpath='{.metadata.uid}')" kubectl get resourceclaimtemplate imex-channel-0 kubectl get daemonset --all-namespaces \ -l "resource.nvidia.com/computeDomain=${CD_UID}" kubectl get resourceclaimtemplate --all-namespaces \ -l "resource.nvidia.com/computeDomain=${CD_UID},resource.nvidia.com/computeDomainTarget=Daemon"The first command must return
imex-channel-0. The two label queries must return no resources: host-managed mode creates neither a per-domain daemon DaemonSet nor a daemonResourceClaimTemplate.Save the clique-affined workload above as
my-workload.yaml, apply it, and verifychannel0with bothtest -cand the workload log commands shown after the manifest. ARunningpod without that device check is not sufficient.In a maintenance window on a test node, exercise readiness failure and recovery. Record the node used in step 3, then delete that pod:
TEST_NODE="$(kubectl get pod my-workload -o jsonpath='{.spec.nodeName}')" echo "${TEST_NODE}" kubectl delete -f my-workload.yamlIn
my-workload.yaml, add this expression alongside the existingnvidia.com/gpu.cliqueexpression, replacing<test-node-name>with the value printed above:- key: kubernetes.io/hostname operator: In values: - <test-node-name>On that node, stop
nvidia-imex.service:sudo systemctl stop nvidia-imex.serviceReapply the same pod manifest from your administration host:
kubectl apply -f my-workload.yaml kubectl describe pod my-workload kubectl get events --field-selector reason=FailedPrepareDynamicResources \ --sort-by=.lastTimestampThe pod must not start while the command socket is unavailable: claim preparation fails and the kubelet retries. On the same node, restart the service and wait for the command socket to report
READY. The same pending pod and claim then proceed without being recreated:sudo systemctl start nvidia-imex.service sudo /usr/bin/nvidia-imex-ctl -q --u=/etc/nvidia-imex/imex_ctrl.sockFrom your administration host, verify recovery and channel injection:
kubectl wait --for=condition=Ready pod/my-workload --timeout=5m kubectl exec my-workload -- test -c /dev/nvidia-caps-imex-channels/channel0Delete the workload and
ComputeDomain. The controller removes the workload claim template, but it does not stop or reconfigure the host service:kubectl delete pod my-workload kubectl delete computedomain my-compute-domainKeep
nvidia-imex.servicerunning and manage its lifecycle outside the DRA Driver.
Feature gates
The default driver-managed mode uses two Beta feature gates that are enabled by default.
| Feature gate | Stage | Default | Description |
|---|---|---|---|
IMEXDaemonsWithDNSNames | Beta | true | Makes daemons communicate using DNS names instead of raw IP addresses and is required by ComputeDomainCliques. |
ComputeDomainCliques | Beta | true | Uses ComputeDomainClique CRD objects to track daemon membership per clique instead of storing that information in ComputeDomain.status.nodes and requires IMEXDaemonsWithDNSNames. |
HostManagedIMEXDaemon | Alpha | false | Allows you to select resources.computeDomains.imex.mode=hostManaged without changing the lifecycle mode by itself. |
To disable a Beta gate (for example, to test a downgrade path):
featureGates:
ComputeDomainCliques: false
IMEXDaemonsWithDNSNames: false
See Feature gates for all available gates.