RDC Prometheus plugin return errors when use the --rdc_gpu_indexes

When above option is used, the plugin returns errors:
  result = rdc.rdc_group_gpu_add(rdc_handle, gpu_group_id, gpu)
  ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: wrong type

The rdc_prometheus.py is changed to convert string to integer.
The RdcUtil.py is also changed to raise Exception properly.

Change-Id: I9535091ff1fc8882cccd32e5f2810da5241768c3


[ROCm/rdc commit: 7ca7a571a7]
Cette révision appartient à :
Bill(Shuzhou) Liu a créé et Shuzhou Liu a révisé 2021-02-23 14:15:04 -05:00
1 Parent b9ac3ffbd9
révision d53a9c4e21
2 fichiers modifiés
+7 -4

Aucun fichier ne correspond à votre recherche

+3
Voir le fichier
@@ -88,6 +88,9 @@ if __name__ == '__main__':
rdc_ip_port = args.rdc_ip_port
if args.rdc_embedded:
rdc_ip_port = None
if args.rdc_gpu_indexes != None:
for i in range(0, len(args.rdc_gpu_indexes)):
args.rdc_gpu_indexes[i] = int(args.rdc_gpu_indexes[i])
reader = PrometheusReader(rdc_ip_port, field_ids, args.rdc_update_freq*1000000,
args.rdc_max_keep_age, args.rdc_max_keep_samples,