Revert "rocm_smi.py: Don't try to print absent clock files"

This reverts commit 2ba625e569.
DRM device id  does not always match GPU ID in the rocm_smi.py. This leads to cases where wrong device is checked by os.path.isfile().

Change-Id: Ib6f2b9be123b7eb64334d3feec57f63d7eb37d6f


[ROCm/rocm_smi_lib commit: be66d67ef2]
Этот коммит содержится в:
Elena Sakhnovitch
2022-04-29 16:52:13 -04:00
коммит произвёл Elena Sakhnovitch
родитель 33320d6e1a
Коммит 2a06a86b09
-8
Просмотреть файл
@@ -1401,10 +1401,6 @@ def showClocks(deviceList):
for device in deviceList:
for clk_type in sorted(rsmi_clk_names_dict):
freq_list = []
if not os.path.isfile(
os.path.join('/sys/class/drm', 'card%d' % (device), 'device', 'pp_dpm_%s' % clk_type)):
logging.debug('No clock file for %s on card%d' % (clk_type, device))
continue
if rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], None) == 1:
ret = rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], byref(freq))
if rsmi_ret_ok(ret, device, clk_type, True):
@@ -1466,10 +1462,6 @@ def showCurrentClocks(deviceList, clk_defined=None, concise=False):
else: # if clk is not defined, will display all current clk
for clk_type in sorted(rsmi_clk_names_dict):
if not os.path.isfile(
os.path.join('/sys/class/drm', 'card%d' % (device), 'device', 'pp_dpm_%s' % clk_type)):
logging.debug('No clock file for %s on card%d' % (clk_type, device))
continue
if rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], None) == 1:
ret = rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], byref(freq))
if rsmi_ret_ok(ret, device, clk_type, True):