Refactor GPU Health Checker to use go-nvml - #622
Open
ankitjoju-google wants to merge 1 commit into
Open
Conversation
Replaced the deprecated gpu-monitoring-tools library with the official go-nvml library. Updated method signatures to use raw types for easier testability and mocking, avoiding issues with non-mockable nvml.Device struct. Updated test cases to match new signatures and smaller mock instance IDs.
ankitjoju-google
force-pushed
the
refactor-healthcheck
branch
from
July 8, 2026 01:13
f896161 to
a78e9fe
Compare
leiyiz
reviewed
Jul 9, 2026
|
|
||
| "cloud.google.com/go/compute/metadata" | ||
| "github.com/GoogleCloudPlatform/container-engine-accelerators/pkg/gpu/nvidia/util" | ||
| "github.com/NVIDIA/gpu-monitoring-tools/bindings/go/nvml" |
Collaborator
There was a problem hiding this comment.
have you ran go mod vendor; go mod tidy? if gpu-monitoring-tools/bindings/go/nvml is not used it should be cleaned up from vendor/
| } | ||
| type GPUDevice struct{} | ||
|
|
||
| var migUUIDRegex = regexp.MustCompile(`^MIG-GPU-([^/]+)/([0-9]+)/([0-9]+)$`) |
Collaborator
There was a problem hiding this comment.
This regex looks a little off to me. From my memory the MIG device UUID is MIG-UUID not MIG-GPU-UUID.
have you tested this new code manually and does this work
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.
Replaced the deprecated gpu-monitoring-tools library with the official go-nvml library. Updated method signatures to use raw types for easier testability and mocking, avoiding issues with non-mockable nvml.Device struct. Updated test cases to match new signatures and smaller mock instance IDs.
Required for potential implementation of GPU Reset.
Tested with Unit Tests & Real GKE nodes w/ Accelerators