Find libamd_smi.so and librocm-core.so relative to wrapper.py

Allow amdsmi to find libamd_smi.so and librocm-core.so relative to
amdsmi_wrapper.py location.

The amdsmi_wrapper.py file is located in
_rocm_sdk_core/share/amd_smi/amdsmi and the libraries are in
_rocm_sdk_core/lib/libamd_smi.so.26.
_rocm_sdk_core/lib/librocm-core.so.1.
This commit is contained in:
Galantsev, Dmitrii
2025-10-29 18:10:38 -05:00
committed by Galantsev, Dmitrii
parent a2aae5e8a9
commit ad20d57162
3 changed files with 20 additions and 0 deletions
+6
View File
@@ -5511,6 +5511,12 @@ def amdsmi_get_rocm_version()-> Tuple[bool, str]:
try:
possible_locations = list()
# 0. Relative to amdsmi_interface.py in TheRock:
# `amdsmi_interface.py` is located in
# `_rocm_sdk_core/share/amd_smi/amdsmi`, libraries are in
# `_rocm_sdk_core/lib`.
librocm_core_path = Path(__file__).resolve().parent.parent.parent.parent / "lib/librocm-core.so"
possible_locations.append(librocm_core_path)
# 1.
rocm_path = os.getenv("ROCM_HOME", os.getenv("ROCM_PATH"))
if rocm_path: