code: def nvmlSystemGetTopologyGpuSet(cpuNumber):
      r
      c_count = c_uint(0)
      fn = _nvmlGetFunctionPointer("nvmlSystemGetTopologyGpuSet")
  
      # First call will get the size
      ret = fn(cpuNumber, byref(c_count), None)
  
      if ret != NVML_SUCCESS:
          raise NVMLError(ret)
      print(c_count.value)
      # call again with a buffer
      device_array = c_nvmlDevice_t * c_count.value
      c_devices = device_array()
      ret = fn(cpuNumber, byref(c_count), c_devices)
      _nvmlCheckReturn(ret)
      return list(c_devices[0:c_count.value])
docs: r"""
      /**
       * Retrieve the set of GPUs that have a CPU affinity with the given CPU number
       * For all products.
       * Supported on Linux only.
       *
       * @param cpuNumber                            The CPU number
       * @param count                                When zero, is set to the number of matching GPUs such that \a deviceArray
       *                                             can be malloc'd.  When non-zero, \a deviceArray will be filled with \a count
       *                                             number of device handles.
       * @param deviceArray                          An array of device handles for GPUs found with affinity to \a cpuNumber
       *
       * @return
       *         - \ref NVML_SUCCESS                 if \a deviceArray or \a count (if initially zero) has been set
       *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a cpuNumber, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count
       *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or OS does not support this feature
       *         - \ref NVML_ERROR_UNKNOWN           an error has occurred in underlying topology discovery
       */
      nvmlReturn_t DECLDIR nvmlSystemGetTopologyGpuSet