[][src]Function nvml_binding::bindings::nvmlDeviceSetComputeMode

pub unsafe extern "C" fn nvmlDeviceSetComputeMode(
    device: nvmlDevice_t,
    mode: nvmlComputeMode_t
) -> nvmlReturn_t

Set the compute mode for the 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 \ref nvmlComputeMode_t for details on available compute modes.

@param device The identifier of the target device @param mode The target compute mode

@return - \ref NVML_SUCCESS if the compute mode was set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error

@see nvmlDeviceGetComputeMode()