Skip to content

Add vgpu mode for non-MIG NVIDIA vGPU devices - #30

Merged
MiguelCarpio merged 1 commit into
rhos-vaf:mainfrom
MiguelCarpio:nvidia-sriov-mdev
Aug 11, 2026
Merged

Add vgpu mode for non-MIG NVIDIA vGPU devices#30
MiguelCarpio merged 1 commit into
rhos-vaf:mainfrom
MiguelCarpio:nvidia-sriov-mdev

Conversation

@MiguelCarpio

@MiguelCarpio MiguelCarpio commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Add vgpu mode for non-MIG NVIDIA vGPU devices:

# [string] Mode of running the GPU-enabled device
# Supported values:
#   pci_passthrough — Direct PCI PF passthrough (default)
#   mig             — NVIDIA MIG-backed vGPU (A30, RTX PRO 6000 Blackwell)
#   vgpu            — NVIDIA non-MIG vGPU via mdev (L4, A16, L40S)
# See https://docs.nvidia.com/vgpu/latest/grid-vgpu-release-notes-red-hat-el-kvm/validated-platforms.html

Why do we need this PR?

Previously gpu_validation_mode only supported pci_passthrough and mig. New vgpu mode shares vGPU scheduling logic with MIG (resources:VGPU=1 flavor extra_specs, GRID guest driver dependencies) but skips MIG-specific checks (nvidia-smi MIG query, MIG enabled assertions).

Also fix extra_specs ordering: reset for vGPU/MIG now runs before hugepage merge, so hugepages work correctly with all modes.

Related: OSPRH-33548

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Documented supported GPU validation modes, including PCI passthrough, NVIDIA MIG-backed vGPU, and NVIDIA vGPU through mediated devices.
    • Added references for compatible GPU platforms and additional guidance.
  • Bug Fixes

    • Improved driver setup for MIG-backed and mediated-device GPU configurations.
    • Corrected virtual GPU resource handling and ensured hugepage settings are applied consistently across supported modes.

Walkthrough

The change documents supported GPU validation modes and updates setup and VM image tasks. mig and vgpu modes now install dependencies and reset VGPU resources. Hugepage settings can also apply to mig mode.

Changes

GPU validation mode handling

Layer / File(s) Summary
Mode definitions and dependencies
gpu-validation/defaults/main.yaml, gpu-validation/tasks/setup.yaml
The supported GPU validation modes and validated platforms are documented. Driver dependencies now apply to mig and vgpu modes.
VM image extra specs
gpu-validation/tasks/vm_image.yaml
Extra specs reset to resources:VGPU=1 for mig and vgpu modes. Hugepage settings can also apply to mig mode.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the addition of non-MIG NVIDIA vGPU support, which is the main change.
Description check ✅ Passed The description accurately explains the new vGPU mode, driver dependencies, scheduling settings, and extra_specs ordering fix.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gpu-validation/tasks/setup.yaml`:
- Line 15: Restore the RHEL distribution guard on the RPM-specific dependency
block in setup.yaml while retaining the expanded gpu_validation_mode check for
“mig” and “vgpu”. Ensure the yum_repository and dnf tasks run only on RHEL
hosts, or reject those modes before reaching this block.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: bb3a689a-63e5-4676-97dc-8f30d489d289

📥 Commits

Reviewing files that changed from the base of the PR and between d24322c and 09c1e7e.

📒 Files selected for processing (3)
  • gpu-validation/defaults/main.yaml
  • gpu-validation/tasks/setup.yaml
  • gpu-validation/tasks/vm_image.yaml

Comment thread gpu-validation/tasks/setup.yaml
@rlandy

rlandy commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Checked the MIG references: https://github.com/search?q=repo%3Arhos-vaf%2Fgpu-validation+MIG&type=code.
Looks like this PR touches them all except the validations specific to MIG.
Are there specific vgpu validations to add?

@MiguelCarpio

Copy link
Copy Markdown
Contributor Author

Checked the MIG references: https://github.com/search?q=repo%3Arhos-vaf%2Fgpu-validation+MIG&type=code. Looks like this PR touches them all except the validations specific to MIG. Are there specific vgpu validations to add?

Hi @rlandy. Yes, except the validations specific to MIG. Non-MIG vGPUs need the EPEL repository and DKMS package as dependencies to use the NVIDIA guest grid driver. Removing ansible_distribution == "RedHat" enables the gpu-varification on CentOS Stream 9. Besides, vgpu mode needs the same flavor resources:VGPU=1 like MIG mode.

Comment thread gpu-validation/defaults/main.yaml Outdated
Previously gpu_validation_mode only supported "pci_passthrough" and
"mig". New "vgpu" mode shares vGPU scheduling logic with MIG
(resources:VGPU=1 flavor extra_specs, GRID guest driver dependencies)
but skips MIG-specific checks (nvidia-smi MIG query, MIG enabled
assertions).

Also fix extra_specs ordering: reset for vGPU/MIG now runs before
hugepage merge so hugepages work correctly with all modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bogdando
bogdando self-requested a review August 11, 2026 11:29
@MiguelCarpio
MiguelCarpio merged commit 31f3d9f into rhos-vaf:main Aug 11, 2026
2 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.

3 participants