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 작성하고 Elena Sakhnovitch가 2022-05-03 16:42:42 -04:00를 커밋함
1 부모 33320d6e1a
커밋 2a06a86b09
1 파일이 변경됨
-8
-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):