Skip to content

Prefer NVML MIG profile names - #680

Closed
Shivkumar13 wants to merge 1 commit into
NVIDIA:mainfrom
Shivkumar13:gh-687-mig-profile-name
Closed

Prefer NVML MIG profile names#680
Shivkumar13 wants to merge 1 commit into
NVIDIA:mainfrom
Shivkumar13:gh-687-mig-profile-name

Conversation

@Shivkumar13

Copy link
Copy Markdown

Summary

  • Prefer canonical NVML MIG GPU instance profile names when available.
  • Fall back to the existing DCGM profile name if NVML lookup fails.
  • Add coverage for the 7g.79gb to 7g.80gb correction path.

Related issue: NVIDIA/gpu-operator#687

Tests

  • CGO_ENABLED=1 go test ./internal/pkg/deviceinfo ./internal/pkg/nvmlprovider
  • CGO_ENABLED=1 go test ./internal/pkg/deviceinfo ./internal/pkg/nvmlprovider ./internal/pkg/transformation ./internal/pkg/watcher

@rahulait

Copy link
Copy Markdown

Linked issue in dcgm-exporter repo: #713

@rahulait rahulait left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM. I would wait for getting an approval from someone managing dcgm-exporter codebase as well as this might require a release note or migration note for users who were using the older incorrect values in their alerts.

Comment thread internal/pkg/nvmlprovider/provider.go Outdated
return "", fmt.Errorf("failed to get parent device handle for UUID %s: %s", parentGPUUUID, nvml.ErrorString(ret))
}

infoV2, ret := device.GetGpuInstanceProfileInfoByIdV(int(profileID)).V2()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetGpuInstanceProfileInfoByIdV was added in driver R580, but the reported setup uses R535. On R535, the exporter can crash before the fallback runs. Please use or guard the older API, add an R535 compatibility test that reaches the NVML call, and fix the G115 lint error here.

parentGPUUUID = gpu.DeviceInfo.UUID
}

nvmlProfileName, err := nvmlprovider.Client().GetGPUInstanceProfileName(parentGPUUUID, instance.Info.NvmlMigProfileId)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also work outside Kubernetes?

@nccurry nccurry Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it should.
Let's implement this as a follow up so this MR can merge as-is.

assert.Contains(t, err.Error(), "failed to get MIG device process memory")
}

func TestGetGPUInstanceProfileName_When_NVML_Not_Initialized(t *testing.T) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests do not exercise the production NVML lookup. Please add a provider-level test that covers GPU handle lookup and the R535-compatible profile query, and proves it returns 7g.80gb safely. A live GPU is not required; a mocked NVML binding or library shim is enough.

@rvatkar

rvatkar commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

cc: @nccurry for review

Comment thread internal/pkg/nvmlprovider/provider.go Outdated
Signed-off-by: Shivkumar Ople <sople@nvidia.com>
@Shivkumar13
Shivkumar13 force-pushed the gh-687-mig-profile-name branch from a3d1b46 to ede2553 Compare July 22, 2026 18:06
@Shivkumar13

Copy link
Copy Markdown
Author

Fix has been merged in GitLab repo. Closing this.

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.

4 participants