This change uses the GetLibrary().Lookup() function in the nvml package
to check whether a particular function is available. This avoids
the need to explicitly open a library, for example.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This change updates Device.VisitMigDevices to align with
Device.VisitMigProfiles in than the function is skipped for
non-MIG-capable devices. This allows the function to always
be a no-op on older drivers where MIG is not supported.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This does not verify that the profile is a valid profile for the current
platform, but rather that it simply adheres to the proper formatting of a MIG
profile string.
Signed-off-by: Kevin Klues <kklues@nvidia.com>
This allows devices to be skipped based on device names and
skips "NVIDIA DGX Display" devices by default.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
The PCI Bus ID returned by NVML is upper case and results in the following error:
error getting PCI device class for device:
failed to construct PCI device:
unable to read PCI device vendor id for 0000:0A:00.0:
open /sys/bus/pci/devices/0000:0A:00.0/vendor:
no such file or directory
Signed-off-by: Evan Lezar <elezar@nvidia.com>
We decided it makes sense to have top level device and MIG device abstractions
all under one package rather than trying to separate them. It will make it
easier to hav them clal between each other without package dependency loops.
Signed-off-by: Kevin Klues <kklues@nvidia.com>
For now this package only has functions to work with MIG profiles. More
functionality will be added here in the future.
Signed-off-by: Kevin Klues <kklues@nvidia.com>