Merge amd-dev into amd-master 20240813

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ic744285e2203fad663a2f4a9f722c2bad1e623c8
Этот коммит содержится в:
Maisam Arif
2024-08-13 15:35:05 -05:00
родитель d0ff27181b b49c5596b5
Коммит 1a8462f364
5 изменённых файлов: 27 добавлений и 16 удалений
+2
Просмотреть файл
@@ -1,5 +1,7 @@
# AMD SMI CLI Tool
**Disclaimer: CLI Tool is provided as an example code to aid the development of telemetry tools. Python or C++ Library is recommended as a reliable data source.**
This tool acts as a command line interface for manipulating
and monitoring the amdgpu kernel, and is intended to replace
and deprecate the existing rocm_smi CLI tool & gpuv-smi tool.
+15 -10
Просмотреть файл
@@ -293,6 +293,8 @@ class AMDSMICommands():
args.board = board
if driver:
args.driver = driver
if ras:
args.ras = ras
if vram:
args.vram = vram
if cache:
@@ -301,14 +303,12 @@ class AMDSMICommands():
args.process_isolation = process_isolation
# Store args that are applicable to the current platform
current_platform_args = ["asic", "bus", "vbios", "driver", "vram", "cache",
"board", "process_isolation"]
current_platform_values = [args.asic, args.bus, args.vbios, args.driver, args.vram, args.cache,
args.board, args.process_isolation]
current_platform_args = ["asic", "bus", "vbios", "driver", "ras",
"vram", "cache", "board", "process_isolation"]
current_platform_values = [args.asic, args.bus, args.vbios, args.driver, args.ras,
args.vram, args.cache, args.board, args.process_isolation]
if self.helpers.is_linux() and self.helpers.is_baremetal():
if ras:
args.ras = ras
if partition:
args.partition = partition
if limit:
@@ -1191,14 +1191,19 @@ class AMDSMICommands():
args.clock = clock
if temperature:
args.temperature = temperature
if pcie:
args.pcie = pcie
current_platform_args += ["usage", "power", "clock", "temperature", "pcie"]
current_platform_values += [args.usage, args.power, args.clock, args.temperature, args.pcie]
# Only args that are applicable to Hypervisors and BM Linux
if self.helpers.is_hypervisor() and (self.helpers.is_baremetal() and self.helpers.is_linux()):
if ecc:
args.ecc = ecc
if ecc_blocks:
args.ecc_blocks = ecc_blocks
if pcie:
args.pcie = pcie
current_platform_args += ["usage", "power", "clock", "temperature", "ecc", "ecc_blocks", "pcie"]
current_platform_values += [args.usage, args.power, args.clock, args.temperature, args.ecc, args.ecc_blocks, args.pcie]
current_platform_args += ["ecc", "ecc_blocks"]
current_platform_values += [args.ecc, args.ecc_blocks]
if self.helpers.is_baremetal() and self.helpers.is_linux():
if fan:
+4 -5
Просмотреть файл
@@ -807,12 +807,11 @@ class AMDSMIHelpers():
pci_devices_path = "/sys/bus/pci/devices"
pci_devices: set[str] = set()
for device in os.listdir(pci_devices_path):
subsystem_device_path = os.path.join(pci_devices_path, device, "subsystem_device")
device_path = os.path.join(pci_devices_path, device, "device")
try:
with open(subsystem_device_path, 'r') as f:
subsystem_device = f.read().strip()
pci_devices.add(subsystem_device)
with open(device_path, 'r') as f:
device = f.read().strip()
pci_devices.add(device)
except Exception as _:
continue
return pci_devices
+4 -1
Просмотреть файл
@@ -620,10 +620,10 @@ class AMDSMIParser(argparse.ArgumentParser):
static_parser.add_argument('-c', '--cache', action='store_true', required=False, help=cache_help)
static_parser.add_argument('-B', '--board', action='store_true', required=False, help=board_help)
static_parser.add_argument('-R', '--process-isolation', action='store_true', required=False, help=process_isolation_help)
static_parser.add_argument('-r', '--ras', action='store_true', required=False, help=ras_help)
# Options to display on Hypervisors and Baremetal
if self.helpers.is_hypervisor() or self.helpers.is_baremetal():
static_parser.add_argument('-r', '--ras', action='store_true', required=False, help=ras_help)
static_parser.add_argument('-p', '--partition', action='store_true', required=False, help=partition_help)
static_parser.add_argument('-l', '--limit', action='store_true', required=False, help=limit_help)
static_parser.add_argument('-P', '--soc-pstate', action='store_true', required=False, help=soc_pstate_help)
@@ -804,6 +804,9 @@ class AMDSMIParser(argparse.ArgumentParser):
metric_parser.add_argument('-c', '--clock', action='store_true', required=False, help=clock_help)
metric_parser.add_argument('-t', '--temperature', action='store_true', required=False, help=temperature_help)
metric_parser.add_argument('-P', '--pcie', action='store_true', required=False, help=pcie_help)
# Options that only apply to Hypervisors and Baremetal Linux
if self.helpers.is_hypervisor() or (self.helpers.is_baremetal() and self.helpers.is_linux()):
metric_parser.add_argument('-e', '--ecc', action='store_true', required=False, help=ecc_help)
metric_parser.add_argument('-k', '--ecc-blocks', action='store_true', required=False, help=ecc_blocks_help)
+2
Просмотреть файл
@@ -1,5 +1,7 @@
# Using AMD SMI Command Line Interface tool
**Disclaimer: CLI Tool is provided as an example code to aid the development of telemetry tools. Python or C++ Library is recommended as a reliable data source.**
AMD-SMI reports the version and current platform detected when running the command line interface (CLI) without arguments:
``` bash