From a097bb5fe279d1bce2c5fef9c01a32bb4eca774f Mon Sep 17 00:00:00 2001 From: "Narlo, Joseph" Date: Wed, 26 Feb 2025 19:09:40 -0600 Subject: [PATCH] [SWDEV-515031] Change Header Version to 25.2.0 (#109) Change Versioning Scheme to match https://semver.org/ Dropping the year enum and API fields in a future release. Should not impact library versioning since we are now starting from 25.2.0 --------- Signed-off-by: Joseph Narlo Co-authored-by: Arif, Maisam Change-Id: Id090e23f156926d08f9c0b781447388adf268cf6 [ROCm/amdsmi commit: d7c3ad0886498785153de461c0029a56206e61ed] --- projects/amdsmi/CHANGELOG.md | 6 ++++++ projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 2 +- projects/amdsmi/docs/conf.py | 11 +++++------ projects/amdsmi/docs/doxygen/Doxyfile | 2 +- projects/amdsmi/docs/how-to/amdsmi-cli-tool.md | 2 +- projects/amdsmi/include/amd_smi/amdsmi.h | 14 +++++++------- projects/amdsmi/py-interface/amdsmi_interface.py | 1 - .../amdsmi/rust-interface/src/amdsmi_wrapper.rs | 7 +++---- .../tests/amd_smi_test/functional/sys_info_read.cc | 10 ++++------ .../tests/amd_smi_test/functional/version_read.cc | 10 ++++------ 10 files changed, 32 insertions(+), 33 deletions(-) diff --git a/projects/amdsmi/CHANGELOG.md b/projects/amdsmi/CHANGELOG.md index c5f07a893b..a92c98e6a9 100644 --- a/projects/amdsmi/CHANGELOG.md +++ b/projects/amdsmi/CHANGELOG.md @@ -139,6 +139,10 @@ GPU: 0 ### Changed +- **AMDSMI Library Version number to reflect changes in backwards compatability**. +Removed Year from AMDSMI Library version number. Version changed from 25.2.0.0 (Year.Major.Minor.Patch) to 25.2.0 (Major.Minor.Patch) +Removed year in all version references + - **Removed initialization requirements for `amdsmi_get_lib_version()` and added `amdsmi_get_rocm_version()` to the python API & CLI**. - **Added an additional argument `sensor_ind` to `amdsmi_get_power_info()`**. @@ -398,6 +402,8 @@ GPU2 0000:46:00.0 32 Gb/s 512 Gb/s XGMI ### Upcoming changes +- **Deprication of the `AMDSMI_LIB_VERSION_YEAR` + ### Known issues - **AMD SMI only reports 63 GPU devices when setting CPX on all 8 GPUs** diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index c4ac8ac1ac..8cdf7b62e2 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -121,7 +121,7 @@ class AMDSMICommands(): try: amdsmi_lib_version = amdsmi_interface.amdsmi_get_lib_version() - amdsmi_lib_version_str = f"{amdsmi_lib_version['year']}.{amdsmi_lib_version['major']}.{amdsmi_lib_version['minor']}.{amdsmi_lib_version['release']}" + amdsmi_lib_version_str = f"{amdsmi_lib_version['major']}.{amdsmi_lib_version['minor']}.{amdsmi_lib_version['release']}" except amdsmi_exception.AmdSmiLibraryException as e: amdsmi_lib_version_str = e.get_error_info() diff --git a/projects/amdsmi/docs/conf.py b/projects/amdsmi/docs/conf.py index eec9e22d90..c727fbcac7 100644 --- a/projects/amdsmi/docs/conf.py +++ b/projects/amdsmi/docs/conf.py @@ -13,7 +13,6 @@ def get_version_info(filepath): content = f.read() version_pattern = ( - r"^#define\s+AMDSMI_LIB_VERSION_YEAR\s+(\d+)\s*$|" r"^#define\s+AMDSMI_LIB_VERSION_MAJOR\s+(\d+)\s*$|" r"^#define\s+AMDSMI_LIB_VERSION_MINOR\s+(\d+)\s*$|" r"^#define\s+AMDSMI_LIB_VERSION_RELEASE\s+(\d+)\s*$" @@ -21,19 +20,19 @@ def get_version_info(filepath): matches = re.findall(version_pattern, content, re.MULTILINE) - if len(matches) == 4: - version_year, version_major, version_minor, version_release = [ + if len(matches) == 3: + version_major, version_minor, version_release = [ match for match in matches if any(match) ] - return version_year[0], version_major[1], version_minor[2], version_release[3] + return version_major[0], version_minor[1], version_release[2] else: raise ValueError("Couldn't find all VERSION numbers.") -version_year, version_major, version_minor, version_release = get_version_info( +version_major, version_minor, version_release = get_version_info( "../include/amd_smi/amdsmi.h" ) -version_number = f"{version_year}.{version_major}.{version_minor}.{version_release}" +version_number = f"{version_major}.{version_minor}.{version_release}" # project info project = "AMD SMI" diff --git a/projects/amdsmi/docs/doxygen/Doxyfile b/projects/amdsmi/docs/doxygen/Doxyfile index 56da36eb1f..9225f76510 100644 --- a/projects/amdsmi/docs/doxygen/Doxyfile +++ b/projects/amdsmi/docs/doxygen/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = AMD SMI # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "25.2.0.0" +PROJECT_NUMBER = "25.2.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/projects/amdsmi/docs/how-to/amdsmi-cli-tool.md b/projects/amdsmi/docs/how-to/amdsmi-cli-tool.md index a759cc6fc2..4c58f95802 100644 --- a/projects/amdsmi/docs/how-to/amdsmi-cli-tool.md +++ b/projects/amdsmi/docs/how-to/amdsmi-cli-tool.md @@ -35,7 +35,7 @@ detected: ~$ amd-smi usage: amd-smi [-h] ... -AMD System Management Interface | Version: 25.2.0.0 | ROCm version: 6.4.0 | Platform: Linux Baremetal +AMD System Management Interface | Version: 25.2.0 | ROCm version: 6.4.0 | Platform: Linux Baremetal options: -h, --help show this help message and exit diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 29da833318..af70253adc 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -190,20 +190,20 @@ typedef enum { */ //! Year should follow the IP driver package version: 22.40/23.10 and similar -#define AMDSMI_LIB_VERSION_YEAR 25 +#define AMDSMI_LIB_VERSION_YEAR 25 //!< To Be Deprecated //! Major version should be changed for every header change (adding/deleting APIs, changing names, fields of structures, etc.) -#define AMDSMI_LIB_VERSION_MAJOR 2 +#define AMDSMI_LIB_VERSION_MAJOR 25 //! Minor version should be updated for each API change, but without changing headers -#define AMDSMI_LIB_VERSION_MINOR 0 +#define AMDSMI_LIB_VERSION_MINOR 2 //! Release version should be set to 0 as default and can be updated by the PMs for each CSP point release #define AMDSMI_LIB_VERSION_RELEASE 0 -#define AMDSMI_LIB_VERSION_CREATE_STRING(YEAR, MAJOR, MINOR, RELEASE) (#YEAR "." #MAJOR "." #MINOR "." #RELEASE) -#define AMDSMI_LIB_VERSION_EXPAND_PARTS(YEAR_STR, MAJOR_STR, MINOR_STR, RELEASE_STR) AMDSMI_LIB_VERSION_CREATE_STRING(YEAR_STR, MAJOR_STR, MINOR_STR, RELEASE_STR) -#define AMDSMI_LIB_VERSION_STRING AMDSMI_LIB_VERSION_EXPAND_PARTS(AMDSMI_LIB_VERSION_YEAR, AMDSMI_LIB_VERSION_MAJOR, AMDSMI_LIB_VERSION_MINOR, AMDSMI_LIB_VERSION_RELEASE) +#define AMDSMI_LIB_VERSION_CREATE_STRING(MAJOR, MINOR, RELEASE) (#MAJOR "." #MINOR "." #RELEASE) +#define AMDSMI_LIB_VERSION_EXPAND_PARTS(MAJOR_STR, MINOR_STR, RELEASE_STR) AMDSMI_LIB_VERSION_CREATE_STRING(MAJOR_STR, MINOR_STR, RELEASE_STR) +#define AMDSMI_LIB_VERSION_STRING AMDSMI_LIB_VERSION_EXPAND_PARTS(AMDSMI_LIB_VERSION_MAJOR, AMDSMI_LIB_VERSION_MINOR, AMDSMI_LIB_VERSION_RELEASE) /** * @brief GPU Capability info @@ -1594,7 +1594,7 @@ typedef struct { * @cond @tag{gpu_bm_linux} @endcond */ typedef struct { - uint32_t year; //!< Last 2 digits of the Year released + uint32_t year; //!< Last 2 digits of the Year released - To Be Depricated uint32_t major; //!< Major version uint32_t minor; //!< Minor version uint32_t release; //!< Patch, build or stepping version diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ba9cad6f6d..984d1db939 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2591,7 +2591,6 @@ def amdsmi_get_lib_version(): _check_res(amdsmi_wrapper.amdsmi_get_lib_version(ctypes.byref(version))) return { - "year": version.year, "major": version.major, "minor": version.minor, "release": version.release, diff --git a/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs b/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs index c52b99d20d..58c4817807 100644 --- a/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs +++ b/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs @@ -127,9 +127,9 @@ pub const AMDSMI_MAX_NUM_XCC: u32 = 8; pub const AMDSMI_MAX_NUM_XCP: u32 = 8; pub const AMDSMI_TIME_FORMAT: &[u8; 20] = b"%02d:%02d:%02d.%03d\0"; pub const AMDSMI_DATE_FORMAT: &[u8; 35] = b"%04d-%02d-%02d:%02d:%02d:%02d.%03d\0"; -pub const AMDSMI_LIB_VERSION_YEAR: u32 = 24; -pub const AMDSMI_LIB_VERSION_MAJOR: u32 = 7; -pub const AMDSMI_LIB_VERSION_MINOR: u32 = 1; +pub const AMDSMI_LIB_VERSION_YEAR: u32 = 25; +pub const AMDSMI_LIB_VERSION_MAJOR: u32 = 25; +pub const AMDSMI_LIB_VERSION_MINOR: u32 = 2; pub const AMDSMI_LIB_VERSION_RELEASE: u32 = 0; pub const AMDSMI_MAX_NUM_FREQUENCIES: u32 = 33; pub const AMDSMI_MAX_FAN_SPEED: u32 = 255; @@ -1889,7 +1889,6 @@ const _: () = { ["Size of AmdsmiVersionT"][::std::mem::size_of::() - 24usize]; ["Alignment of AmdsmiVersionT"][::std::mem::align_of::() - 8usize]; ["Offset of field: AmdsmiVersionT::year"] - [::std::mem::offset_of!(AmdsmiVersionT, year) - 0usize]; ["Offset of field: AmdsmiVersionT::major"] [::std::mem::offset_of!(AmdsmiVersionT, major) - 4usize]; ["Offset of field: AmdsmiVersionT::minor"] diff --git a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc index b6e5cbd9ba..eac51cce66 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc @@ -186,13 +186,11 @@ void TestSysInfoRead::Run(void) { err = amdsmi_get_lib_version(&ver); CHK_ERR_ASRT(err) - ASSERT_TRUE(ver.year != 0xFFFFFFFF && ver.major != 0xFFFFFFFF && - ver.minor != 0xFFFFFFFF && ver.release != 0xFFFFFFFF && - ver.build != nullptr); + ASSERT_TRUE(ver.major != 0xFFFFFFFF && ver.minor != 0xFFFFFFFF && + ver.release != 0xFFFFFFFF && ver.build != nullptr); IF_VERB(STANDARD) { - std::cout << "\t**AMD SMI Library version: " << ver.year << "." << - ver.major << "." << ver.minor << "." << ver.release << - " (" << ver.build << ")" << std::endl; + std::cout << "\t**AMD SMI Library version: " << ver.major << "." << + ver.minor << "." << ver.release << " (" << ver.build << ")" << std::endl; } std::cout << std::setbase(10); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/version_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/version_read.cc index c0da2d7fb5..24a429ba09 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/version_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/version_read.cc @@ -76,12 +76,10 @@ void TestVersionRead::Run(void) { err = amdsmi_get_lib_version(&ver); CHK_ERR_ASRT(err) - ASSERT_TRUE(ver.year != 0xFFFFFFFF && ver.major != 0xFFFFFFFF && - ver.minor != 0xFFFFFFFF && ver.release != 0xFFFFFFFF && - ver.build != nullptr); + ASSERT_TRUE(ver.major != 0xFFFFFFFF && ver.minor != 0xFFFFFFFF && + ver.release != 0xFFFFFFFF && ver.build != nullptr); IF_VERB(STANDARD) { - std::cout << "\t**AMD SMI Library version: " << ver.year << "." << - ver.major << "." << ver.minor << "." << ver.release << - " (" << ver.build << ")" << std::endl; + std::cout << "\t**AMD SMI Library version: " << ver.major << "." << + ver.minor << "." << ver.release << " (" << ver.build << ")" << std::endl; } }