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_statuswould returnNVML_ERROR_RESET_REQUIREDfor such cases.activation_statuswould return the appropriate error code upon unsuccessful activation. For example, if device unbind fails because the device isn’t idle,NVML_ERROR_IN_USEwould be returned. The caller of this API is expected to idle the device and retry setting themode.- Parameters:
device (intptr_t) – The identifier of the target device.
mode (unsigned int) – The mode to be set,
NVML_DEVICE_MIG_DISABLEorNVML_DEVICE_MIG_ENABLE.
- Returns:
The activation_status status.
- Return type:
Note
On Windows, only disabling MIG mode is supported.
activation_statuswould returnNVML_ERROR_NOT_SUPPORTEDas GPU reset is not supported on Windows through this API.See also
nvmlDeviceSetMigMode