diff options
author | YiyangWu <xgreenlandforwyy@gmail.com> | 2021-08-19 22:30:23 +0800 |
---|---|---|
committer | Craig Andrews <candrews@gentoo.org> | 2021-08-19 15:46:23 -0400 |
commit | 89c4602e858ff22d0903f48953d33733760f190d (patch) | |
tree | 99154d6ab1633a2edbe85572d21c85b17749fbf3 /dev-util/rocminfo/files | |
parent | dev-libs/rocr-runtime: bump version to 4.3.0 (diff) | |
download | gentoo-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/rocminfo/files')
-rw-r--r-- | dev-util/rocminfo/files/rocminfo-4.3.0-detect-builtin-amdgpu.patch | 25 |
1 files changed, 25 insertions, 0 deletions
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 |