public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/, dev-util/rocm-smi/files/
@ 2022-06-10 10:28 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2022-06-10 10:28 UTC (permalink / raw
  To: gentoo-commits

commit:     9b15e9df8e00f31a1fbdd5938a495d21fb8bb120
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 10 10:24:53 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 10:28:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b15e9df

dev-util/rocm-smi: fix build with GCC 12

Closes: https://bugs.gentoo.org/840149
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../rocm-smi/files/rocm-smi-5.0.2-gcc12-memcpy.patch  | 19 +++++++++++++++++++
 dev-util/rocm-smi/rocm-smi-5.0.2.ebuild               |  4 ++++
 2 files changed, 23 insertions(+)

diff --git a/dev-util/rocm-smi/files/rocm-smi-5.0.2-gcc12-memcpy.patch b/dev-util/rocm-smi/files/rocm-smi-5.0.2-gcc12-memcpy.patch
new file mode 100644
index 000000000000..981efc14c23e
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-5.0.2-gcc12-memcpy.patch
@@ -0,0 +1,19 @@
+https://github.com/RadeonOpenCompute/rocm_smi_lib/pull/107
+https://bugs.gentoo.org/840149
+
+From 447bf22557c875ca7d26a72d20561feb607ed300 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Torsten=20Ke=C3=9Fler?= <t.kessler@posteo.de>
+Date: Fri, 13 May 2022 11:33:11 +0200
+Subject: [PATCH] Add missing string header for memcpy
+
+--- a/src/rocm_smi_gpu_metrics.cc
++++ b/src/rocm_smi_gpu_metrics.cc
+@@ -53,6 +53,7 @@
+ #include <regex>  // NOLINT
+ #include <vector>
+ #include <pthread.h>
++#include <string.h>
+ 
+ #include "rocm_smi/rocm_smi_common.h"  // Should go before rocm_smi.h
+ #include "rocm_smi/rocm_smi_main.h"
+

diff --git a/dev-util/rocm-smi/rocm-smi-5.0.2.ebuild b/dev-util/rocm-smi/rocm-smi-5.0.2.ebuild
index d9dd59e76bf1..c928d8c055fa 100644
--- a/dev-util/rocm-smi/rocm-smi-5.0.2.ebuild
+++ b/dev-util/rocm-smi/rocm-smi-5.0.2.ebuild
@@ -29,6 +29,10 @@ DEPEND=""
 RDEPEND="${PYTHON_DEPS}"
 BDEPEND=""
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-5.0.2-gcc12-memcpy.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/, dev-util/rocm-smi/files/
@ 2023-01-27  7:33 Joonas Niilola
  0 siblings, 0 replies; 2+ messages in thread
From: Joonas Niilola @ 2023-01-27  7:33 UTC (permalink / raw
  To: gentoo-commits

commit:     e6d20abad9fbc9a535341c82f5df908324a4a957
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Wed Jan 18 13:36:49 2023 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Jan 27 07:33:23 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6d20aba

dev-util/rocm-smi: add 5.4.2

Closes: https://bugs.gentoo.org/886513
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-util/rocm-smi/Manifest                         |  1 +
 .../rocm-smi-5.4.2-detect-builtin-amdgpu.patch     | 26 ++++++++++
 dev-util/rocm-smi/rocm-smi-5.4.2.ebuild            | 57 ++++++++++++++++++++++
 3 files changed, 84 insertions(+)

diff --git a/dev-util/rocm-smi/Manifest b/dev-util/rocm-smi/Manifest
index 9aab44729a91..a37fb72a90db 100644
--- a/dev-util/rocm-smi/Manifest
+++ b/dev-util/rocm-smi/Manifest
@@ -1,2 +1,3 @@
 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
+DIST rocm-smi-5.4.2.tar.gz 1553259 BLAKE2B 0560e115028caafb1d5dd8892cfa677431b792714ecd8c75f31451fa7685d1c7070cbd687c894d7eefd112de5e2df9aa7895aa57821db207dffc4e8890898638 SHA512 0fd651593df0ebbcb2c2327d030d2674efacdb6e883daa5a8adf733db2bde3e5d16dc304856221f4bb07a3cd834944ffcc7ebd689624f7ba24ffd6c262ba74b8

diff --git a/dev-util/rocm-smi/files/rocm-smi-5.4.2-detect-builtin-amdgpu.patch b/dev-util/rocm-smi/files/rocm-smi-5.4.2-detect-builtin-amdgpu.patch
new file mode 100644
index 000000000000..1c406c7d042c
--- /dev/null
+++ b/dev-util/rocm-smi/files/rocm-smi-5.4.2-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(-)
+
+Index: rocm_smi_lib-rocm-5.4.2/python_smi_tools/rocm_smi.py
+===================================================================
+--- rocm_smi_lib-rocm-5.4.2.orig/python_smi_tools/rocm_smi.py
++++ rocm_smi_lib-rocm-5.4.2/python_smi_tools/rocm_smi.py
+@@ -66,7 +66,7 @@ def driverInitialized():
+     """
+     driverInitialized = ''
+     try:
+-        driverInitialized = str(subprocess.check_output("cat /sys/module/amdgpu/initstate |grep live", 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.4.2.ebuild b/dev-util/rocm-smi/rocm-smi-5.4.2.ebuild
new file mode 100644
index 000000000000..bc4f8b802371
--- /dev/null
+++ b/dev-util/rocm-smi/rocm-smi-5.4.2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+
+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
+)
+
+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
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-27  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-10 10:28 [gentoo-commits] repo/gentoo:master commit in: dev-util/rocm-smi/, dev-util/rocm-smi/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-01-27  7:33 Joonas Niilola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox