fix(device-plugin): skip devices that do not support event based healthchecking - #12
Closed
Wangmin362 wants to merge 1 commit into
Closed
fix(device-plugin): skip devices that do not support event based healthchecking#12Wangmin362 wants to merge 1 commit into
Wangmin362 wants to merge 1 commit into
Conversation
Wangmin362
force-pushed
the
fix/health-skip-unsupported-events
branch
from
August 5, 2026 07:58
8c51ab8 to
4104c85
Compare
…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
force-pushed
the
fix/health-skip-unsupported-events
branch
from
August 5, 2026 08:05
4104c85 to
7522094
Compare
Owner
Author
|
Submitted upstream as Project-HAMi#2393. Closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
What this PR does / why we need it:
nvmlDeviceRegisterEventsreturningERROR_NOT_SUPPORTEDmeans the device cannot report health through the event mechanism, not that it is faulty. The two separateifs let that return code fall through into the second branch, so the device is handed toListAndWatchasUnhealthyand stops being schedulable. That state is not reversible -ListAndWatchcarries aFIXME: 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
switchmakes the two cases exclusive. NVIDIA fixed the same block upstream in k8s-device-plugin (commit8cd1447, "Fix healthchecking on old devices").Which issue(s) this PR fixes:
NONE
Special notes for your reviewer:
Added a test covering the three
RegisterEventsoutcomes. Checked both ways: withhealth.goreverted to master the test fails on theERROR_NOT_SUPPORTEDassertion, with the fix the package passes.I have no card that answers
ERROR_NOT_SUPPORTEDfor 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)nvmlDeviceRegisterEventsreturnsERROR_NOT_SUPPORTEDfor 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.