public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocminfo/files/, dev-util/rocminfo/
@ 2023-02-01  9:53 Andreas Sturmlechner
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Sturmlechner @ 2023-02-01  9:53 UTC (permalink / raw
  To: gentoo-commits

commit:     f55458507d313fcc9056eb7c1b021324337439e8
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 24 22:16:13 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Feb  1 09:52:46 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5545850

dev-util/rocminfo: drop 5.0.2

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-util/rocminfo/Manifest                         |  1 -
 .../rocminfo-4.3.0-detect-builtin-amdgpu.patch     | 25 ------------------
 dev-util/rocminfo/rocminfo-5.0.2.ebuild            | 30 ----------------------
 3 files changed, 56 deletions(-)

diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
index fd18d19d9f8d..78cf76123025 100644
--- a/dev-util/rocminfo/Manifest
+++ b/dev-util/rocminfo/Manifest
@@ -1,3 +1,2 @@
-DIST rocminfo-5.0.2.tar.gz 15767 BLAKE2B 4617e4df51cc0b02d1743e655491600510e4f9fc22ef47612aa69bc311e7dc3979b0063c650d9a4fee0124be404b92c110dc9db056a554ee25ba3d4bfd12f618 SHA512 dd02837e621a414b54ef50b52ca816509ffa8b613e7de5f8b09449c5fc543dee054860a2245462008f687683af48203b6d2080fe71bf6e3654981d6bfd56e254
 DIST rocminfo-5.1.3.tar.gz 16772 BLAKE2B 1b35661f9e6cd8cd5180ef3e4fd3dd8e7d6b282947d25c81b0b8bd347a5bee11cf87d950bbd8adcbd7a8a3053c41622b8e99fc0b56f4a14bdf4acf20992becc7 SHA512 998d499b0ae9a22bde30b2c26e31587a78b5ed63a19649d5b203eb47a044f17d1d4d3e951ec094d5be1ca3ba37efa4b19f5b53047727158170fa90c13a8c7563
 DIST rocminfo-5.3.3.tar.gz 16829 BLAKE2B 341908048b9726a22ab5e81317916166d4ba114c5060fd8b7b455e0f4df3857b16a735cfccce2d013cd6632680e29b2e0c9ef91461d46b7e94dc71b0751aa42e SHA512 336a408eb49eb8d40b506f58d62de3fd406d00b0de169bc3f6176c76f1f50366347d212de8783b5c48ae1b6660d307b276ba6b3bac8d8286f5e93cfe739c4dae

diff --git a/dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch b/dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch
deleted file mode 100644
index a01eb3ec3909..000000000000
--- a/dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-/sys/module/amdgpu instead of lsmod for builtin amdgpu kernel module
-
-https://github.com/RadeonOpenCompute/rocminfo/pull/43
-https://github.com/RadeonOpenCompute/rocminfo/issues/42
---- a/rocminfo.cc
-+++ b/rocminfo.cc
-@@ -1035,14 +1035,15 @@ AcquireAndDisplayAgentInfo(hsa_agent_t agent, void* data) {
- 
- int CheckInitialState(void) {
-   // Check kernel module for ROCk is loaded
--  FILE *fd = popen("lsmod | grep amdgpu", "r");
--  char buf[16];
--  if (fread (buf, 1, sizeof (buf), fd) <= 0) {
-+  int module_dir;
-+  module_dir = open("/sys/module/amdgpu", O_DIRECTORY);
-+  if (module_dir < 0) {
-     printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n",
-                                                           COL_RED, COL_RESET);
-     return -1;
-   } else {
-     printf("%sROCk module is loaded%s\n", COL_WHT, COL_RESET);
-+	close(module_dir);
-   }
- 
-   // Check if user belongs to the group for /dev/kfd (e.g. "video" or

diff --git a/dev-util/rocminfo/rocminfo-5.0.2.ebuild b/dev-util/rocminfo/rocminfo-5.0.2.ebuild
deleted file mode 100644
index 1cbe2856e43a..000000000000
--- a/dev-util/rocminfo/rocminfo-5.0.2.ebuild
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit cmake
-
-if [[ ${PV} == *9999 ]] ; then
-	EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocminfo/"
-	inherit git-r3
-else
-	SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~amd64"
-	S="${WORKDIR}/rocminfo-rocm-${PV}"
-fi
-
-DESCRIPTION="ROCm Application for Reporting System Info"
-HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo"
-LICENSE="UoI-NCSA"
-SLOT="0/$(ver_cut 1-2)"
-
-RDEPEND=">=dev-libs/rocr-runtime-${PV}"
-DEPEND="${RDEPEND}"
-
-PATCHES=("${FILESDIR}/${PN}-4.3.0-detect-builtin-amdgpu.patch")
-
-src_prepare() {
-	sed -e "/CPACK_RESOURCE_FILE_LICENSE/d" -i CMakeLists.txt || die
-	cmake_src_prepare
-}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocminfo/files/, dev-util/rocminfo/
@ 2024-06-26  9:21 Sam James
  0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2024-06-26  9:21 UTC (permalink / raw
  To: gentoo-commits

commit:     2d7749ed3a7049a788fceb0c1fab5cbaa1989aed
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Sun Mar 24 19:17:45 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 09:19:21 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d7749ed

dev-util/rocminfo: drop 6.0.0-r1, enable python 3.13

Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/rocminfo/Manifest                         |  3 +-
 .../files/rocminfo-6.0.0-python-3-12-support.patch | 34 +++++++++++++++
 dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild         | 49 ----------------------
 ...rocminfo-6.1.0.ebuild => rocminfo-6.1.1.ebuild} |  2 +-
 4 files changed, 36 insertions(+), 52 deletions(-)

diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
index 276b0c865c61..600de24040c9 100644
--- a/dev-util/rocminfo/Manifest
+++ b/dev-util/rocminfo/Manifest
@@ -1,3 +1,2 @@
 DIST rocminfo-5.7.1.tar.gz 17302 BLAKE2B 395c695ed0b79c771c4240310c457aec893ffd889ddd551866753d2a0c8d4e98399672d74a7114a89faf8b1960dd54fbb0425ea00f7d15e5c740e33ce4046d0b SHA512 38726bc52bd045b6281cccd702706fd6ea5b57cdc421ad23106d5447a002f4b530e8d4e4430d2bb8eb30803af3bacdaf34646a965cea26f42d726bf7f6aafbab
-DIST rocminfo-6.0.0.tar.gz 17614 BLAKE2B f296d43103062c492c3a13a8f79a70ebe719126136abe38b020035f0e31819b9b25928aa538416ec9cc733a4e352e83fe8550d15c10f8071b7f889b361814fa6 SHA512 66de2e84b78f69a0c7d302e5432b08874374a45f7d577b158f23abbb40455c574868a7093e64c3a7d19e21dd13b48865a36bd626ef34b99ce52f3363bbb261a7
-DIST rocminfo-6.1.0.tar.gz 17734 BLAKE2B 3606c74b7b097a623175789e0ece4718da919bfdcc1b2852988d22ee67e036debbeba890e0667cb1ac2fb9ae3de05841a29fcf122a2feeed493bcdcbed021eea SHA512 417aad1bd65f056c43d264a5d0b62aa4c3b20ac4869a71efd5e6fa94a1cd4773112e75e1479efeae9342b8c222caba45213c75f1e8b8ece640bd47c934ace324
+DIST rocminfo-6.1.1.tar.gz 17740 BLAKE2B 6331054e1c8a59f2d4246c3fcb999afc28a8cabea9d5faf2b95d767f7153ab0930a633ee630cabc4472413a8a54fd9ef798516baa77e94aabda7687a36bf312f SHA512 d2982874ad09bfbe15418a88c2d3360f9bce262674d50f5858a08e52dd266e255f95116c85e069d7e8d28cb323164fb6999c5834163105f33e0c773aede4efdf

diff --git a/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch b/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch
new file mode 100644
index 000000000000..2b14e42e4705
--- /dev/null
+++ b/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch
@@ -0,0 +1,34 @@
+Fix "SyntaxWarning: invalid escape sequence" SyntaxWarning in python 3.12+
+Bug: https://github.com/ROCm/rocminfo/issues/69
+--- a/rocm_agent_enumerator
++++ b/rocm_agent_enumerator
+@@ -92,7 +92,7 @@ def getGCNISA(line, match_from_beginning = False):
+    return result.group(0)
+  return None
+ 
+-@staticVars(search_name=re.compile("gfx[0-9a-fA-F]+(:[-+:\w]+)?"))
++@staticVars(search_name=re.compile(r"gfx[0-9a-fA-F]+(:[-+:\w]+)?"))
+ def getGCNArchName(line):
+  result = getGCNArchName.search_name.search(line)
+ 
+@@ -149,9 +149,9 @@ def readFromROCMINFO(search_arch_name = False):
+ 
+   # search AMDGCN gfx ISA
+   if search_arch_name is True:
+-    line_search_term = re.compile("\A\s+Name:\s+(amdgcn-amd-amdhsa--gfx\d+)")
++    line_search_term = re.compile(r"\A\s+Name:\s+(amdgcn-amd-amdhsa--gfx\d+)")
+   else:
+-    line_search_term = re.compile("\A\s+Name:\s+(gfx\d+)")
++    line_search_term = re.compile(r"\A\s+Name:\s+(gfx\d+)")
+   for line in rocminfo_output:
+     if line_search_term.match(line) is not None:
+       if search_arch_name is True:
+@@ -172,7 +172,7 @@ def readFromLSPCI():
+   except:
+     lspci_output = []
+ 
+-  target_search_term = re.compile("1002:\w+")
++  target_search_term = re.compile(r"1002:\w+")
+   for line in lspci_output:
+     search_result = target_search_term.search(line)
+     if search_result is not None:

diff --git a/dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild b/dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild
deleted file mode 100644
index 4b5df7bd0033..000000000000
--- a/dev-util/rocminfo/rocminfo-6.0.0-r1.ebuild
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{11..12} )
-inherit cmake python-r1
-
-if [[ ${PV} == *9999 ]] ; then
-	EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocminfo/"
-	inherit git-r3
-else
-	SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~amd64"
-	S="${WORKDIR}/rocminfo-rocm-${PV}"
-fi
-
-DESCRIPTION="ROCm Application for Reporting System Info"
-HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo"
-LICENSE="UoI-NCSA"
-SLOT="0/$(ver_cut 1-2)"
-
-RDEPEND=">=dev-libs/rocr-runtime-${PV}
-	${PYTHON_DEPS}"
-DEPEND="${RDEPEND}"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-6.0.0-detect-builtin-amdgpu.patch"
-	"${FILESDIR}/${PN}-6.0.0_python-3.12.patch"
-)
-
-src_prepare() {
-	sed -e "/CPACK_RESOURCE_FILE_LICENSE/d" -i CMakeLists.txt || die
-	sed -e "/num_change_since_prev_pkg(/cset(NUM_COMMITS 0)" \
-		-i cmake_modules/utils.cmake || die # Fix QA issue on "git not found"
-	cmake_src_prepare
-}
-
-src_configure() {
-	local mycmakeargs=( -DROCRTST_BLD_TYPE=Release )
-	cmake_src_configure
-}
-
-src_install() {
-	cmake_src_install
-	rm "${ED}/usr/bin/rocm_agent_enumerator" || die
-	python_foreach_impl python_doexe rocm_agent_enumerator "${BUILD_DIR}"/rocm_agent_enumerator
-}

diff --git a/dev-util/rocminfo/rocminfo-6.1.0.ebuild b/dev-util/rocminfo/rocminfo-6.1.1.ebuild
similarity index 97%
rename from dev-util/rocminfo/rocminfo-6.1.0.ebuild
rename to dev-util/rocminfo/rocminfo-6.1.1.ebuild
index 90ec124928f3..5f6dfcd53860 100644
--- a/dev-util/rocminfo/rocminfo-6.1.0.ebuild
+++ b/dev-util/rocminfo/rocminfo-6.1.1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{11..12} )
+PYTHON_COMPAT=( python3_{11..13} )
 inherit cmake python-r1
 
 if [[ ${PV} == *9999 ]] ; then


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocminfo/files/, dev-util/rocminfo/
@ 2023-09-03  6:31 罗百科
  0 siblings, 0 replies; 6+ messages in thread
