[][src]Function nvml_binding::bindings::nvmlDeviceSetAPIRestriction

pub unsafe extern "C" fn nvmlDeviceSetAPIRestriction(
    device: nvmlDevice_t,
    apiType: nvmlRestrictedAPI_t,
    isRestricted: nvmlEnableState_t
) -> nvmlReturn_t

Changes the root/admin restructions on certain APIs. See \a nvmlRestrictedAPI_t for the list of supported APIs. This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs. The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See \a nvmlDeviceGetAPIRestriction to query the current restriction settings.

For Kepler &tm; or newer fully supported devices. Requires root/admin permissions.

@param device The identifier of the target device @param apiType Target API type for this operation @param isRestricted The target restriction

@return - \ref NVML_SUCCESS if \a isRestricted has been 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 apiType incorrect - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support changing API restrictions or the device does not support the feature that api restrictions are being set for (E.G. Enabling/disabling auto boosted clocks is not supported by the device) - \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 nvmlRestrictedAPI_t