diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-06-30 08:00:51 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-06-30 08:00:51 +0100 |
commit | d5ee59790ee8298b8599b0aa0fa21a98b972a44d (patch) | |
tree | 2cc4393cdcfae28879cee110e5975f6e6b798f91 /dev-util/rocminfo | |
parent | d855918b46ba8714cf1320fe63b55fd0ed1748a6 (diff) |
gentoo auto-resync : 30:06:2024 - 08:00:50
Diffstat (limited to 'dev-util/rocminfo')
4 files changed, 0 insertions, 192 deletions
diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest index 0ea7c677da77..91ed22d1a6aa 100644 --- a/dev-util/rocminfo/Manifest +++ b/dev-util/rocminfo/Manifest @@ -1,7 +1,4 @@ -AUX rocminfo-5.1.3-detect-builtin-amdgpu.patch 1720 BLAKE2B 990b0bfd101fbe41e7dfda85f88d18763371f7c9cdc46ac10a5c695c45d8e29c08f1444b44524ba0917489b89d4906498c81e9e8d805f5ab9b98e2160a394799 SHA512 c193cc7f72df6cc8d5118f1f55ae184f8d80083aee255efb64762b4f0cc00f2c8973515617630dd8267dc1053cac4d1773683870563c29000eb4fd32a7f54e78 -AUX rocminfo-5.5.1-detect-builtin-amdgpu.patch 3763 BLAKE2B 8d37239cb8e9964bef2e22ea2e1ccfab53cd10247e4a04b4f7ec03c18fa3b1ad2b734169f277fad2cb8d951bee82d71f42ca97c3bd514edd44a65e78a0b82856 SHA512 5b9b4682ac1babe92ce5d86d9a2f2b62a556dbe804da53de2f34af36806b7ba8b53ba1d1eb0b2c446fb834bb91f46d06401f2f79e10f61f7b7b6cc1cf8846d25 AUX rocminfo-6.0.0-detect-builtin-amdgpu.patch 1004 BLAKE2B b75f82db423455391951e6477e7b5a2e63f39f5e8b8eeb88e1ebd7047267defdfd806de7b3b6289106dd70472f63f121426b8528e62cb2ee79d743d66d60529b SHA512 22507911ca38b5147db58c020caf5859e6782211d363059c3e15334348950a921ee00110fa7e16ba9315625eced32b1191ce2f51eb0c97e5c59a9f6c83a541f5 -AUX rocminfo-6.0.0-python-3-12-support.patch 1333 BLAKE2B df3d2a7f338327ac3fbe08820fef1b2f40bdc14aca7091313eb354f2f2bc41373fb67b765554df6939ef5f32fb7fe3cd6c295b4e381917117074ce3f9066b44a SHA512 9bbec362a3c8435a58be53500048ebb0458bff46b3793b9b21019e8994528afd703431bf6ce189a045afdef3941b14d143b2bfb38e50a26f3be16a448c3f6fef AUX rocminfo-6.0.0_python-3.12.patch 3102 BLAKE2B b11743bceb52b280835eccfe23815541f702c205d62c8e08b1a2a72e5d68882f16689b517f8733738657cef7fab7c933886168d3c9260567400827409856cb06 SHA512 59cca81b13fb3a01a7fbb5e9abf838571cd2ce09ea14e5bb1a72447b6450681dfc58d79cc524e9ffca03c9f4f23fd0cc524bf272fffeb5bc3cd0d70d5358e207 DIST rocminfo-5.7.1.tar.gz 17302 BLAKE2B 395c695ed0b79c771c4240310c457aec893ffd889ddd551866753d2a0c8d4e98399672d74a7114a89faf8b1960dd54fbb0425ea00f7d15e5c740e33ce4046d0b SHA512 38726bc52bd045b6281cccd702706fd6ea5b57cdc421ad23106d5447a002f4b530e8d4e4430d2bb8eb30803af3bacdaf34646a965cea26f42d726bf7f6aafbab DIST rocminfo-6.1.1.tar.gz 17740 BLAKE2B 6331054e1c8a59f2d4246c3fcb999afc28a8cabea9d5faf2b95d767f7153ab0930a633ee630cabc4472413a8a54fd9ef798516baa77e94aabda7687a36bf312f SHA512 d2982874ad09bfbe15418a88c2d3360f9bce262674d50f5858a08e52dd266e255f95116c85e069d7e8d28cb323164fb6999c5834163105f33e0c773aede4efdf 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 deleted file mode 100644 index 5d0b2ed284bd..000000000000 --- a/dev-util/rocminfo/files/rocminfo-5.1.3-detect-builtin-amdgpu.patch +++ /dev/null @@ -1,50 +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 -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/files/rocminfo-5.5.1-detect-builtin-amdgpu.patch b/dev-util/rocminfo/files/rocminfo-5.5.1-detect-builtin-amdgpu.patch deleted file mode 100644 index dd1aefe4df4f..000000000000 --- a/dev-util/rocminfo/files/rocminfo-5.5.1-detect-builtin-amdgpu.patch +++ /dev/null @@ -1,105 +0,0 @@ -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/files/rocminfo-6.0.0-python-3-12-support.patch b/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch deleted file mode 100644 index 2b14e42e4705..000000000000 --- a/dev-util/rocminfo/files/rocminfo-6.0.0-python-3-12-support.patch +++ /dev/null @@ -1,34 +0,0 @@ -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: |