File: 0004-modify-shared-lib-loading-path.patch

package info (click to toggle)
amdsmi 6.4.3%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,000 kB
  • sloc: cpp: 38,328; python: 20,520; ansic: 11,185; sh: 735; makefile: 20
file content (23 lines) | stat: -rw-r--r-- 1,029 bytes parent folder | download
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)