Repository navigation
Trim sample and topology results to the returned count - #212
Merged
tariq1890 merged 1 commit intoOct 6, 2026
Merged
Conversation
tariq1890
reviewed
Sep 23, 2026
MaxFreedomPollard
force-pushed
the
fix/returned-sample-topology-counts
branch
from
September 30, 2026 02:56
3907e0c to
34d53dd
Compare
Contributor
|
can you squash your commit history? |
Signed-off-by: Max Freedom Pollard <272618364+MaxFreedomPollard@users.noreply.github.com> nvml: remove test-only stubs from returned-count fix
tariq1890
force-pushed
the
fix/returned-sample-topology-counts
branch
from
October 6, 2026 15:17
34d53dd to
6d66908
Compare
tariq1890
approved these changes
Oct 6, 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.
GetSamples,GetTopologyNearestGpus, andSystemGetTopologyGpuSetallocate from an initial count query, but NVML can return fewer entries on the second call. The wrappers currently expose the unused tail as zero-valued samples or device handles.Trim each slice to the count returned on a successful second call. Error returns retain their existing behavior, including
ERROR_INSUFFICIENT_SIZEwith an increased required count. This follows the returned-count handling already used for compute-instance placements.The change is limited to these three wrappers and adds no test-only NVML stubs.
Validation:
go test ./pkg/nvml -count=1passes on macOS. Hardware-dependent tests skip here becauselibnvidia-mlis unavailable, so the reduced-count response is not directly exercised in this local run.