cuda.bindings.nvml.device_set_mig_mode#

cuda.bindings.nvml.device_set_mig_mode(intptr_t device, unsigned int mode) int#

Set MIG mode for the device.

For Ampere ™️ or newer fully supported devices. Requires root user. This mode determines whether a GPU instance can be created. This API may unbind or reset the device to activate the requested mode. Thus, the attributes associated with the device, such as minor number, might change. The caller of this API is expected to query such attributes again. On certain platforms like pass-through virtualization, where reset functionality may not be exposed directly, VM reboot is required. activation_status would return NVML_ERROR_RESET_REQUIRED for such cases. activation_status would return the appropriate error code upon unsuccessful activation. For example, if device unbind fails because the device isn’t idle, NVML_ERROR_IN_USE would be returned. The caller of this API is expected to idle the device and retry setting the mode.

Parameters:
  • device (intptr_t) – The identifier of the target device.

  • mode (unsigned int) – The mode to be set, NVML_DEVICE_MIG_DISABLE or NVML_DEVICE_MIG_ENABLE.

Returns:

The activation_status status.

Return type:

int

Note

On Windows, only disabling MIG mode is supported. activation_status would return NVML_ERROR_NOT_SUPPORTED as GPU reset is not supported on Windows through this API.

See also

nvmlDeviceSetMigMode