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]
Этот коммит содержится в:
коммит произвёл
Shuzhou Liu
родитель
b9ac3ffbd9
Коммит
d53a9c4e21
@@ -54,13 +54,13 @@ class RdcUtil:
|
||||
gpu_group_id = c_uint32()
|
||||
result = rdc.rdc_group_gpu_create(rdc_handle, rdc_group_type_t.RDC_GROUP_EMPTY, gpu_group_name, gpu_group_id)
|
||||
if rdc_status_t(result) != rdc_status_t.RDC_ST_OK:
|
||||
raise Exception("Fail to create the GPU group " << group_name)
|
||||
raise Exception("Fail to create the GPU group " + group_name)
|
||||
|
||||
#Add GPU index to the group
|
||||
for gpu in gpu_indexes:
|
||||
result = rdc.rdc_group_gpu_add(rdc_handle, gpu_group_id, gpu)
|
||||
if rdc_status_t(result) != rdc_status_t.RDC_ST_OK:
|
||||
raise Exception("Fail to add GPU index " << gpu <<" to group " << gpu_group_id)
|
||||
raise Exception("Fail to add GPU index " + str(gpu) + " to group " + str(gpu_group_id))
|
||||
|
||||
return gpu_group_id, True
|
||||
|
||||
@@ -75,7 +75,7 @@ class RdcUtil:
|
||||
group_info = rdc_field_group_info_t()
|
||||
result = rdc.rdc_group_field_get_info(rdc_handle, field_group_id_list[index], pointer(group_info))
|
||||
if rdc_status_t(result) != rdc_status_t.RDC_ST_OK:
|
||||
raise Exception("Fail to get field group " << field_group_id_list[index] <<" info")
|
||||
raise Exception("Fail to get field group " + str(field_group_id_list[index]) + " info")
|
||||
if group_info.group_name.decode("utf-8") == field_group_name:
|
||||
field_ids_ori = [ e.value for e in group_info.field_ids[:group_info.count] ]
|
||||
# reuse the old field group
|
||||
@@ -84,7 +84,7 @@ class RdcUtil:
|
||||
else:
|
||||
result = rdc.rdc_group_field_destroy(rdc_handle, field_group_id_list[index])
|
||||
if rdc_status_t(result) != rdc_status_t.RDC_ST_OK:
|
||||
raise Exception("Fail to delete field group " << field_group_id_list[index])
|
||||
raise Exception("Fail to delete field group " + str(field_group_id_list[index]))
|
||||
|
||||
#Create new field group
|
||||
fields_c_ids = []
|
||||
|
||||
@@ -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,
|
||||
|
||||
Ссылка в новой задаче
Block a user