Skip to content

fix(device-plugin): skip devices that do not support event based healthchecking - #12

Closed
Wangmin362 wants to merge 1 commit into
masterfrom
fix/health-skip-unsupported-events
Closed

fix(device-plugin): skip devices that do not support event based healthchecking#12
Wangmin362 wants to merge 1 commit into
masterfrom
fix/health-skip-unsupported-events

Conversation

@Wangmin362

@Wangmin362 Wangmin362 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

What type of PR is this?

/kind bug

What this PR does / why we need it:

nvmlDeviceRegisterEvents returning ERROR_NOT_SUPPORTED means the device cannot report health through the event mechanism, not that it is faulty. The two separate ifs let that return code fall through into the second branch, so the device is handed to ListAndWatch as Unhealthy and stops being schedulable. That state is not reversible - ListAndWatch carries a FIXME: there is no way to recover from the Unhealthy state - and a restart only repeats the same failed registration. The logs contradict themselves: one line says the device is "too old to support healthchecking", the next one marks it unhealthy.

A switch makes the two cases exclusive. NVIDIA fixed the same block upstream in k8s-device-plugin (commit 8cd1447, "Fix healthchecking on old devices").

Which issue(s) this PR fixes:

NONE

Special notes for your reviewer:

Added a test covering the three RegisterEvents outcomes. Checked both ways: with health.go reverted to master the test fails on the ERROR_NOT_SUPPORTED assertion, with the fix the package passes.

I have no card that answers ERROR_NOT_SUPPORTED for the mask HAMi asks for, so this is not reproduced end to end on a node. I did probe NVML on our test cluster to confirm the return code is reachable in practice: on a GeForce RTX 4090 D (driver 595.71.05) nvmlDeviceRegisterEvents returns ERROR_NOT_SUPPORTED for the ECC event bits, and on a Tesla V100 (driver 550.54.15) for a bit outside its supported mask.

This PR was written primarily by Claude Code.

Does this PR introduce a user-facing change?:

Devices that do not support event based health checking are no longer reported as unhealthy, so they stay schedulable.

@Wangmin362
Wangmin362 force-pushed the fix/health-skip-unsupported-events branch from 8c51ab8 to 4104c85 Compare August 5, 2026 07:58
…thchecking

nvmlDeviceRegisterEvents returning ERROR_NOT_SUPPORTED means the device cannot
report health through the event mechanism, not that it is faulty. The two
separate ifs let that return code fall into the unhealthy branch, so the device
was handed to ListAndWatch as Unhealthy and kubelet dropped it from the node
capacity. There is no way back from that state (see the FIXME in ListAndWatch)
and a restart hits the same registration failure again.

Use a switch so the two cases are exclusive, matching the surrounding branches
that all skip the device.

Signed-off-by: wangmin <wangmin@riseunion.io>
@Wangmin362
Wangmin362 force-pushed the fix/health-skip-unsupported-events branch from 4104c85 to 7522094 Compare August 5, 2026 08:05
@Wangmin362

Copy link
Copy Markdown
Owner Author

Submitted upstream as Project-HAMi#2393. Closing this one.

@Wangmin362 Wangmin362 closed this Aug 6, 2026
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.

1 participant