From: 罗百科 @ 2023-09-03  6:31 UTC (permalink / raw
  To: gentoo-commits

commit:     3a3bb43e54a6ea93fecdf9486e68fa748718a1c7
Author:     Patrick Lauer <patrick <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  3 06:30:45 2023 +0000
Commit:     罗百科 <patrick <AT> gentoo <DOT> org>
CommitDate: Sun Sep  3 06:31:23 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a3bb43e

dev-util/rocminfo: add 5.5.1

Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>

 dev-util/rocminfo/Manifest                         |   1 +
 .../rocminfo-5.5.1-detect-builtin-amdgpu.patch     | 105 +++++++++++++++++++++
 dev-util/rocminfo/rocminfo-5.5.1.ebuild            |  38 ++++++++
 3 files changed, 144 insertions(+)

diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
index 2d12d0105a99..ca11bdb959f9 100644
--- a/dev-util/rocminfo/Manifest
+++ b/dev-util/rocminfo/Manifest
@@ -1,3 +1,4 @@
 DIST rocminfo-5.1.3.tar.gz 16772 BLAKE2B 1b35661f9e6cd8cd5180ef3e4fd3dd8e7d6b282947d25c81b0b8bd347a5bee11cf87d950bbd8adcbd7a8a3053c41622b8e99fc0b56f4a14bdf4acf20992becc7 SHA512 998d499b0ae9a22bde30b2c26e31587a78b5ed63a19649d5b203eb47a044f17d1d4d3e951ec094d5be1ca3ba37efa4b19f5b53047727158170fa90c13a8c7563
 DIST rocminfo-5.3.3.tar.gz 16829 BLAKE2B 341908048b9726a22ab5e81317916166d4ba114c5060fd8b7b455e0f4df3857b16a735cfccce2d013cd6632680e29b2e0c9ef91461d46b7e94dc71b0751aa42e SHA512 336a408eb49eb8d40b506f58d62de3fd406d00b0de169bc3f6176c76f1f50366347d212de8783b5c48ae1b6660d307b276ba6b3bac8d8286f5e93cfe739c4dae
 DIST rocminfo-5.4.3.tar.gz 16832 BLAKE2B 2344b6bd3ffecdfa657559e4d4d8c09de862ebcda287fd67db9864d19aab0a928b071bc43ddd4a24a31037c61500b1bb9697d11b3031c860c5bac77392c664ef SHA512 80221c91f56cd04ba8dcbddd53bb47cb57bb97b74102890a7a43203e9a2fd572762025feb65676774f774a9a5f0d0a1293fc4508fc82d21b6b4042ad92210096
+DIST rocminfo-5.5.1.tar.gz 17020 BLAKE2B 42fdbd32b7092306dc4442910ae922b616c859439511e2acfb17dee32557d77a9731aeb1d7ce25d32ae76f9cafd1e56476ac522545efe516d238d9285fa7b4a3 SHA512 5710979ee885bf35d40b7d07b157226ea4bb84bd14a2c57bdf8c93ca483685a8ce39d01f15b828d015968102457e9a94335a5273524d98eca76d0f8ceed2e8c1

diff --git a/dev-util/rocminfo/files/rocminfo-5.5.1-detect-builtin-amdgpu.patch b/dev-util/rocminfo/files/rocminfo-5.5.1-detect-builtin-amdgpu.patch
new file mode 100644
index 000000000000..dd1aefe4df4f
--- /dev/null
+++ b/dev-util/rocminfo/files/rocminfo-5.5.1-detect-builtin-amdgpu.patch
@@ -0,0 +1,105 @@
+From 3a4d533a1e2a179ad873c480dc4a42ea23681263 Mon Sep 17 00:00:00 2001
+From: Mike Li <Tianxinmike.Li@amd.com>
+Date: Wed, 17 Aug 2022 11:44:09 -0400
+Subject: [PATCH 1/2] Check permission and handle PermissionError exception
+
+Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
+Change-Id: If7cb8464d0b761e4be45c85eb7147ceed609da61
+---
+ rocm_agent_enumerator | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/rocm_agent_enumerator b/rocm_agent_enumerator
+index 6264a5f..ceb9e11 100755
+--- a/rocm_agent_enumerator
++++ b/rocm_agent_enumerator
+@@ -195,10 +195,15 @@ def readFromKFD():
+       node_path = os.path.join(topology_dir, node)
+       if os.path.isdir(node_path):
+         prop_path = node_path + '/properties'
+-        if os.path.isfile(prop_path):
++        if os.path.isfile(prop_path) and os.access(prop_path, os.R_OK):
+           target_search_term = re.compile("gfx_target_version.+")
+           with open(prop_path) as f:
+-            line = f.readline()
++            try:
++              line = f.readline()
++            except PermissionError:
++              # We may have a subsystem (e.g. scheduler) limiting device visibility which
++              # could cause a permission error.
++              line = ''
+             while line != '' :
+               search_result = target_search_term.search(line)
+               if search_result is not None:
+
+From 94b4b3f0a66eb70912177ca7076b4267f8b5449b Mon Sep 17 00:00:00 2001
+From: Johannes Dieterich <johannes.dieterich@amd.com>
+Date: Mon, 21 Nov 2022 18:09:55 +0000
+Subject: [PATCH 2/2] Fix rocminfo when run within docker environments
+
+Currently, rocminfo will fail when executed inside a docker container
+due to being unable to lsmod inside docker. This has impacts on
+rocprofiler use.
+
+Fix this behavior by querying initstate of the amdgpu module from
+/sys/module/amdgpu instead. If initstate is marked "live" everything if
+fine - error out with either "not loaded" (initstate file does not
+exist) or "not live" (initstate file does not contain "live" string).
+
+Change-Id: I6f2e9655942fd4cf840fd3f56b7d69e893fa84d7
+---
+ rocminfo.cc | 30 ++++++++++++++++++++++++------
+ 1 file changed, 24 insertions(+), 6 deletions(-)
+
+diff --git a/rocminfo.cc b/rocminfo.cc
+index 0842d57..8ed9111 100755
+--- a/rocminfo.cc
++++ b/rocminfo.cc
+@@ -51,6 +51,7 @@
+ #include <unistd.h>
+ #include <pwd.h>
+ 
++#include <fstream>
+ #include <vector>
+ #include <string>
+ #include <sstream>
+@@ -1039,16 +1040,33 @@ AcquireAndDisplayAgentInfo(hsa_agent_t agent, void* data) {
+ 
+ int CheckInitialState(void) {
+   // Check kernel module for ROCk is loaded
+-  FILE *fd = popen("lsmod | grep amdgpu", "r");
+-  char buf[16];
+-  if (fread (buf, 1, sizeof (buf), fd) == 0) {
++
++  std::ifstream amdgpu_initstate("/sys/module/amdgpu/initstate");
++  if (amdgpu_initstate){
++    std::stringstream buffer;
++    buffer << amdgpu_initstate.rdbuf();
++    amdgpu_initstate.close();
++
++    std::string line;
++    bool is_live = false;
++    while (std::getline(buffer, line)){
++      if (line.find( "live" ) != std::string::npos){
++        is_live = true;
++        break;
++      }
++    }
++    if (is_live){
++      printf("%sROCk module is loaded%s\n", COL_WHT, COL_RESET);
++    } else {
++      printf("%sROCk module is NOT live, possibly no GPU devices%s\n",
++                                                          COL_RED, COL_RESET);
++      return -1;
++    }
++  } else {
+     printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n",
+                                                           COL_RED, COL_RESET);
+     return -1;
+-  } else {
+-    printf("%sROCk module is loaded%s\n", COL_WHT, COL_RESET);
+   }
+-  pclose(fd);
+ 
+   // Check if user belongs to the group for /dev/kfd (e.g. "video" or
+   // "render")

diff --git a/dev-util/rocminfo/rocminfo-5.5.1.ebuild b/dev-util/rocminfo/rocminfo-5.5.1.ebuild
new file mode 100644
index 000000000000..296b859a1fd3
--- /dev/null
+++ b/dev-util/rocminfo/rocminfo-5.5.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+if [[ ${PV} == *9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocminfo/"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+	S="${WORKDIR}/rocminfo-rocm-${PV}"
+fi
+
+DESCRIPTION="ROCm Application for Reporting System Info"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo"
+LICENSE="UoI-NCSA"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND=">=dev-libs/rocr-runtime-${PV}"
+DEPEND="${RDEPEND}"
+
+#PATCHES=(
+#	"${FILESDIR}/${PN}-5.5.1-detect-builtin-amdgpu.patch"
+#)
+
+src_prepare() {
+	sed -e "/CPACK_RESOURCE_FILE_LICENSE/d" -i CMakeLists.txt || die
+	sed -e "/num_change_since_prev_pkg(/cset(NUM_COMMITS 0)" -i cmake_modules/utils.cmake || die # Fix QA issue on "git not found"
+	cmake_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=( -DROCRTST_BLD_TYPE=Release )
+	cmake_src_configure
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocminfo/files/, dev-util/rocminfo/
@ 2021-08-19 19:46 Craig Andrews
  0 siblings, 0 replies; 6+ messages in thread
From: Craig Andrews @ 2021-08-19 19:46 UTC (permalink / raw
  To: gentoo-commits

commit:     89c4602e858ff22d0903f48953d33733760f190d
Author:     YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Thu Aug 19 14:30:23 2021 +0000
Commit:     Craig Andrews <candrews <AT> gentoo <DOT> org>
CommitDate: Thu Aug 19 19:46:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89c4602e

dev-util/rocminfo: bump version to 4.3.0

Now it can also detect builtin amdgpu kernel module

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/22034
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>

 dev-util/rocminfo/Manifest                         |  1 +
 .../rocminfo-4.3.0-detect-builtin-amdgpu.patch     | 25 ++++++++++++++++++++++
 dev-util/rocminfo/rocminfo-4.3.0.ebuild            | 25 ++++++++++++++++++++++
 3 files changed, 51 insertions(+)

diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
index 0cf9de24841..904d889fa68 100644
--- a/dev-util/rocminfo/Manifest
+++ b/dev-util/rocminfo/Manifest
@@ -5,3 +5,4 @@ DIST rocminfo-3.9.0.tar.gz 15106 BLAKE2B 0be734ee03298a83892fb237f7b171c7bb5779d
 DIST rocminfo-4.0.0.tar.gz 15104 BLAKE2B 858d0856a63af88bfb8d948f729fa4108aff0bbe21270d9679d14a2b5bb3230471f498143ce67921af3271e619896ca2cb1a624029f3154e7aa127c018dc9d74 SHA512 40496919dd40cd3a551c01be6023d81a60aebefa5aebdd2aee87cdec44fde4b54b89b67c380d65e25747ae7fc4d5b592dd01d4728dde447079ee7f63396c0c1a
 DIST rocminfo-4.1.0.tar.gz 15379 BLAKE2B dcf7a663792538dbe5c02fbc9e5874d1e716f2986db0a82f49c20130b4f26e8689be9821dd2e3a7363ad1f54106280e511f157b0d9ba2f67b9bc6fd064c7fe82 SHA512 a0bca3c42f360dfee6739de30d932d6eb0b627cd5d369b437d2fac6054a007a3b958ddf6f8b318bf9cab71b051cdf66ecd123b4cce4ef071bf98e0f2bb739c37
 DIST rocminfo-4.2.0.tar.gz 15379 BLAKE2B a76dd3f0d550d5b8a8c39454ef44d5f0a76ad24e4a3b75a9fd2a1b0d4d983a02a877c0eb4d2e4158f9c8c97602b52a2de9a1f535fad609a52e8cad48c4c8a833 SHA512 801c29ae88878b9448ad2f2c9faaa7ffba3a46c77887bebf2fa8d3db7e9258fb4678cf2b898ddfc88a34fcc0fdcc91c9aa2f4a1509eeb05db6a7b085ae28f3dc
+DIST rocminfo-4.3.0.tar.gz 15379 BLAKE2B 86683d8e88d26a8730cf84b3a1d4f69231ff7158186ca6b867b5a029ae485978cf0d67db2b07c05c046bb300b55b6e80e280b9429cef903e3077dc1da0945b8d SHA512 88b7f1ad86e76ede270d12fc3065eba192fcf3938d749b8345dac3b71be0985071dc5139a801ff46015369cd09b3eefcd8ff9ea71ab297476dda195f57792849

diff --git a/dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch b/dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch
new file mode 100644
index 00000000000..a01eb3ec390
--- /dev/null
+++ b/dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch
@@ -0,0 +1,25 @@
+/sys/module/amdgpu instead of lsmod for builtin amdgpu kernel module
+
+https://github.com/RadeonOpenCompute/rocminfo/pull/43
+https://github.com/RadeonOpenCompute/rocminfo/issues/42
+--- a/rocminfo.cc
++++ b/rocminfo.cc
+@@ -1035,14 +1035,15 @@ AcquireAndDisplayAgentInfo(hsa_agent_t agent, void* data) {
+ 
+ int CheckInitialState(void) {
+   // Check kernel module for ROCk is loaded
+-  FILE *fd = popen("lsmod | grep amdgpu", "r");
+-  char buf[16];
+-  if (fread (buf, 1, sizeof (buf), fd) <= 0) {
++  int module_dir;
++  module_dir = open("/sys/module/amdgpu", O_DIRECTORY);
++  if (module_dir < 0) {
+     printf("%sROCk module is NOT loaded, possibly no GPU devices%s\n",
+                                                           COL_RED, COL_RESET);
+     return -1;
+   } else {
+     printf("%sROCk module is loaded%s\n", COL_WHT, COL_RESET);
++	close(module_dir);
+   }
+ 
+   // Check if user belongs to the group for /dev/kfd (e.g. "video" or

diff --git a/dev-util/rocminfo/rocminfo-4.3.0.ebuild b/dev-util/rocminfo/rocminfo-4.3.0.ebuild
new file mode 100644
index 00000000000..ba629c1e3b7
--- /dev/null
+++ b/dev-util/rocminfo/rocminfo-4.3.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+if [[ ${PV} == *9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocminfo/"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+	S="${WORKDIR}/rocminfo-rocm-${PV}"
+fi
+
+DESCRIPTION="ROCm Application for Reporting System Info"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND=">=dev-libs/rocr-runtime-${PV}"
+DEPEND="${RDEPEND}"
+
+PATCHES=("${FILESDIR}/${PN}-4.3.0-detect-builtin-amdgpu.patch")


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocminfo/files/, dev-util/rocminfo/
@ 2019-08-20 18:38 Craig Andrews
  0 siblings, 0 replies; 6+ messages in thread
From: Craig Andrews @ 2019-08-20 18:38 UTC (permalink / raw
  To: gentoo-commits

commit:     1a3655e916666b37a5567c6c2484d10fd8b7b842
Author:     Craig Andrews <candrews <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 20 18:37:49 2019 +0000
Commit:     Craig Andrews <candrews <AT> gentoo <DOT> org>
CommitDate: Tue Aug 20 18:37:49 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a3655e9

dev-util/rocminfo: 2.7.0 version bump

Package-Manager: Portage-2.3.72, Repoman-2.3.17
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>

 dev-util/rocminfo/Manifest                         |  1 +
 .../rocminfo/files/rocminfo-2.7.0-sizeof.patch     | 23 ++++++++++++++
 dev-util/rocminfo/rocminfo-2.7.0.ebuild            | 37 ++++++++++++++++++++++
 3 files changed, 61 insertions(+)

diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
index 28fcd10b1e6..3f79979809f 100644
--- a/dev-util/rocminfo/Manifest
+++ b/dev-util/rocminfo/Manifest
@@ -1 +1,2 @@
 DIST rocminfo-2.6.0.tar.gz 12293 BLAKE2B b08725b45f48e78841da9d6e57bb19a441a423e20f853d16024c620914059abf3cb2e61c12ae6fdfdb85eb3e984d488ae9975ab3fd2fcc529ecb576c6816fc92 SHA512 e2dae7e2e02b674b3ad959a3dffdcd8f550842edfd0eac5866259a6a12de1a5f935afbdcb37845fa189d0937c41186f0eb8be08e7b346ddef959d5dd7b62dca7
+DIST rocminfo-2.7.0.tar.gz 12671 BLAKE2B 6cb6e2fa458224654f4b672d117e2a6c71c7d5aeed8ac71cf7ecddb76d9209f25596521b31465a94fde1c91744fc9bf68e637f7ff4f67a000cbfbe4793c5fa4b SHA512 ffdaa3d11d85475c7600c6b25d8eb7f90cbda13b820f33c250a7ac9b90f92d4d5352d8baee765b4bd3b9c7389b5ab6d3b87df77bf62d6696ed8cd96bfc6be1a0

diff --git a/dev-util/rocminfo/files/rocminfo-2.7.0-sizeof.patch b/dev-util/rocminfo/files/rocminfo-2.7.0-sizeof.patch
new file mode 100644
index 00000000000..2d96bb22779
--- /dev/null
+++ b/dev-util/rocminfo/files/rocminfo-2.7.0-sizeof.patch
@@ -0,0 +1,23 @@
+From cf96f42165fe76b98f653f979b4c182279dcac64 Mon Sep 17 00:00:00 2001
+From: Wilfried Holzke <gentoo@holzke.net>
+Date: Fri, 16 Aug 2019 22:04:52 +0200
+Subject: [PATCH] Fixed sizeof(err_val) to return the number of characters in
+ the array
+
+---
+ rocminfo.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rocminfo.cc b/rocminfo.cc
+index 9fddcfb..ee20da8 100755
+--- a/rocminfo.cc
++++ b/rocminfo.cc
+@@ -72,7 +72,7 @@
+     char* err_str = NULL;                                                     \
+     if (hsa_status_string(err,                                                \
+             (const char**)&err_str) != HSA_STATUS_SUCCESS) {                  \
+-      snprintf(&(err_val[0]), sizeof(err_val[12]), "%#x", (uint32_t)err);     \
++      snprintf(&(err_val[0]), sizeof(err_val), "%#x", (uint32_t)err);         \
+       err_str = &(err_val[0]);                                                \
+     }                                                                         \
+     printf("%shsa api call failure at: %s:%d\n",                              \

diff --git a/dev-util/rocminfo/rocminfo-2.7.0.ebuild b/dev-util/rocminfo/rocminfo-2.7.0.ebuild
new file mode 100644
index 00000000000..6a46a0806b1
--- /dev/null
+++ b/dev-util/rocminfo/rocminfo-2.7.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+if [[ ${PV} == *9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocminfo/"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+	S="${WORKDIR}/rocminfo-roc-${PV}"
+fi
+
+DESCRIPTION="ROCm Application for Reporting System Info"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocr-runtime"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-2.6.0-cmake-variables.patch"
+	"${FILESDIR}/${P}-sizeof.patch"
+)
+
+src_configure() {
+	local mycmakeargs=(
+		-DROCM_DIR="${ESYSROOT}/usr"
+		-DROCR_INC_DIR="${ESYSROOT}/usr/include"
+		-DROCR_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
+	)
+	cmake-utils_src_configure
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/rocminfo/files/, dev-util/rocminfo/
@ 2019-08-07 17:38 Craig Andrews
  0 siblings, 0 replies; 6+ messages in thread
From: Craig Andrews @ 2019-08-07 17:38 UTC (permalink / raw
  To: gentoo-commits

commit:     95977d266eb00c29804dc6543a805a7575b2c04a
Author:     Craig Andrews <candrews <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 22:02:35 2019 +0000
Commit:     Craig Andrews <candrews <AT> gentoo <DOT> org>
CommitDate: Wed Aug  7 17:38:45 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95977d26

dev-util/rocminfo: ROCm Application for Reporting System Info

Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>

 dev-util/rocminfo/Manifest                         |  1 +
 .../files/rocminfo-2.6.0-cmake-variables.patch     | 31 +++++++++++++++++++
 dev-util/rocminfo/metadata.xml                     | 14 +++++++++
 dev-util/rocminfo/rocminfo-2.6.0.ebuild            | 36 ++++++++++++++++++++++
 4 files changed, 82 insertions(+)

diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
new file mode 100644
index 00000000000..28fcd10b1e6
--- /dev/null
+++ b/dev-util/rocminfo/Manifest
@@ -0,0 +1 @@
+DIST rocminfo-2.6.0.tar.gz 12293 BLAKE2B b08725b45f48e78841da9d6e57bb19a441a423e20f853d16024c620914059abf3cb2e61c12ae6fdfdb85eb3e984d488ae9975ab3fd2fcc529ecb576c6816fc92 SHA512 e2dae7e2e02b674b3ad959a3dffdcd8f550842edfd0eac5866259a6a12de1a5f935afbdcb37845fa189d0937c41186f0eb8be08e7b346ddef959d5dd7b62dca7

diff --git a/dev-util/rocminfo/files/rocminfo-2.6.0-cmake-variables.patch b/dev-util/rocminfo/files/rocminfo-2.6.0-cmake-variables.patch
new file mode 100644
index 00000000000..1678f504327
--- /dev/null
+++ b/dev-util/rocminfo/files/rocminfo-2.6.0-cmake-variables.patch
@@ -0,0 +1,31 @@
+https://github.com/RadeonOpenCompute/rocminfo/pull/17
+
+From c9bfc4b3db029b8502f900cd9bb545a675ca0898 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Thu, 25 Jul 2019 17:59:51 -0400
+Subject: [PATCH] Use CACHE variables, allow overriding
+ ROCR_LIB_DIR/ROCR_INC_DIR
+
+CACHE variables allow for variables to be documented, and ROCR_LIB_DIR/ROCR_INC_DIR should be overridable as they'll have different values on different Linux distributions.
+---
+ CMakeLists.txt | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b5fa9dd..f8f430f 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -43,9 +43,10 @@ endif()
+ #
+ 
+ # Required Defines first:
+-
+-set(ROCR_INC_DIR ${ROCM_DIR}/include)
+-set(ROCR_LIB_DIR ${ROCM_DIR}/lib)
++set(ROCRTST_BLD_BITS CACHE "64" STRING "Either 32 or 64")
++set(ROCM_DIR CACHE PATH "Root for RocM install")
++set(ROCR_INC_DIR ${ROCM_DIR}/include CACHE PATH "Path for RocM includes")
++set(ROCR_LIB_DIR ${ROCM_DIR}/lib CACHE PATH "Path for RocM libraries")
+ #
+ # Determine ROCR Header files are present
+ #

diff --git a/dev-util/rocminfo/metadata.xml b/dev-util/rocminfo/metadata.xml
new file mode 100644
index 00000000000..c7439799c48
--- /dev/null
+++ b/dev-util/rocminfo/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+    <maintainer type="person">
+        <email>candrews@gentoo.org</email>
+        <name>Craig Andrews</name>
+    </maintainer>
+    <upstream>
+        <remote-id type="github">RadeonOpenCompute/rocminfo</remote-id>
+    </upstream>
+    <longdescription lang="en">
+        ROCm Application for Reporting System Info
+    </longdescription>
+</pkgmetadata>

diff --git a/dev-util/rocminfo/rocminfo-2.6.0.ebuild b/dev-util/rocminfo/rocminfo-2.6.0.ebuild
new file mode 100644
index 00000000000..9d2f7d5e0eb
--- /dev/null
+++ b/dev-util/rocminfo/rocminfo-2.6.0.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+if [[ ${PV} == *9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/RadeonOpenCompute/rocminfo/"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+	S="${WORKDIR}/rocminfo-roc-${PV}"
+fi
+
+DESCRIPTION="ROCm Application for Reporting System Info"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocr-runtime"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/${P}-cmake-variables.patch"
+)
+
+src_configure() {
+	local mycmakeargs=(
+		-DROCM_DIR="${ESYSROOT}/usr"
+		-DROCR_INC_DIR="${ESYSROOT}/usr/include"
+		-DROCR_LIB_DIR="${EPREFIX}/usr/$(get_libdir)/hsa"
+	)
+	cmake-utils_src_configure
+}


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

end of thread, other threads:[~2024-06-26  9:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01  9:53 [gentoo-commits] repo/gentoo:master commit in: dev-util/rocminfo/files/, dev-util/rocminfo/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2024-06-26  9:21 Sam James
2023-09-03  6:31 罗百科
2021-08-19 19:46 Craig Andrews
2019-08-20 18:38 Craig Andrews
2019-08-07 17:38 Craig Andrews

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