SWDEV-417117 - Added Cache Flags

Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I78836ba5f87c2859b82f17a7564df6f99ac77ad7
This commit is contained in:
Maisam Arif
2023-11-02 05:38:44 -05:00
parent 56b246cc3c
commit aeef485034
4 changed files with 68 additions and 24 deletions
+9
View File
@@ -466,9 +466,18 @@ class AMDSMICommands():
if args.cache:
try:
cache_info = amdsmi_interface.amdsmi_get_gpu_cache_info(args.gpu)
for cache_key, cache_dict in cache_info.items():
for key, value in cache_dict.items():
if key == 'cache_size' or key == 'cache_level':
continue
if value:
cache_info[cache_key][key] = "ENABLED"
else:
cache_info[cache_key][key] = "DISABLED"
if self.logger.is_human_readable_format():
for _ , cache_values in cache_info.items():
cache_values['cache_size'] = f"{cache_values['cache_size']} KB"
except amdsmi_exception.AmdSmiLibraryException as e:
cache_info = "N/A"
logging.debug("Failed to get cache info for gpu %s | %s", gpu_id, e.get_error_info())