[SWDEV-503520] Add amdsmi_get_rocm_version() in python library (#76)

Changed amdsmi_get_rocm_version() to be an API in the python library only. 
Updated usage and version detection
Updated path detection of librocm-core.so
Updated docs to reflect both amdsmi_get_rocm_version and amdsmi_get_lib_version() do not require initialization.

Signed-off-by: Arif, Maisam <Maisam.Arif@amd.com>

[ROCm/amdsmi commit: 52b3ee2dc6]
Šī revīzija ir iekļauta:
Arif, Maisam
2025-02-26 05:45:58 -06:00
revīziju iesūtīja GitHub
vecāks ac7bfb4849
revīzija 14db252ad1
9 mainīti faili ar 191 papildinājumiem un 120 dzēšanām
@@ -3541,28 +3541,6 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_get_lib_version
Description: Get the build version information for the currently running build of AMDSMI.
Output: amdsmi build version
Exceptions that can be thrown by `amdsmi_get_lib_version` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
Example:
```python
try:
version = amdsmi_get_lib_version()
print(version)
except AmdSmiException as e:
print(e)
```
### amdsmi_topo_get_numa_node_number
Description: Retrieve the NUMA CPU node number for a device
@@ -5092,3 +5070,49 @@ try:
except AmdSmiException as e:
print(e)
```
## No amdsmi_init APIs
### amdsmi_get_lib_version
Description: Get the build version information for the currently running build of AMDSMI. This function doesn't require amdsmi library init.
Output: amdsmi build version
Exceptions that can be thrown by `amdsmi_get_lib_version` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
Example:
```python
try:
version = amdsmi_get_lib_version()
print(version)
except AmdSmiException as e:
print(e)
```
### amdsmi_get_rocm_version
Description: This function attempts to retrieve the ROCm version by loading the `librocm-core.so` shared library. This function doesn't require amdsmi library init.
Output: Tuple (bool, str) containing rocm_load_status and version_message
Exceptions that can be thrown by `amdsmi_get_rocm_version` function:
* `AmdSmiLibraryException`
Example:
```python
try:
import amdsmi
rocm_load_status, version_message = amdsmi_get_rocm_version()
print(f"ROCm load status: {rocm_load_status}")
print(f"ROCm version msg: {version_message}")
except AmdSmiException as e:
print(e)
```