cuda.core.system.MigInfo#

class cuda.core.system.MigInfo(Device device: Device)#

Methods

__init__(*args, **kwargs)#
get_all_devices(self) Iterable[Device]#

Get all MIG devices under its parent device.

If the compute instance is destroyed either explicitly or by destroying, resetting or unbinding the parent GPU instance or the GPU device itself the MIG device handle would remain invalid and must be requested again using this API. Handles may be reused and their properties can change in the process.

For Ampere™ or newer fully supported devices.

Returns:

A list of all MIG devices corresponding to this GPU.

Return type:

list[Device]

get_device_by_index(self, int index: int) Device#

Get MIG device for the given index under its parent device.

If the compute instance is destroyed either explicitly or by destroying, resetting or unbinding the parent GPU instance or the GPU device itself the MIG device handle would remain invalid and must be requested again using this API. Handles may be reused and their properties can change in the process.

For Ampere™ or newer fully supported devices.

Parameters:

index (int) – The index of the MIG device (compute instance) to retrieve. Must be between 0 and the value returned by get_device_count() - 1.

Returns:

The MIG device corresponding to the given index.

Return type:

Device

get_device_count(self) int#

Get the maximum number of MIG devices that can exist under this device.

Returns zero if MIG is not supported or enabled.

For Ampere™ or newer fully supported devices.

Returns:

The number of MIG devices (compute instances) on this GPU.

Return type:

int

get_parent_device(self) Device#

For MIG devices, get the parent GPU device.

For Ampere™ or newer fully supported devices.

Returns:

The parent GPU device for this MIG device.

Return type:

Device

Attributes

is_mig_device#

Whether this device is a MIG (Multi-Instance GPU) device.

A MIG device handle is an NVML abstraction which maps to a MIG compute instance. These overloaded references can be used (with some restrictions) interchangeably with a GPU device handle to execute queries at a per-compute instance granularity.

For Ampere™ or newer fully supported devices.

mode#

Get current MIG mode for the device.

For Ampere™ or newer fully supported devices.

Changing MIG modes may require device unbind or reset. The “pending” MIG mode refers to the target mode following the next activation trigger.

If the device is not a MIG device, returns False.

Returns:

True if current MIG mode is enabled.

Return type:

bool

pending_mode#

Get pending MIG mode for the device.

For Ampere™ or newer fully supported devices.

Changing MIG modes may require device unbind or reset. The “pending” MIG mode refers to the target mode following the next activation trigger.

If the device is not a MIG device, returns False.

Returns:

True if pending MIG mode is enabled.

Return type:

bool