From be66d67ef2ba7061e0fc083e009e7ae8d3e6a381 Mon Sep 17 00:00:00 2001 From: Elena Sakhnovitch Date: Fri, 29 Apr 2022 16:52:13 -0400 Subject: [PATCH] Revert "rocm_smi.py: Don't try to print absent clock files" This reverts commit b931380f02df3323e12c1eb162ef3190d6ff07e6. 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 --- python_smi_tools/rocm_smi.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/python_smi_tools/rocm_smi.py b/python_smi_tools/rocm_smi.py index 48821adc29..5070994789 100755 --- a/python_smi_tools/rocm_smi.py +++ b/python_smi_tools/rocm_smi.py @@ -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):