feat(cpu): add CPUHierarchy_v2 binding with per-CPU serial#129
Open
rvatkar wants to merge 4 commits into
Open
Conversation
nccurry
reviewed
Jun 12, 2026
| return toCpuHierarchy(c_hierarchy), nil | ||
| } | ||
|
|
||
| func cpuHierarchyError(operation string, result C.dcgmReturn_t) error { |
Collaborator
There was a problem hiding this comment.
Do we need both of these functions wrapping functions wrapping functions?
Maybe we do, maybe we dont.
Collaborator
Author
There was a problem hiding this comment.
I’ll simplify this. cpuHierarchyError is still useful because these APIs need to preserve the DCGM status as a wrapped *dcgm.Error, but wrapCPUHierarchyError is just an extra test seam. I’ll remove
that layer and test cpuHierarchyError directly.
nccurry
reviewed
Jun 12, 2026
nccurry
reviewed
Jun 12, 2026
| assert.ErrorContains(t, err, tt.status) | ||
|
|
||
| var dcgmErr *Error | ||
| require.True(t, errors.As(err, &dcgmErr)) |
Collaborator
There was a problem hiding this comment.
The repo enables testifylint’s error-is-as rule, so this assertion should use require.ErrorAs(t, err, &dcgmErr) instead of require.True(t, errors.As(...)); that also lets the errors import go away.
nccurry
approved these changes
Jun 12, 2026
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.
Adds Go bindings for
dcgmGetCpuHierarchy_v2()so callers can access the Grace CPU serial returned by DCGM.Changes
CPUHierarchy_v2/CPUHierarchyCPU_v2support.Serial.NumCPUs == 0Validation
go test ./pkg/dcgm