Skip to content

Surface NVML error when MIG device placement cannot be determined - #1899

Merged
tariq1890 merged 1 commit into
NVIDIA:mainfrom
saiyam1814:fix/mig-uuid-error-propagation
Jul 10, 2026
Merged

tariq1890 merged 1 commit into
NVIDIA:mainfrom
saiyam1814:fix/mig-uuid-error-propagation

Conversation

@saiyam1814

Copy link
Copy Markdown
Contributor

What this PR does

When the health check cannot resolve a MIG device's placement, the NVML error from DeviceGetHandleByUUID is silently discarded and getMigDeviceParts falls back to parsing the legacy MIG UUID format (MIG-GPU-<parent-uuid>/<gi>/<ci>). Modern drivers assign opaque MIG UUIDs (MIG-<uuid>) that carry no placement information, so for those the fallback is guaranteed to fail — and the only error ever logged is the misleading unable to parse UUID as MIG device, masking the actual NVML failure (e.g. ERROR_NO_PERMISSION, ERROR_NOT_FOUND).

This PR:

  • Propagates the NVML return code alongside the parse failure, so the health-check log shows the real reason, e.g. failed to get MIG device handle for MIG-30d00c09-...: ERROR_NO_PERMISSION; unable to parse UUID as MIG device.
  • Adds unit tests for parseMigDeviceUUID and getMigDeviceParts (previously uncovered), using minimal embedded nvml.Interface/nvml.Device test doubles (the go-nvml mock package is not in the vendor tree, so no vendor changes are needed).

No behavior change for devices whose placement resolves successfully or whose legacy UUID parses; only the error message for the already-failing path improves.

Motivation

Project-HAMi adapts this resource-manager code, and the masked error made a real-world report (all MIG devices on H200 NVL marked unhealthy, Project-HAMi/HAMi#1950) impossible to diagnose from device-plugin logs. The identical fix was reviewed and merged there as Project-HAMi/HAMi#1999. Upstreaming it so both codebases stay aligned and other users of this plugin get diagnosable health-check failures.

@copy-pr-bot

copy-pr-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

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.

Comment thread internal/rm/health.go Resolved
Comment thread internal/rm/health.go Resolved
@tariq1890

Copy link
Copy Markdown
Contributor

Thank you for your contribution @saiyam1814! Please rebase this branch and take a look at the review comments

When DeviceGetHandleByUUID fails for a MIG device, checkHealth falls
back to parsing the legacy MIG UUID format (MIG-GPU-<uuid>/<gi>/<ci>).
Modern drivers assign opaque MIG UUIDs (MIG-<uuid>) that carry no
placement information, so the fallback is guaranteed to fail for them
and the resulting 'unable to parse UUID as MIG device' error masks the
actual NVML failure (e.g. ERROR_NO_PERMISSION), making health-check
failures hard to diagnose from the logs.

Propagate the NVML return code alongside the parse failure so the log
shows the real reason the device was marked unhealthy. Adds unit tests
for parseMigDeviceUUID and getMigDeviceParts.

The same fix was merged in Project-HAMi (which adapts this code) as
Project-HAMi/HAMi#1999, where the masked error made
Project-HAMi/HAMi#1950 undiagnosable.

Signed-off-by: Saiyam Pathak <saiyam911@gmail.com>
@saiyam1814
saiyam1814 force-pushed the fix/mig-uuid-error-propagation branch from 5ff6d44 to 54aaf5b Compare July 10, 2026 08:37
@saiyam1814

Copy link
Copy Markdown
Contributor Author

Thank you for your contribution @saiyam1814! Please rebase this branch and take a look at the review comments

Thank you for the response, done!

@tariq1890

Copy link
Copy Markdown
Contributor

/ok to test 54aaf5b

@tariq1890
tariq1890 merged commit c52135b into NVIDIA:main Jul 10, 2026
11 checks passed
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.

2 participants