Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions projects/amdsmi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr

***All information listed below is for reference and subject to change.***

## amd_smi_lib for ROCm 7.3.0
## amd_smi_lib for ROCm 7.11.0

### Added

- N/A
- **Added `os_kernel_version` to `amd-smi static --driver` output and default output**.
- Displays the Linux kernel version from `os.uname().release`.

### Changed

Expand Down
10 changes: 9 additions & 1 deletion projects/amdsmi/amdsmi_cli/amdsmi_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,8 @@ def static_gpu(self, args, multiple_devices=False, gpu=None, asic=None, bus=None
static_dict['limit'] = limit_info
if args.driver:
driver_info_dict = {"name" : "N/A",
"version" : "N/A"}
"version" : "N/A",
"os_kernel_version" : "N/A"}

try:
driver_info = amdsmi_interface.amdsmi_get_gpu_driver_info(args.gpu)
Expand All @@ -808,6 +809,11 @@ def static_gpu(self, args, multiple_devices=False, gpu=None, asic=None, bus=None
except amdsmi_exception.AmdSmiLibraryException as e:
logging.debug("Failed to get driver info for gpu %s | %s", gpu_id, e.get_error_info())

try:
driver_info_dict["os_kernel_version"] = os.uname().release
except (AttributeError, OSError) as e:
logging.debug("Failed to get os kernel version for gpu %s | %s", gpu_id, e)

static_dict['driver'] = driver_info_dict
if args.board:
static_dict['board'] = {"model_number": "N/A",
Expand Down Expand Up @@ -7517,10 +7523,12 @@ def default(self, args):
processors = amdsmi_interface.amdsmi_get_processor_handles()
version_info = {"amd-smi": "N/A",
"amdgpu version": "N/A",
"kernel version": "N/A",
"fw pldm version": "N/A",
"vbios version": "N/A",
"rocm version": (False, "N/A")}
version_info['rocm version'] = amdsmi_interface.amdsmi_get_rocm_version()
version_info['kernel version'] = os.uname().release
try:
version_info["amdgpu version"] = amdsmi_interface.amdsmi_get_gpu_driver_info(processors[0])
except amdsmi_exception.AmdSmiLibraryException as e:
Expand Down
8 changes: 7 additions & 1 deletion projects/amdsmi/amdsmi_cli/amdsmi_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,13 +1036,19 @@ def print_default_output(self, output: Dict):
amdgpu_version = str(driver_version['driver_version'])[:80]
fw_pldm_version = str(output['version_info']['fw pldm version'])
vbios_version = str(output['version_info']['vbios version'])
kernel_version = str(output['version_info']['kernel version'])

# print GPU info
print(default_line_1)
# Split the version line into 3 lines, each wrapping to the same width
print("| AMD-SMI {0:40s} {1:19s}|".format(amd_smi_version.ljust(40), ""))
if amdgpu_version != "N/A":

# Print amdgpu or kernel version based on availability, if neither then don't print
if amdgpu_version.strip() != "N/A":
print("| amdgpu Version: {0:40s} {1:19s}|".format(amdgpu_version, ""))
elif kernel_version.strip() != "N/A":
print("| OS kernel Version: {0:40s} {1:19s}|".format(kernel_version, ""))

if rocm_version != "N/A":
print("| ROCm Version: {0:40s} {1:19s}|".format(rocm_version, ""))

Expand Down
1 change: 1 addition & 0 deletions projects/amdsmi/py-interface/amdsmi_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,7 @@ def amdsmi_get_gpu_driver_info(
)
)

# Not including os_kernel_version here due to it just being os.uname().release
driver_info = {
"driver_name": info.driver_name.decode("utf-8"),
"driver_version": info.driver_version.decode("utf-8"),
Expand Down