code: def nvmlDeviceGetSerial(handle):
      r
      c_serial = create_string_buffer(NVML_DEVICE_SERIAL_BUFFER_SIZE)
      fn = _nvmlGetFunctionPointer("nvmlDeviceGetSerial")
      ret = fn(handle, c_serial, c_uint(NVML_DEVICE_SERIAL_BUFFER_SIZE))
      _nvmlCheckReturn(ret)
      return bytes_to_str(c_serial.value)
docs: r"""
      /**
       * Retrieves the globally unique board serial number associated with this device's board.
       *
       * For all products with an inforom.
       *
       * The serial number is an alphanumeric string that will not exceed 30 characters (including the NULL terminator).
       * This number matches the serial number tag that is physically attached to the board.  See \ref
       * nvmlConstants::NVML_DEVICE_SERIAL_BUFFER_SIZE.
       *
       * @param device                               The identifier of the target device
       * @param serial                               Reference in which to return the board/module serial number
       * @param length                               The maximum allowed length of the string returned in \a serial
       *
       * @return
       *         - \ref NVML_SUCCESS                 if \a serial 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 serial is NULL
       *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
       *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
       *         - \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 nvmlDeviceGetSerial