diff options
author | Yiyang Wu <xgreenlandforwyy@gmail.com> | 2022-06-25 18:56:55 +0800 |
---|---|---|
committer | Benda Xu <heroxbd@gentoo.org> | 2022-08-06 22:20:15 +0800 |
commit | 976187a0664388a0f03b3c2ef8b5434bc594c8ad (patch) | |
tree | 2e527863d7578290dd1855775f77799ca0c40f11 /dev-util/rocminfo | |
parent | dev-util/rocprofiler: Skip loading proprietary AQLProfile lib (diff) | |
download | gentoo-976187a0664388a0f03b3c2ef8b5434bc594c8ad.tar.gz gentoo-976187a0664388a0f03b3c2ef8b5434bc594c8ad.tar.bz2 gentoo-976187a0664388a0f03b3c2ef8b5434bc594c8ad.zip |
dev-util/rocminfo: add 5.1.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'dev-util/rocminfo')
-rw-r--r-- | dev-util/rocminfo/Manifest | 1 | ||||
-rw-r--r-- | dev-util/rocminfo/files/rocminfo-5.1.3-detect-builtin-amdgpu.patch | 50 | ||||
-rw-r--r-- | dev-util/rocminfo/rocminfo-5.1.3.ebuild | 31 |
3 files changed, 82 insertions, 0 deletions
diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest index 6c5dce60e7f1..6c2df6b0a95e 100644 --- a/dev-util/rocminfo/Manifest +++ b/dev-util/rocminfo/Manifest @@ -7,3 +7,4 @@ DIST rocminfo-4.1.0.tar.gz 15379 BLAKE2B dcf7a663792538dbe5c02fbc9e5874d1e716f29 DIST rocminfo-4.2.0.tar.gz 15379 BLAKE2B a76dd3f0d550d5b8a8c39454ef44d5f0a76ad24e4a3b75a9fd2a1b0d4d983a02a877c0eb4d2e4158f9c8c97602b52a2de9a1f535fad609a52e8cad48c4c8a833 SHA512 801c29ae88878b9448ad2f2c9faaa7ffba3a46c77887bebf2fa8d3db7e9258fb4678cf2b898ddfc88a34fcc0fdcc91c9aa2f4a1509eeb05db6a7b085ae28f3dc DIST rocminfo-4.3.0.tar.gz 15379 BLAKE2B 86683d8e88d26a8730cf84b3a1d4f69231ff7158186ca6b867b5a029ae485978cf0d67db2b07c05c046bb300b55b6e80e280b9429cef903e3077dc1da0945b8d SHA512 88b7f1ad86e76ede270d12fc3065eba192fcf3938d749b8345dac3b71be0985071dc5139a801ff46015369cd09b3eefcd8ff9ea71ab297476dda195f57792849 DIST rocminfo-5.0.2.tar.gz 15767 BLAKE2B 4617e4df51cc0b02d1743e655491600510e4f9fc22ef47612aa69bc311e7dc3979b0063c650d9a4fee0124be404b92c110dc9db056a554ee25ba3d4bfd12f618 SHA512 dd02837e621a414b54ef50b52ca816509ffa8b613e7de5f8b09449c5fc543dee054860a2245462008f687683af48203b6d2080fe71bf6e3654981d6bfd56e254 +DIST rocminfo-5.1.3.tar.gz 16772 BLAKE2B 1b35661f9e6cd8cd5180ef3e4fd3dd8e7d6b282947d25c81b0b8bd347a5bee11cf87d950bbd8adcbd7a8a3053c41622b8e99fc0b56f4a14bdf4acf20992becc7 SHA512 998d499b0ae9a22bde30b2c26e31587a78b5ed63a19649d5b203eb47a044f17d1d4d3e951ec094d5be1ca3ba37efa4b19f5b53047727158170fa90c13a8c7563 diff --git a/dev-util/rocminfo/files/rocminfo-5.1.3-detect-builtin-amdgpu.patch b/dev-util/rocminfo/files/rocminfo-5.1.3-detect-builtin-amdgpu.patch new file mode 100644 index 000000000000..5d0b2ed284bd --- /dev/null +++ b/dev-util/rocminfo/files/rocminfo-5.1.3-detect-builtin-amdgpu.patch @@ -0,0 +1,50 @@ +/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 +From ea4f017ed035928b1970e2589b02ec9b348c863e Mon Sep 17 00:00:00 2001 +From: YiyangWu <xgreenlandforwyy@gmail.com> +Date: Wed, 18 Aug 2021 21:05:20 +0800 +Subject: [PATCH] Check /sys/module/amdgpu for ROCk instead of lsmod + +Closes: #42 + +Signed-off-by: YiyangWu <xgreenlandforwyy@gmail.com> +--- + rocminfo.cc | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/rocminfo.cc b/rocminfo.cc +index 871f406..58c847d 100755 +--- a/rocminfo.cc ++++ b/rocminfo.cc +@@ -995,6 +995,8 @@ AcquireAndDisplayAgentInfo(hsa_agent_t agent, void* data) { + err = AcquireAgentInfo(agent, &agent_i); + RET_IF_HSA_ERR(err); + ++ std::string ind(kIndentSize, ' '); ++ + printLabel("*******", true); + std::string agent_ind("Agent "); + agent_ind += std::to_string(*agent_number).c_str(); +@@ -1031,16 +1033,16 @@ 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); + } +- 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.1.3.ebuild b/dev-util/rocminfo/rocminfo-5.1.3.ebuild new file mode 100644 index 000000000000..c090c863e060 --- /dev/null +++ b/dev-util/rocminfo/rocminfo-5.1.3.ebuild @@ -0,0 +1,31 @@ +# 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}-5.1.3-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 +} |