Update GetMigConfig to use GIProfileID from target device#372
Open
JunAr7112 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Arjun <agadiyar@nvidia.com>
c491743 to
5a413af
Compare
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.
This MR is in response to this issue: #157. Essentially the issue we are seeing is that SetMigConfig(gpu, config) resolves MIG profile strings (e.g. "1g.6gb") to GIProfileID values globally across all GPUs, not from the target device. As such, if the GIProfileID of a partition in GPU 0 differs from the GIProfileID of a partition in GPU 1, the mig manager will error: Error getting GPU instance profile info for '1g.6gb': ERROR_NOT_SUPPORTED"
To fix this, a helper function resolveMigProfileOnDevice was created that will map a logical MIG profile (from config / Flatten) to the NVML GI/CI profile IDs for the given GPU. It will loop through the profiles in GetMigProfiles() and identify the profile that matches the mp.String() we are trying to create. We will then update with the correct profile info.
In order to test this change, func TestSetMigConfigResolvesMigProfileOnTargetGPU was defined. The function will create two dummy GPUs, and override the GI Profile ID for GPU 1.
local-agadiyar@ipp2-0139:~/mig-parted$ go test ./pkg/mig/config -run TestSetMigConfigResolvesMigProfileOnTargetGPU -count=1
ok github.com/NVIDIA/mig-parted/pkg/mig/config 0.008s