code: def nvmlDeviceGetPowerUsage(handle):
      r
      c_watts = c_uint()
      fn = _nvmlGetFunctionPointer("nvmlDeviceGetPowerUsage")
      ret = fn(handle, byref(c_watts))
      _nvmlCheckReturn(ret)
      return bytes_to_str(c_watts.value)
docs: r"""
      /**
       * Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory)
       *
       * For Fermi &tm; or newer fully supported devices.
       *
       * On Fermi and Kepler GPUs the reading is accurate to within +/- 5% of current power draw.
       *
       * It is only available if power management mode is supported. See \ref nvmlDeviceGetPowerManagementMode.
       *
       * @param device                               The identifier of the target device
       * @param power                                Reference in which to return the power usage information
       *
       * @return
       *         - \ref NVML_SUCCESS                 if \a power has been populated
       *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
       *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a power is NULL
       *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support power readings
       *         - \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
       */
      nvmlReturn_t DECLDIR nvmlDeviceGetPowerUsage