cuda.bindings.nvml.device_set_compute_mode#

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

Set the compute mode for the device or MIG device.

For all products. Requires root/admin permissions. The compute mode determines whether a GPU can be used for compute operations and whether it can be shared across contexts. This operation takes effect immediately. Under Linux it is not persistent across reboots and always resets to “Default”. Under windows it is persistent. Under windows compute mode may only be set to DEFAULT when running in WDDM. See nvmlComputeMode_t for details on available compute modes.

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

  • mode (ComputeMode) – The target compute mode.

Note

If MIG is enabled on a GPU, device must be MIG device handle.

See also

nvmlDeviceSetComputeMode