| myst |
|
|---|
This section explains the versioning conventions used in the AMD SMI (System Management Interface) library and AMD SMI tool. Understanding these versioning rules helps developers maintain backward compatibility and communicate changes effectively.
The SMI library uses a three-part version number format:
major.minor.release
Version information is stored in the VERSION file at the root of the smi-lib repository:
major=<int_major>
minor=<int_minor>
release=<int_release>
The major version is incremented when changes affect backward compatibility of the API:
- Modification or removal of existing structures that break backward compatibility
- Breaking changes to enum definitions (removing values or reordering)
- Modifications to API function signatures
- Deprecating or removing existing APIs
- Any other breaking change in the amdsmi.h header file
When the major version is incremented, both minor and release versions are reset to 0.
The minor version is incremented when new functionality is added in a backward-compatible manner:
- Addition of new structures
- Addition of new enum values (without reordering existing ones)
- Addition of new API functions
- Non-breaking modifications to existing structures (e.g., adding new fields at the end)
- Any other non-breaking additions to the amdsmi.h header file
When the minor version is incremented, the release version is reset to 0.
The release version is incremented for implementation changes that don't affect the public API:
- Bug fixes
- Performance improvements
- Internal code refactoring
- Any changes outside the amdsmi.h header file (excluding cli/cpp folders)
The SMI tool uses a similar three-part version number format:
major.minor.release
Version information is defined in the smi_cli_helpers.h file:
#define AMDSMI_TOOL_VERSION_MAJOR 27
#define AMDSMI_TOOL_VERSION_MINOR 6
#define AMDSMI_TOOL_VERSION_RELEASE 0
The major version is incremented when changes affect the tool's command interface:
- Deprecating or removing existing commands
- Modifying input/output format of commands
The minor version is incremented for command changes that maintain backward compatibility:
- Adding new commands
- Improvements to existing commands
- Adding new options to existing commands without changing the basic input/output format
The release version is incremented for minor bug fixes and maintenance updates that don't add features or change command behavior.
Version numbers should be used throughout the codebase:
- For conditional compilation
- For feature detection
- For API compatibility checks
When referencing features or behavior, always include the version number where the feature was introduced or modified.
The SMI library and tool versions are not directly tied to each other, but certain tool versions may require minimum library versions to function correctly.
- Identify the type of change being made
- Update the appropriate version number in the VERSION file or header file
- Document the version change in the changelog
- Before: 31.1.2
- Change: Fix a bug in the temperature reporting function
- After: 31.1.3 (only release version incremented)
- Before: 31.1.3
- Change: Add new function amdsmi_get_new_metric()
- After: 31.2.0 (minor version incremented, release reset)
- Before: 31.2.0
- Change: Change parameter types in amdsmi_existing_function()
- After: 32.0.0 (major version incremented, minor and release reset)
- Before: 27.6.0
- Change: Add new command amdsmi new-command
- After: 27.7.0 (minor version incremented)