Skip to content

Update GetMigConfig to use GIProfileID from target device#372

Open
JunAr7112 wants to merge 1 commit into
NVIDIA:mainfrom
JunAr7112:wrong_gi_profile
Open

Update GetMigConfig to use GIProfileID from target device#372
JunAr7112 wants to merge 1 commit into
NVIDIA:mainfrom
JunAr7112:wrong_gi_profile

Conversation

@JunAr7112
Copy link
Copy Markdown
Contributor

@JunAr7112 JunAr7112 commented May 11, 2026

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

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 11, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Arjun <agadiyar@nvidia.com>
@JunAr7112 JunAr7112 marked this pull request as ready for review May 13, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant