NAME
Rex::GPU::NVIDIA::VGPU - Which PCI subsystem IDs mark an NVIDIA vGPU guest device
VERSION
version 0.002
SYNOPSIS
use Rex::GPU::NVIDIA::VGPU;
my $type = Rex::GPU::NVIDIA::VGPU->type_for('2236', '14b9', '10de');
say $type // 'not a vGPU'; # NVIDIA A10-2Q
DESCRIPTION
A guest VM on an NVIDIA vGPU (Azure NVadsA10 v5, AWS G6f, a VMware / KVM vGPU host) sees a PCI device with NVIDIA's vendor ID and the physical GPU's device ID -- lspci -nn cannot tell it from the passed-through card. The subsystem ID can: NVIDIA assigns every vGPU type its own, and publishes the pairs in the open GPU kernel modules. Such a guest needs NVIDIA's licensed vGPU guest (GRID) driver; the open nvidia.ko of the distribution and datacenter packages refuses an Ampere-or-newer vGPU function. See "NVIDIA vGPU guests" in Rex::GPU::Detect for how detection uses this and "install_driver" in Rex::GPU::NVIDIA for what it changes.
The pair comparison only knows the types in "types": a vGPU type NVIDIA adds after the tag in "source" is reported as a physical card until the table is regenerated (maint/gen-vgpu-types.pl --source path/to/open-gpu-kernel-modules).
type_for
my $type = Rex::GPU::NVIDIA::VGPU->type_for($device_id, $subsystem_id, $subsystem_vendor_id);
# 'GRID A100X-1-5C' for ('20b0', '146f', '10de'); undef for a physical card
The vGPU type name for a PCI device as the guest sees it: the NVIDIA device ID (the XXXX of [10de:XXXX]) and the subsystem ID (the [xxxx] of lspci -vmmnn's SDevice: line), both four hex digits in any case. An NVIDIA vGPU hands the guest the physical GPU's device ID and a subsystem ID of its own per vGPU type, from NVIDIA's own table ("types"). undef when the pair is not in the table -- a physical card, a passed-through one, or a vGPU type newer than the table -- and for a missing or malformed ID. The optional $subsystem_vendor_id must be 10de when given: every row of NVIDIA's table is, and an OEM board (subsystem vendor Dell, HPE, ...) whose subsystem ID happens to equal one is not a vGPU. Called on a subclass, it uses that subclass's "types".
types
my %types = $class->types; # '20b0:146f' => 'GRID A100X-1-5C', ...
The table: a flat list of pairs, the key dddd:ssss (device ID and subsystem ID, lowercase hex), the value the vGPU type name NVIDIA gives it. Generated from sVgpuUsmTypes[] in NVIDIA's open-gpu-kernel-modules (src/common/shared/inc/g_vgpu_chip_flags.h) by maint/gen-vgpu-types.pl; "source" names the tag it was read from. Turing to Blackwell Ultra.
Override it in a subclass to add a type this release does not know yet; a later pair wins over an earlier one with the same key:
package My::GPU::VGPU;
use parent 'Rex::GPU::NVIDIA::VGPU';
sub types {
my ( $self ) = @_;
return ( $self->SUPER::types, '2bb5:9999' => 'NVIDIA RTXPro6000-99Q' );
}
Rex::GPU::Detect reads the built-in table, not a subclass (as it does for "generations" in Rex::GPU::NVIDIA::Requirement).
source
my $src = Rex::GPU::NVIDIA::VGPU->source;
# { file => 'src/common/shared/inc/g_vgpu_chip_flags.h', tag => '615.71.09',
# generated => '2026-09-24', entries => 1135 }
Where "types" came from: the file in NVIDIA's open-gpu-kernel-modules, its tag, the date the table was generated and the number of pairs.
LICENSE OF THE TABLE
The pairs in "types" are taken from NVIDIA's open-gpu-kernel-modules, which NVIDIA licenses as MIT (COPYING there); the notice is reproduced in a comment above "types" in this file.
SEE ALSO
Rex::GPU::Detect, Rex::GPU::NVIDIA, https://github.com/NVIDIA/open-gpu-kernel-modules
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/rex-gpu/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.