* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/files/, dev-util/rocm-smi/
@ 2024-07-20 6:42 Joonas Niilola
0 siblings, 0 replies; 4+ messages in thread
From: Joonas Niilola @ 2024-07-20 6:42 UTC (permalink / raw
To: gentoo-commits
commit: d953c7514231d39335733c921649429a429a6288
Author: NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Tue Jun 25 08:47:24 2024 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Jul 20 06:42:41 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d953c751
dev-util/rocm-smi: Port to C99, Python 3.12
Ported upstream bug, tested that it works well with Python 3.12
both for versions 3.4.2 and 5.7.1, well enough (my APU is only
partially supported and doesn't return much of interesting data)
Revbumped just in case.
Closes: https://bugs.gentoo.org/929551
Closes: https://bugs.gentoo.org/918709
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
.../files/rocm-smi-5.4.2-fix-readonly-object.patch | 14 +++++
dev-util/rocm-smi/rocm-smi-5.4.2-r1.ebuild | 58 ++++++++++++++++++++
dev-util/rocm-smi/rocm-smi-5.7.1-r3.ebuild | 61 ++++++++++++++++++++++
3 files changed, 133 insertions(+)
diff --git a/dev-util/rocm-smi/files/rocm-smi-5.4.2-fix-readonly-object.patch b/dev-util/rocm-smi/files/rocm-smi-5.4.2-fix-readonly-object.patch
new file mode 100644
index 000000000000..914fd2f6b426
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-5.4.2-fix-readonly-object.patch
@@ -0,0 +1,14 @@
+bug https://bugs.gentoo.org/918709
+patch from https://github.com/ROCm/rocm_smi_lib/issues/170#issuecomment-2130745220
+upstreamed in https://github.com/ROCm/rocm_smi_lib/commit/7fdc6e56c40ed6f02c888dcb1492944a9373ba74
+--- a/include/rocm_smi/rocm_smi_utils.h 2024-05-25 00:02:19.127412816 -0400
++++ b/include/rocm_smi/rocm_smi_utils.h 2024-05-25 00:03:25.359416227 -0400
+@@ -149,7 +149,7 @@
+ __forceinline ~ScopeGuard() {
+ if (!dismiss_) release_();
+ }
+- __forceinline ScopeGuard& operator=(const ScopeGuard& rhs) {
++ __forceinline ScopeGuard& operator=(ScopeGuard& rhs) {
+ dismiss_ = rhs.dismiss_;
+ release_ = rhs.release_;
+ rhs.dismiss_ = true;
diff --git a/dev-util/rocm-smi/rocm-smi-5.4.2-r1.ebuild b/dev-util/rocm-smi/rocm-smi-5.4.2-r1.ebuild
new file mode 100644
index 000000000000..e77f370cd678
--- /dev/null
+++ b/dev-util/rocm-smi/rocm-smi-5.4.2-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..12} )
+
+inherit cmake python-r1
+
+DESCRIPTION="ROCm System Management Interface Library"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+
+if [[ ${PV} == *9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib/archive/rocm-${PV}.tar.gz -> rocm-smi-${PV}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/rocm_smi_lib-rocm-${PV}"
+fi
+
+LICENSE="MIT NCSA-AMD"
+SLOT="0/$(ver_cut 1-2)"
+IUSE=""
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND=""
+RDEPEND="${PYTHON_DEPS}"
+BDEPEND=""
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.0.2-gcc12-memcpy.patch
+ "${FILESDIR}"/${PN}-5.4.2-detect-builtin-amdgpu.patch
+ "${FILESDIR}"/${PN}-5.4.2-fix-readonly-object.patch
+)
+
+src_prepare() {
+ sed -e "/LICENSE.txt/d" -i CMakeLists.txt || die
+ sed -e "/^path_librocm = /c\path_librocm = '${EPREFIX}/usr/lib64/librocm_smi64.so'" \
+ -i python_smi_tools/rsmiBindings.py || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_DISABLE_FIND_PACKAGE_LATEX=ON
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ python_foreach_impl python_newscript python_smi_tools/rocm_smi.py rocm-smi
+ python_foreach_impl python_domodule python_smi_tools/rsmiBindings.py
+}
diff --git a/dev-util/rocm-smi/rocm-smi-5.7.1-r3.ebuild b/dev-util/rocm-smi/rocm-smi-5.7.1-r3.ebuild
new file mode 100644
index 000000000000..9d1d975d0e84
--- /dev/null
+++ b/dev-util/rocm-smi/rocm-smi-5.7.1-r3.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake python-r1
+
+DESCRIPTION="ROCm System Management Interface Library"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+
+if [[ ${PV} == *9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib/archive/rocm-${PV}.tar.gz -> rocm-smi-${PV}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/rocm_smi_lib-rocm-${PV}"
+fi
+
+LICENSE="MIT NCSA-AMD"
+SLOT="0/$(ver_cut 1-2)"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+
+S="${WORKDIR}/rocm_smi_lib-rocm-${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.7.1-set-soversion.patch
+ "${FILESDIR}"/${PN}-5.7.1-no-strip.patch
+ "${FILESDIR}"/${PN}-5.7.1-remove-example.patch
+ "${FILESDIR}"/${PN}-5.4.2-detect-builtin-amdgpu.patch
+ "${FILESDIR}"/${PN}-5.4.2-fix-readonly-object.patch
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed "s/\${PKG_VERSION_STR}/${PV}/" -i CMakeLists.txt || die
+ sed -e "s/@VERSION_MAJOR@/$(ver_cut 1)/ ; s/@VERSION_MINOR@/$(ver_cut 2)/" \
+ -i oam/CMakeLists.txt -i rocm_smi/CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ python_foreach_impl python_newscript python_smi_tools/rocm_smi.py rocm-smi
+ python_foreach_impl python_domodule python_smi_tools/rsmiBindings.py
+
+ mv "${ED}"/usr/share/doc/rocm_smi "${ED}"/usr/share/doc/${PF} || die
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/files/, dev-util/rocm-smi/
@ 2024-03-10 2:16 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2024-03-10 2:16 UTC (permalink / raw
To: gentoo-commits
commit: fb314ed153d17c3831a83381cd68550187ac97db
Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Sat Mar 9 18:56:47 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 02:16:14 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb314ed1
dev-util/rocm-smi: return correct version in rsmi_version_get
This still retains librocm_smi64.so.1 for library name (as in older versions and Debian),
but rsmi_version_get() will return correct version (sys-process/btop-1.3.2 calls it).
Closes: https://bugs.gentoo.org/925448
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/rocm-smi-5.7.1-set-soversion.patch | 64 ++++++++++++++--------
...m-smi-5.7.1.ebuild => rocm-smi-5.7.1-r1.ebuild} | 5 +-
2 files changed, 44 insertions(+), 25 deletions(-)
diff --git a/dev-util/rocm-smi/files/rocm-smi-5.7.1-set-soversion.patch b/dev-util/rocm-smi/files/rocm-smi-5.7.1-set-soversion.patch
index 203b179d3faa..f79276d7ab8d 100644
--- a/dev-util/rocm-smi/files/rocm-smi-5.7.1-set-soversion.patch
+++ b/dev-util/rocm-smi/files/rocm-smi-5.7.1-set-soversion.patch
@@ -5,7 +5,7 @@ This patch repeats approach of similar patch from Debian, additionally removing
https://salsa.debian.org/rocm-team/rocm-smi-lib/-/blob/master/debian/patches/0007-rocm_smi64-soversion.patch
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -30,27 +30,6 @@ set(SHARE_INSTALL_PREFIX
+@@ -30,18 +30,6 @@ set(SHARE_INSTALL_PREFIX
"share/${ROCM_SMI}"
CACHE STRING "Tests and Example install directory")
@@ -21,21 +21,12 @@ https://salsa.debian.org/rocm-team/rocm-smi-lib/-/blob/master/debian/patches/000
-set(${AMD_SMI_LIBS_TARGET}_VERSION_PATCH "0")
-set(${AMD_SMI_LIBS_TARGET}_VERSION_BUILD "0")
-
--# The following default version values should be updated as appropriate for
--# ABI breaks (update MAJOR and MINOR), and ABI/API additions (update MINOR).
--# Until ABI stabilizes VERSION_MAJOR will be 0. This should be over-ridden
--# by git tags (through "git describe") when they are present.
--set(PKG_VERSION_MAJOR 1)
--set(PKG_VERSION_MINOR 0)
--set(PKG_VERSION_PATCH 0)
--set(PKG_VERSION_NUM_COMMIT 0)
--
- ## Define default variable and variables for the optional build target
- ## rocm_smi_lib-dev
- set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE STRING "Default installation directory.")
+ # The following default version values should be updated as appropriate for
+ # ABI breaks (update MAJOR and MINOR), and ABI/API additions (update MINOR).
+ # Until ABI stabilizes VERSION_MAJOR will be 0. This should be over-ridden
--- a/oam/CMakeLists.txt
+++ b/oam/CMakeLists.txt
-@@ -29,23 +29,10 @@ set(OAM_NAME "oam")
+@@ -29,23 +29,11 @@ set(OAM_NAME "oam")
set(OAM_COMPONENT "lib${OAM_NAME}")
set(OAM_TARGET "${OAM_NAME}")
@@ -56,13 +47,23 @@ https://salsa.debian.org/rocm-team/rocm-smi-lib/-/blob/master/debian/patches/000
-else()
- set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
-endif ()
-+set(VERSION_MAJOR "1")
-+set(VERSION_MINOR "0")
++set(VERSION_MAJOR "@VERSION_MAJOR@")
++set(VERSION_MINOR "@VERSION_MINOR@")
+
-+set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
++set(SO_VERSION_MAJOR "1")
++set(SO_VERSION_STRING "1.0")
set(${OAM_NAME}_VERSION_MAJOR "${VERSION_MAJOR}")
set(${OAM_NAME}_VERSION_MINOR "${VERSION_MINOR}")
set(${OAM_NAME}_VERSION_PATCH "0")
+@@ -78,7 +66,7 @@ target_include_directories(${OAM_TARGET} PRIVATE
+
+ ## Set the VERSION and SOVERSION values
+ set_property(TARGET ${OAM_TARGET} PROPERTY
+- SOVERSION "${VERSION_MAJOR}")
++ SOVERSION "${SO_VERSION_MAJOR}")
+ set_property(TARGET ${OAM_TARGET} PROPERTY
+ VERSION "${SO_VERSION_STRING}")
+
--- a/python_smi_tools/rsmiBindings.py.in
+++ b/python_smi_tools/rsmiBindings.py.in
@@ -9,19 +9,9 @@ from enum import Enum
@@ -90,7 +91,7 @@ https://salsa.debian.org/rocm-team/rocm-smi-lib/-/blob/master/debian/patches/000
--- a/rocm_smi/CMakeLists.txt
+++ b/rocm_smi/CMakeLists.txt
-@@ -31,17 +31,8 @@ set(ROCM_SMI_TARGET "${ROCM_SMI}64")
+@@ -31,23 +31,10 @@ set(ROCM_SMI_TARGET "${ROCM_SMI}64")
## Include common cmake modules
include(utils)
@@ -105,8 +106,25 @@ https://salsa.debian.org/rocm-team/rocm-smi-lib/-/blob/master/debian/patches/000
-get_version_from_tag("5.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT)
-
-# VERSION_* variables should be set by get_version_from_tag
-+set(VERSION_MAJOR "1")
-+set(VERSION_MINOR "0")
- if ( ${ROCM_PATCH_VERSION} )
- set ( VERSION_PATCH ${ROCM_PATCH_VERSION})
- set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+-if ( ${ROCM_PATCH_VERSION} )
+- set ( VERSION_PATCH ${ROCM_PATCH_VERSION})
+- set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+-else()
+- set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
+-endif ()
++set(VERSION_MAJOR "@VERSION_MAJOR@")
++set(VERSION_MINOR "@VERSION_MINOR@")
++set(SO_VERSION_MAJOR "1")
++set(SO_VERSION_STRING "1.0")
+ set(${ROCM_SMI}_VERSION_MAJOR "${VERSION_MAJOR}")
+ set(${ROCM_SMI}_VERSION_MINOR "${VERSION_MINOR}")
+ set(${ROCM_SMI}_VERSION_PATCH "0")
+@@ -99,7 +86,7 @@ endif()
+
+ ## Set the VERSION and SOVERSION values
+ set_property(TARGET ${ROCM_SMI_TARGET} PROPERTY
+- SOVERSION "${VERSION_MAJOR}")
++ SOVERSION "${SO_VERSION_MAJOR}")
+ set_property(TARGET ${ROCM_SMI_TARGET} PROPERTY
+ VERSION "${SO_VERSION_STRING}")
+
diff --git a/dev-util/rocm-smi/rocm-smi-5.7.1.ebuild b/dev-util/rocm-smi/rocm-smi-5.7.1-r1.ebuild
similarity index 87%
rename from dev-util/rocm-smi/rocm-smi-5.7.1.ebuild
rename to dev-util/rocm-smi/rocm-smi-5.7.1-r1.ebuild
index 5fd0811bd980..86c31040d841 100644
--- a/dev-util/rocm-smi/rocm-smi-5.7.1.ebuild
+++ b/dev-util/rocm-smi/rocm-smi-5.7.1-r1.ebuild
@@ -37,8 +37,9 @@ PATCHES=(
src_prepare() {
cmake_src_prepare
- sed "s/\${PKG_VERSION_STR}/${PV}/g" \
- -i CMakeLists.txt -i oam/CMakeLists.txt -i rocm_smi/CMakeLists.txt || die
+ sed "s/\${PKG_VERSION_STR}/${PV}/" -i CMakeLists.txt || die
+ sed -e "s/@VERSION_MAJOR@/$(ver_cut 1)/ ; s/@VERSION_MINOR@/$(ver_cut 2)/" \
+ -i oam/CMakeLists.txt -i rocm_smi/CMakeLists.txt || die
}
src_configure() {
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/files/, dev-util/rocm-smi/
@ 2024-03-08 19:22 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2024-03-08 19:22 UTC (permalink / raw
To: gentoo-commits
commit: 13462cfec0e954c85f9f7962719d97de2ff92e43
Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Tue Oct 31 20:59:13 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 8 19:21:56 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13462cfe
dev-util/rocm-smi: add 5.7.1
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-util/rocm-smi/Manifest | 1 +
.../rocm-smi/files/rocm-smi-5.7.1-no-strip.patch | 36 +++++++
.../files/rocm-smi-5.7.1-remove-example.patch | 14 +++
.../files/rocm-smi-5.7.1-set-soversion.patch | 112 +++++++++++++++++++++
dev-util/rocm-smi/rocm-smi-5.7.1.ebuild | 58 +++++++++++
5 files changed, 221 insertions(+)
diff --git a/dev-util/rocm-smi/Manifest b/dev-util/rocm-smi/Manifest
index f173e1fd3cb0..d8623a5635f4 100644
--- a/dev-util/rocm-smi/Manifest
+++ b/dev-util/rocm-smi/Manifest
@@ -1,2 +1,3 @@
DIST rocm-smi-5.1.3.tar.gz 1701386 BLAKE2B c5e779f5c33fec0b1b39b09c758dfadd3c24e28f15381593f2959e5c2fb9f49af3a7ca1f9ab7d6bf34c5af4fbe3f0c0ae20c6c049cbf9421a9184735bb4a64a2 SHA512 7bf7af2b42a035c298c2f9009b6123671af41f9ca1a50607cfa362f39dbd82ff88f8c13ece6c4edab585edadd9072ed096a400dd3850851e1beef3633a8eb14e
DIST rocm-smi-5.4.2.tar.gz 1553259 BLAKE2B 0560e115028caafb1d5dd8892cfa677431b792714ecd8c75f31451fa7685d1c7070cbd687c894d7eefd112de5e2df9aa7895aa57821db207dffc4e8890898638 SHA512 0fd651593df0ebbcb2c2327d030d2674efacdb6e883daa5a8adf733db2bde3e5d16dc304856221f4bb07a3cd834944ffcc7ebd689624f7ba24ffd6c262ba74b8
+DIST rocm-smi-5.7.1.tar.gz 801646 BLAKE2B b4799bbdaeb7203c16117cd30511d589a2b96e15801bb9f1382fe7a4d87d43e1d4b458d6923b6ebd602fdccba74bd65bcb98766dbd83c48fc3e02219be8c1022 SHA512 ad364278f137228a39108c93d482635137ea2724a5a39debb5b32329493ebf5c706dcf3863e2e24b6f0b6286f3877942277f5ae447446f155518972b957f7d9d
diff --git a/dev-util/rocm-smi/files/rocm-smi-5.7.1-no-strip.patch b/dev-util/rocm-smi/files/rocm-smi-5.7.1-no-strip.patch
new file mode 100644
index 000000000000..07796295e71e
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-5.7.1-no-strip.patch
@@ -0,0 +1,36 @@
+--- a/oam/CMakeLists.txt
++++ b/oam/CMakeLists.txt
+@@ -82,15 +82,6 @@ set_property(TARGET ${OAM_TARGET} PROPERTY
+ set_property(TARGET ${OAM_TARGET} PROPERTY
+ VERSION "${SO_VERSION_STRING}")
+
+-## If the library is a release, strip the target library
+-if ("${CMAKE_BUILD_TYPE}" STREQUAL Release)
+- if(${BUILD_SHARED_LIBS}) #striping only for .so
+- add_custom_command(
+- TARGET ${OAM_TARGET}
+- POST_BUILD COMMAND ${CMAKE_STRIP} lib${OAM_TARGET}.so)
+- endif()
+-endif ()
+-
+ # use the target_include_directories() command to specify the include directories for the target
+ target_include_directories(${OAM_TARGET}
+ PUBLIC
+--- a/rocm_smi/CMakeLists.txt
++++ b/rocm_smi/CMakeLists.txt
+@@ -103,15 +103,6 @@ set_property(TARGET ${ROCM_SMI_TARGET} PROPERTY
+ set_property(TARGET ${ROCM_SMI_TARGET} PROPERTY
+ VERSION "${SO_VERSION_STRING}")
+
+-## If the library is a release, strip the target library
+-if ("${CMAKE_BUILD_TYPE}" STREQUAL Release)
+- if(${BUILD_SHARED_LIBS}) #stripping only for .so
+- add_custom_command(
+- TARGET ${ROCM_SMI_TARGET}
+- POST_BUILD COMMAND ${CMAKE_STRIP} lib${ROCM_SMI_TARGET}.so.${SO_VERSION_STRING})
+- endif()
+-endif ()
+-
+ #file reorganization changes
+ #rocm_smi.py moved to libexec/rocm_smi. so creating rocm-smi symlink
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
diff --git a/dev-util/rocm-smi/files/rocm-smi-5.7.1-remove-example.patch b/dev-util/rocm-smi/files/rocm-smi-5.7.1-remove-example.patch
new file mode 100644
index 000000000000..18e1f4c78b5d
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-5.7.1-remove-example.patch
@@ -0,0 +1,14 @@
+Remove example; unused, only generates not important QA warnings
+--- a/rocm_smi/CMakeLists.txt
++++ b/rocm_smi/CMakeLists.txt
+@@ -76,8 +76,10 @@ set(SMI_INC_LIST "")
+
+ set(SMI_EXAMPLE_EXE "rocm_smi_ex")
+
++if (WITH_EXAMPLE)
+ add_executable(${SMI_EXAMPLE_EXE} "example/rocm_smi_example.cc")
+ target_link_libraries(${SMI_EXAMPLE_EXE} ${ROCM_SMI_TARGET})
++endif()
+ add_library(${ROCM_SMI_TARGET} ${CMN_SRC_LIST} ${SMI_SRC_LIST}
+ ${CMN_INC_LIST} ${SMI_INC_LIST})
+ target_link_libraries(${ROCM_SMI_TARGET} pthread rt)
diff --git a/dev-util/rocm-smi/files/rocm-smi-5.7.1-set-soversion.patch b/dev-util/rocm-smi/files/rocm-smi-5.7.1-set-soversion.patch
new file mode 100644
index 000000000000..203b179d3faa
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-5.7.1-set-soversion.patch
@@ -0,0 +1,112 @@
+Forcefully set rocm_smi64 soversion to 1.
+Before intoduction of git-based versioning, soversion was 1.0.
+
+This patch repeats approach of similar patch from Debian, additionally removing dependency from git.
+https://salsa.debian.org/rocm-team/rocm-smi-lib/-/blob/master/debian/patches/0007-rocm_smi64-soversion.patch
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -30,27 +30,6 @@ set(SHARE_INSTALL_PREFIX
+ "share/${ROCM_SMI}"
+ CACHE STRING "Tests and Example install directory")
+
+-# provide git to utilities
+-find_program (GIT NAMES git)
+-
+-## Setup the package version based on git tags.
+-set(PKG_VERSION_GIT_TAG_PREFIX "rsmi_pkg_ver")
+-get_package_version_number("5.0.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
+-message("Package version: ${PKG_VERSION_STR}")
+-set(${AMD_SMI_LIBS_TARGET}_VERSION_MAJOR "${VERSION_MAJOR}")
+-set(${AMD_SMI_LIBS_TARGET}_VERSION_MINOR "${VERSION_MINOR}")
+-set(${AMD_SMI_LIBS_TARGET}_VERSION_PATCH "0")
+-set(${AMD_SMI_LIBS_TARGET}_VERSION_BUILD "0")
+-
+-# The following default version values should be updated as appropriate for
+-# ABI breaks (update MAJOR and MINOR), and ABI/API additions (update MINOR).
+-# Until ABI stabilizes VERSION_MAJOR will be 0. This should be over-ridden
+-# by git tags (through "git describe") when they are present.
+-set(PKG_VERSION_MAJOR 1)
+-set(PKG_VERSION_MINOR 0)
+-set(PKG_VERSION_PATCH 0)
+-set(PKG_VERSION_NUM_COMMIT 0)
+-
+ ## Define default variable and variables for the optional build target
+ ## rocm_smi_lib-dev
+ set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE STRING "Default installation directory.")
+--- a/oam/CMakeLists.txt
++++ b/oam/CMakeLists.txt
+@@ -29,23 +29,10 @@ set(OAM_NAME "oam")
+ set(OAM_COMPONENT "lib${OAM_NAME}")
+ set(OAM_TARGET "${OAM_NAME}")
+
+-################# Determine the library version #########################
+-set(SO_VERSION_GIT_TAG_PREFIX "oam_so_ver")
+-
+-# VERSION_* variables should be set by get_version_from_tag
+-message("Package version: ${PKG_VERSION_STR}")
+-
+-# Debian package specific variables
+-# Set a default value for the package version
+-get_version_from_tag("1.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT)
+-
+-# VERSION_* variables should be set by get_version_from_tag
+-if ( ${ROCM_PATCH_VERSION} )
+- set ( VERSION_PATCH ${ROCM_PATCH_VERSION})
+- set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+-else()
+- set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
+-endif ()
++set(VERSION_MAJOR "1")
++set(VERSION_MINOR "0")
++
++set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
+ set(${OAM_NAME}_VERSION_MAJOR "${VERSION_MAJOR}")
+ set(${OAM_NAME}_VERSION_MINOR "${VERSION_MINOR}")
+ set(${OAM_NAME}_VERSION_PATCH "0")
+--- a/python_smi_tools/rsmiBindings.py.in
++++ b/python_smi_tools/rsmiBindings.py.in
+@@ -9,19 +9,9 @@ from enum import Enum
+
+ import os
+
+-# Use ROCm installation path if running from standard installation
+-# With File Reorg rsmiBindings.py will be installed in /opt/rocm/libexec/rocm_smi.
+-# relative path changed accordingly
+-path_librocm = os.path.dirname(os.path.realpath(__file__)) + '/../../@CMAKE_INSTALL_LIBDIR@/librocm_smi64.so.@VERSION_MAJOR@'
+-if not os.path.isfile(path_librocm):
+- print('Unable to find %s . Trying /opt/rocm*' % path_librocm)
+- for root, dirs, files in os.walk('/opt', followlinks=True):
+- if 'librocm_smi64.so.@VERSION_MAJOR@' in files:
+- path_librocm = os.path.join(os.path.realpath(root), 'librocm_smi64.so.@VERSION_MAJOR@')
+- if os.path.isfile(path_librocm):
+- print('Using lib from %s' % path_librocm)
+- else:
+- print('Unable to find librocm_smi64.so.@VERSION_MAJOR@')
++path_librocm = ctypes.util.find_library("rocm_smi64")
++if not path_librocm:
++ print('Unable to find librocm_smi64.so')
+
+ # ----------> TODO: Support static libs as well as SO
+
+--- a/rocm_smi/CMakeLists.txt
++++ b/rocm_smi/CMakeLists.txt
+@@ -31,17 +31,8 @@ set(ROCM_SMI_TARGET "${ROCM_SMI}64")
+ ## Include common cmake modules
+ include(utils)
+
+-################# Determine the library version #########################
+-set(SO_VERSION_GIT_TAG_PREFIX "rsmi_so_ver")
+-
+-# VERSION_* variables should be set by get_version_from_tag
+-message("Package version: ${PKG_VERSION_STR}")
+-
+-# Debian package specific variables
+-# Set a default value for the package version
+-get_version_from_tag("5.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT)
+-
+-# VERSION_* variables should be set by get_version_from_tag
++set(VERSION_MAJOR "1")
++set(VERSION_MINOR "0")
+ if ( ${ROCM_PATCH_VERSION} )
+ set ( VERSION_PATCH ${ROCM_PATCH_VERSION})
+ set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
diff --git a/dev-util/rocm-smi/rocm-smi-5.7.1.ebuild b/dev-util/rocm-smi/rocm-smi-5.7.1.ebuild
new file mode 100644
index 000000000000..5fd0811bd980
--- /dev/null
+++ b/dev-util/rocm-smi/rocm-smi-5.7.1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake python-r1
+
+DESCRIPTION="ROCm System Management Interface Library"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+
+if [[ ${PV} == *9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib/archive/rocm-${PV}.tar.gz -> rocm-smi-${PV}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/rocm_smi_lib-rocm-${PV}"
+fi
+
+LICENSE="MIT NCSA-AMD"
+SLOT="0/$(ver_cut 1-2)"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+
+S="${WORKDIR}/rocm_smi_lib-rocm-${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.7.1-set-soversion.patch
+ "${FILESDIR}"/${PN}-5.7.1-no-strip.patch
+ "${FILESDIR}"/${PN}-5.7.1-remove-example.patch
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed "s/\${PKG_VERSION_STR}/${PV}/g" \
+ -i CMakeLists.txt -i oam/CMakeLists.txt -i rocm_smi/CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ python_foreach_impl python_newscript python_smi_tools/rocm_smi.py rocm-smi
+ python_foreach_impl python_domodule python_smi_tools/rsmiBindings.py
+
+ mv "${ED}"/usr/share/doc/rocm_smi "${ED}"/usr/share/doc/${PF} || die
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/files/, dev-util/rocm-smi/
@ 2022-08-06 14:23 Benda XU
0 siblings, 0 replies; 4+ messages in thread
From: Benda XU @ 2022-08-06 14:23 UTC (permalink / raw
To: gentoo-commits
commit: c1198ee528b9f90cca1f63baecf16c8dbd0741e6
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Mon Jul 11 09:04:21 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Aug 6 14:22:24 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1198ee5
dev-util/rocm-smi: add 5.1.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
dev-util/rocm-smi/Manifest | 1 +
.../rocm-smi-5.1.3-detect-builtin-amdgpu.patch | 26 +++++++++
dev-util/rocm-smi/rocm-smi-5.1.3.ebuild | 62 ++++++++++++++++++++++
3 files changed, 89 insertions(+)
diff --git a/dev-util/rocm-smi/Manifest b/dev-util/rocm-smi/Manifest
index d45d584c8345..a5d1a8903631 100644
--- a/dev-util/rocm-smi/Manifest
+++ b/dev-util/rocm-smi/Manifest
@@ -2,3 +2,4 @@ DIST rocm-smi-4.0.0.tar.gz 45065 BLAKE2B 90a28c162099deaa67c98701b79328c760973d8
DIST rocm-smi-4.3.0.tar.gz 1672482 BLAKE2B 21b35daa565ce368ac10110ba73f723c5d2125e401f5c8fa2d8e3300f450f39dd0c1de74681249868a842b568af0f2cf0d1f7bf0d40d338a7d1ee7c9e25b67dd SHA512 2bf5d3f1be50636c7c848cfa982fcdb6fbf25d648bcbe2a195e1153c7f4c8b11b2b3650aaa110eec780a218a1503afe84637c7d6e7e868e7065f8c51d8d3b8dd
DIST rocm-smi-4.5.2.tar.gz 1674835 BLAKE2B 7cf69170a4a8dedfdc467e3b8dc64bd829136062487814e169cca0deabcd05d8adaf4fc440173e10cd8117ae63119f10a09c3042b0915b865e0620322c940e91 SHA512 640645d07dbc93a85d4e498bcc88fa0caab36b5af0f9feabf8a2383786ccb2b588be625f46e90d1b71803c011891a62a3642098fd0eb83530d5d8e0a49d204dc
DIST rocm-smi-5.0.2.tar.gz 1677784 BLAKE2B 28e136a8b3c630ed7d5b514ad5bf985ff540df8e1fc2378b855032a6ebd2bcbcd4aab5e8a5a9e6462eacd2ac9ada0b8940aed582ce118d1066bded115af42e22 SHA512 bbad2bbebb81de42a15d8aa48e4751dbf9b8f9ee74633d16828f6977fadff35e9db0b7c9ee465a61c40a3e8f2f0f99b79cd5c5b142785cf61958d432f13d7f05
+DIST rocm-smi-5.1.3.tar.gz 1701386 BLAKE2B c5e779f5c33fec0b1b39b09c758dfadd3c24e28f15381593f2959e5c2fb9f49af3a7ca1f9ab7d6bf34c5af4fbe3f0c0ae20c6c049cbf9421a9184735bb4a64a2 SHA512 7bf7af2b42a035c298c2f9009b6123671af41f9ca1a50607cfa362f39dbd82ff88f8c13ece6c4edab585edadd9072ed096a400dd3850851e1beef3633a8eb14e
diff --git a/dev-util/rocm-smi/files/rocm-smi-5.1.3-detect-builtin-amdgpu.patch b/dev-util/rocm-smi/files/rocm-smi-5.1.3-detect-builtin-amdgpu.patch
new file mode 100644
index 000000000000..3f322aef3582
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-5.1.3-detect-builtin-amdgpu.patch
@@ -0,0 +1,26 @@
+Detect amdgpu module for amdgpu-builtin kernel
+From dc2a4b5b256692e1a6ecef45210682c316b961e0 Mon Sep 17 00:00:00 2001
+From: YiyangWu <xgreenlandforwyy@gmail.com>
+Date: Sat, 2 Apr 2022 16:40:11 +0800
+Subject: [PATCH] Check /sys/module/amdgpu for ROCk instead of lsmod
+
+Closes: #102
+
+Signed-off-by: YiyangWu <xgreenlandforwyy@gmail.com>
+---
+ python_smi_tools/rocm_smi.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/python_smi_tools/rocm_smi.py b/python_smi_tools/rocm_smi.py
+index 57606ee..35be495 100755
+--- a/python_smi_tools/rocm_smi.py
++++ b/python_smi_tools/rocm_smi.py
+@@ -66,7 +66,7 @@ def driverInitialized():
+ """
+ driverInitialized = ''
+ try:
+- driverInitialized = str(subprocess.check_output("cat /proc/modules|grep amdgpu", shell=True))
++ driverInitialized = str(subprocess.check_output("test -d /sys/module/amdgpu", shell=True))
+ except subprocess.CalledProcessError:
+ pass
+ if len(driverInitialized) > 0:
diff --git a/dev-util/rocm-smi/rocm-smi-5.1.3.ebuild b/dev-util/rocm-smi/rocm-smi-5.1.3.ebuild
new file mode 100644
index 000000000000..7947568516a5
--- /dev/null
+++ b/dev-util/rocm-smi/rocm-smi-5.1.3.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit cmake python-r1
+
+DESCRIPTION="ROCm System Management Interface Library"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+
+if [[ ${PV} == *9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/rocm_smi_lib/archive/rocm-${PV}.tar.gz -> rocm-smi-${PV}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/rocm_smi_lib-rocm-${PV}"
+fi
+
+LICENSE="MIT NCSA-AMD"
+SLOT="0/$(ver_cut 1-2)"
+IUSE=""
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND=""
+RDEPEND="${PYTHON_DEPS}"
+BDEPEND=""
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.0.2-gcc12-memcpy.patch
+ "${FILESDIR}"/${PN}-5.1.3-detect-builtin-amdgpu.patch
+)
+
+src_prepare() {
+ sed -e "/DESTINATION/s,\${OAM_NAME}/lib,$(get_libdir)," \
+ -e "/DESTINATION/s,oam/include/oam,include/oam," -i oam/CMakeLists.txt || die
+ sed -e "/link DESTINATION/,+1d" \
+ -e "/DESTINATION/s,\${ROCM_SMI}/lib,$(get_libdir)," \
+ -e "/bindings_link/,+3d" \
+ -e "/rsmiBindings.py/,+1d" \
+ -e "/DESTINATION/s,rocm_smi/include/rocm_smi,include/rocm_smi," -i rocm_smi/CMakeLists.txt || die
+ sed -e "/LICENSE.txt/d" -e "s,\${ROCM_SMI}/lib/cmake,$(get_libdir)/cmake,g" -i CMakeLists.txt || die
+ sed -e "/^path_librocm = /c\path_librocm = '${EPREFIX}/usr/lib64/librocm_smi64.so'" -i python_smi_tools/rsmiBindings.py || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_DISABLE_FIND_PACKAGE_LATEX=ON
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ python_foreach_impl python_newexe python_smi_tools/rocm_smi.py rocm-smi
+ python_foreach_impl python_domodule python_smi_tools/rsmiBindings.py
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-20 6:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-20 6:42 [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/files/, dev-util/rocm-smi/ Joonas Niilola
-- strict thread matches above, loose matches on Subject: below --
2024-03-10 2:16 Sam James
2024-03-08 19:22 Sam James
2022-08-06 14:23 Benda XU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox