From patchwork Fri Jan 26 12:00:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1891295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=B0XIhAxM; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9aPuD8gm; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=B0XIhAxM; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9aPuD8gm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TLxBg1T6Yz23fD for ; Fri, 26 Jan 2024 23:02:01 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 96B60385783F for ; Fri, 26 Jan 2024 12:01:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 55D073858289 for ; Fri, 26 Jan 2024 12:01:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55D073858289 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 55D073858289 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706270499; cv=none; b=Jy/Yg0Pxw0B8aHI91QpWc60Y1iv9/7xN82Qa9LNO3++1CJ6hEpW9uUoVcYjG80FeX0jLWp9UYfLXRwwi/1r/MuAGYIExaYTVzB9aqVxtRJRo4cEctDzRBIpSCfTpP7uO1affe3cHMzSh2yTof3zdSqzj0LwEGvTIZr8ieDvzwaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706270499; c=relaxed/simple; bh=szsva4/6N7vy8aIBDI+KXnRlWRCvHwsEufaQjCu0W3g=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=pNYHbLvcwF3Qgo0573qiqM/SNsDn3OZQDu6hlfDWxG2mpZ1th4q01d2ECemfam/h7xzaSgPd3uV1D7VgBBvENk8QBy0Ee1cRQOpgPYuLJQySE60aPmw9CFWETddik1Y6zeLPkOpUWT4uz5pE++WlzZ1y51L/yXyQagqk3QCLpVA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.4.150] (unknown [10.168.4.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 659ED1FB7E; Fri, 26 Jan 2024 12:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706270496; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=jymNGTLW8hDPw4JOuS/IaZBU+4Ye0XvdSVRsT5EsCc0=; b=B0XIhAxMaDdNhTv7xQz2NGEgD30kD/4BvjSh7OK2GEeOxTkc8iSDmILV7xS6TmAN2xiBSv TrOrd9rSTSQiEGqyZfxdVRJqtTtA9l0z8n5g0jZqSnLO4hbw6my6sjy85KU1Ddfh19FkS6 iwEhaNqvCME7Ka3vT/8z0E6npVEky/g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706270496; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=jymNGTLW8hDPw4JOuS/IaZBU+4Ye0XvdSVRsT5EsCc0=; b=9aPuD8gmBEboA7dOyV7Ym4yRmcKNHEQ/SEhuZ38DVagemS3WTPKTdzuCPlzgT/bXfpqCps WXCNza/wR1TIdQAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706270496; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=jymNGTLW8hDPw4JOuS/IaZBU+4Ye0XvdSVRsT5EsCc0=; b=B0XIhAxMaDdNhTv7xQz2NGEgD30kD/4BvjSh7OK2GEeOxTkc8iSDmILV7xS6TmAN2xiBSv TrOrd9rSTSQiEGqyZfxdVRJqtTtA9l0z8n5g0jZqSnLO4hbw6my6sjy85KU1Ddfh19FkS6 iwEhaNqvCME7Ka3vT/8z0E6npVEky/g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706270496; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=jymNGTLW8hDPw4JOuS/IaZBU+4Ye0XvdSVRsT5EsCc0=; b=9aPuD8gmBEboA7dOyV7Ym4yRmcKNHEQ/SEhuZ38DVagemS3WTPKTdzuCPlzgT/bXfpqCps WXCNza/wR1TIdQAQ== Date: Fri, 26 Jan 2024 13:00:28 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: ams@baylibre.com Subject: [PATCH] Avoid registering unsupported OMP offload devices MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Score: 2.31 X-Spamd-Result: default: False [2.31 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_SPAM_SHORT(2.80)[0.934]; MISSING_MID(2.50)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-1.89)[94.40%] X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Message-Id: <20240126120159.96B60385783F@sourceware.org> The following avoids registering unsupported GCN offload devices when iterating over available ones. With a Zen4 desktop CPU you will have an IGPU (unspported) which will otherwise be made available. This causes testcases like libgomp.c-c++-common/non-rect-loop-1.c which iterate over all decives to FAIL. I'll run a bootstrap with both pending changes and will do another round of full libgomp testing with this. OK if that succeeds? Thanks, Richard. libgomp/ * plugin/plugin-gcn.c (suitable_hsa_agent_p): Filter out agents with unsupported ISA. --- libgomp/plugin/plugin-gcn.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index 588358bbbf9..88ed77ff049 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -1427,6 +1427,8 @@ init_hsa_runtime_functions (void) #undef DLSYM_FN } +static gcn_isa isa_code(const char *isa); + /* Return true if the agent is a GPU and can accept of concurrent submissions from different threads. */ @@ -1443,6 +1445,13 @@ suitable_hsa_agent_p (hsa_agent_t agent) switch (device_type) { case HSA_DEVICE_TYPE_GPU: + { + char name[64]; + if ((hsa_fns.hsa_agent_get_info_fn (agent, HSA_AGENT_INFO_NAME, name) + != HSA_STATUS_SUCCESS) + || isa_code (name) == EF_AMDGPU_MACH_UNSUPPORTED) + return false; + } break; case HSA_DEVICE_TYPE_CPU: if (!support_cpu_devices)