1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
From: Xuanteng Huang <xuanteng.huang@outlook.com>
Date: Fri, 12 Jul 2024 22:29:27 +0800
Subject: modify shared lib loading path
Modify the shared library (.so) loading path with Linux FHS.
---
py-interface/amdsmi_wrapper.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: amdsmi/py-interface/amdsmi_wrapper.py
===================================================================
--- amdsmi.orig/py-interface/amdsmi_wrapper.py
+++ amdsmi/py-interface/amdsmi_wrapper.py
@@ -186,7 +186,8 @@ def find_smi_library():
# 2.
possible_locations.append("libamd_smi.so")
# 3.
- libamd_smi_parent_dir = Path(__file__).resolve().parent / "libamd_smi.so"
+ # usr/share/amd_smi/amdsmi -> usr/lib/x86_64-linux-gnu/libamd_smi.so
+ libamd_smi_parent_dir = Path(__file__).resolve().parent.parent.parent.parent / Path("lib/x86_64-linux-gnu/libamd_smi.so")
libamd_smi_cwd = Path.cwd() / "libamd_smi.so"
possible_locations.append(libamd_smi_parent_dir)
possible_locations.append(libamd_smi_cwd)
|