AMD-SMI-CLI - Packaging updates
Added fallback in amdsmi_init.py to access /opt/rocm/share/amd_smi
if python package is not installed
Made libamd_smi.so detection more reliable
Added PyYaml dependency to pyproject.toml
Added python3-clang dependency in CMakeLists
Updated python3 version dependency in CMakeLists
Update Readme
Added Release Notes
Change-Id: Ie3b85fde7563dd84dce499f229aac1f94bcc2989
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
This commit is contained in:
@@ -165,26 +165,28 @@ def char_pointer_cast(string, encoding='utf-8'):
|
||||
return ctypes.cast(string, ctypes.POINTER(ctypes.c_char))
|
||||
|
||||
|
||||
|
||||
### Match edits in generator.py from start to end
|
||||
### Start match
|
||||
_libraries = {}
|
||||
from pathlib import Path
|
||||
libamd_smi_optrocm = Path(__file__).parents[3] / "/lib/libamd_smi.so"
|
||||
libamd_smi_cpack = Path("@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/libamd_smi.so")
|
||||
libamd_smi_optrocm = Path("/opt/rocm/lib/libamd_smi.so")
|
||||
libamd_smi_parent_dir = Path(__file__).resolve().parent / "libamd_smi.so"
|
||||
libamd_smi_cwd = Path.cwd() / "libamd_smi.so"
|
||||
|
||||
if libamd_smi_optrocm.is_file():
|
||||
# try /opt/rocm/lib as a fallback
|
||||
_libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_optrocm)
|
||||
elif libamd_smi_cpack.is_file():
|
||||
if libamd_smi_cpack.is_file():
|
||||
# try to find library in install directory provided by CMake
|
||||
_libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_cpack)
|
||||
elif libamd_smi_optrocm.is_file():
|
||||
# try /opt/rocm/lib as a fallback
|
||||
_libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_optrocm)
|
||||
elif libamd_smi_parent_dir.is_file():
|
||||
# try to fall back to parent directory
|
||||
_libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_parent_dir)
|
||||
else:
|
||||
# lastly - search in current working directory
|
||||
_libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_cwd)
|
||||
### End match
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,11 +10,14 @@ name = "amdsmi"
|
||||
authors = [
|
||||
{name = "AMD", email = "amd-smi.support@amd.com"},
|
||||
]
|
||||
version = '0.3'
|
||||
version = '0.4'
|
||||
license = {file = "amdsmi/LICENSE"}
|
||||
readme = {file = "amdsmi/README.md", content-type = "text/markdown"}
|
||||
description = "SMI LIB - AMD GPU Monitoring Library"
|
||||
requires-python = ">=3.7"
|
||||
dependencies = [
|
||||
'PyYAML >= 5.0',
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
"Homepage" = "https://github.com/RadeonOpenCompute/amdsmi"
|
||||
|
||||
Reference in New Issue
Block a user