Skip to content

Xpumd restart functionality - #119

Merged
pfl merged 2 commits into
intel:mainfrom
tkatila:xpumd-restart-func
Sep 9, 2026
Merged

Xpumd restart functionality#119
pfl merged 2 commits into
intel:mainfrom
tkatila:xpumd-restart-func

Conversation

@tkatila

@tkatila tkatila commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

If GPUs are in survivability mode (or are rebound to different indices), xpumd's observed GPUs would be incorrect. Xpumd cannot currently do anything about itself. A container restart will not update the GPUs assigned to the Pod. A Pod restart/recreation is needed.

xpumd device refresh controller tries to understand changes in the devices in the DRA's resourceslices vs. xpumd's allocation. Depending on how the controller is configured, it will either restart the Pod on any rebind action, on missing devices, or never.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new controller introduces a potentially expensive cluster-wide ResourceSlice listing per reconcile and includes a misleading RBAC comment that should be corrected before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces an XPU Manager (xpumd) “device refresh” controller that compares the GPUs visible to each xpumd Pod vs. the node’s currently published/usable GPUs (via DRA ResourceSlices) and deletes the Pod to force recreation when a restart is needed to pick up recovered/rebound devices. It also adds a new spec.xpu.restartOnDeviceRecovery ClusterPolicy setting (and Helm/CRD/docs plumbing) to control whether restarts happen on recovery-only, always-on rebind, or are disabled.

Changes:

  • Add XpumDeviceRefreshReconciler to adopt xpumd Pods (record device set) and restart Pods based on DRA ResourceSlice/device state.
  • Add comprehensive envtest coverage for adoption, missing-device restarts, rebind handling, and restart guards.
  • Expose/configure the feature via ClusterPolicy API/CRD, Helm chart values/templates, RBAC, and documentation.
File summaries
File Description
README.md Documents the new spec.xpu.restartOnDeviceRecovery knob.
internal/controller/xpum_device_refresh.go Implements the new xpumd device refresh controller.
internal/controller/xpum_device_refresh_test.go Adds envtest coverage for the controller’s behavior and guardrails.
config/rbac/namespaced_role.yaml Grants namespaced Pod patch permission for writing the device record annotation.
config/crd/bases/intel.com_clusterpolicies.yaml Adds CRD schema/default/enum for restartOnDeviceRecovery.
cmd/main.go Registers the new controller with the manager.
charts/gpu-base-operator/templates/namespaced_role.yaml Helm template update to include Pod patch in the namespaced Role.
charts/gpu-base-operator/crds/clusterpolicies.yaml Helm CRD bundle update mirroring the CRD schema change.
charts/gpu-base-operator-policy/values.yaml Adds Helm values default for xpu.restartOnDeviceRecovery.
charts/gpu-base-operator-policy/templates/clusterpolicy.yaml Wires the Helm value into the rendered ClusterPolicy.
charts/gpu-base-operator-policy/README.md Documents the new Helm value.
api/v1alpha1/clusterpolicy_types.go Adds the RestartOnDeviceRecovery field + XpumRestartMode type/constants.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/controller/xpum_device_refresh.go
Comment thread internal/controller/xpum_device_refresh.go Outdated
Comment thread internal/controller/xpum_device_refresh.go Outdated
A container is given its GPU device nodes at creation. An xpumd container that
started while one of its node's GPUs was in survivability mode therefore monitors every
GPU on that node except that one. When the GPU is recovered from survivability mode,
xpumd has to be restarted so that is can observe the newly detectable device.

The restart logic is tied to the ClusterPolicy's xpu.restartOnDeviceRecovery. Similar
to the recovery functionality, it is dependant on using DRA and its ResourceSlices.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
@pfl
pfl merged commit 5fe17da into intel:main Sep 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants