summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyangWu <xgreenlandforwyy@gmail.com>2021-08-19 22:30:23 +0800
committerCraig Andrews <candrews@gentoo.org>2021-08-19 15:46:23 -0400
commit89c4602e858ff22d0903f48953d33733760f190d (patch)
tree99154d6ab1633a2edbe85572d21c85b17749fbf3 /dev-util
parentdev-libs/rocr-runtime: bump version to 4.3.0 (diff)
downloadgentoo-89c4602e858ff22d0903f48953d33733760f190d.tar.gz
gentoo-89c4602e858ff22d0903f48953d33733760f190d.tar.bz2
gentoo-89c4602e858ff22d0903f48953d33733760f190d.zip
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@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/22034 Signed-off-by: Craig Andrews <candrews@gentoo.org>
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/rocminfo/Manifest1
-rw-r--r--dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch25
-rw-r--r--dev-util/rocminfo/rocminfo-4.3.0.ebuild25
3 files changed, 51 insertions, 0 deletions
diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
index 0cf9de248418..904d889fa683 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 000000000000..a01eb3ec3909
--- /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 000000000000..ba629c1e3b72
--- /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")