From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 6F7E83857C65 for ; Thu, 7 Mar 2024 14:07:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F7E83857C65 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6F7E83857C65 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::433 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709820458; cv=none; b=aOA2gLF6H4TPlHikEJaYFEo8wllyx6+DMBVu4Fm+HEarba2uuyImDbPpusAleFmWJy+ArZYOJrNIiYvpfgRzhTLIjZgOBf1Ygta1+ClexQOTA8g6Y92ZbZpesY0N8XsXD1QJ368wWB5VeLCpeZlf5JXr6AdHHILP3rGIvJkaHS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709820458; c=relaxed/simple; bh=8j/pHln0D8LYSn9JCkiSN7orjzhHrwa3c+NxMTjRny0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=mHczoZQy7xpXl6OZRVbCZyrrSOlz/qOwADgXNDUw1me1DPqAcn7tBF3OACkVVIQNFZ1GXiLqemfQsNm45Xneth8Bn75TMo0Qr+81Kjo9nvltb4Cp0u9WF/L+NwKoWumuRQnMtWxveMuLWzFJAPAuCdOGPprDK84ffdZnUn5l6Ss= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-33e70d71756so105944f8f.1 for ; Thu, 07 Mar 2024 06:07:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1709820454; x=1710425254; darn=gcc.gnu.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Iyf//wSlGE1NxoEEGMD4sEPAKFMgUAS4T+bUh8nV310=; b=leLy2mtAkCGxpdqPSUDQMxuDJKujH47FEQcjDs3gLDDmvi2vy8j8EYUA9j8LoqOZ+g ncvBXSrgdAo8ff/A/FDEiGlogOm9KI8JeUVCwjLqxan1eBhIpoiZx4dGn5VB9WAWBWsz hO2Uq0UKWs7cb5DfAtdiS6/5yx3T3nkXi7a6YuQm6mdE4alVz5yFtw8PTGSq2FYUKvEF 9yNU915ZiO0YYGewx5LXVp8EcFA0/3H4v1S6+WFCugpdqW9bfxvhyc2f06sRZ67Z+vq0 FfQOJfBqBpzjC+DmZqmtFzUQbapOMc7UBGDebxc9rr1+UGLTwrleEWdR+BC3MwSWJzXl vIkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709820454; x=1710425254; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Iyf//wSlGE1NxoEEGMD4sEPAKFMgUAS4T+bUh8nV310=; b=ezX9IrN5sjsh8N/ukpvuoBtslF2WLaA5YpqnuUL+rLJKRNimErdY0jZzKnBONI7y3/ Ol05WAefberH80ulIY/rvxjQvKhIEaEnvLPStbi/eYobEAGKFNxnRdoZCU44z78VwSX1 pGuTENXIr3U4TXDoeAqr5cLE0u3Yojdz7/Bnw9ms1qBGEeK+/l3JOoBNYUT60pmMb2QK 5Kc6aw3vqjn1s4qanv3r7zZZvlGq5pHujmK/inZTEkQgPikuweIRjEqzYBrUsnbEIHGj RRTVa/3HWguplSoahWCVlUiJcCLFDShYlFe7gJRQTJqvdjq36GAn5VqmIZpfrpLENr4d Z+PQ== X-Forwarded-Encrypted: i=1; AJvYcCVFEqqsl+lLpkFb+nWC6u1YDS4Dkmc+lGqq0jFZnYKh+bvFJx63cDGS4a83aE6mFxotWa7yNo/u6Mmi2Y9+bJPf8LueefMLzw== X-Gm-Message-State: AOJu0YxhlFdmUotEsvlR1CkVjGpaFdwh7z6raVON1jrj8jId6ORANgGE 18DDKaKvGorCk/hzKKnbz3wc3jDERVqICXeEOny6B029g4VPRqndcFH26ItmpAk= X-Google-Smtp-Source: AGHT+IE9JrLRG5uAwvTjvs2/QNmsCgh4/dJuq+0RopTHUkfTnx31vmacvNm+EkuLNrYD7rUQXeCItg== X-Received: by 2002:a5d:5010:0:b0:33e:6612:dfaf with SMTP id e16-20020a5d5010000000b0033e6612dfafmr1429355wrt.1.1709820454052; Thu, 07 Mar 2024 06:07:34 -0800 (PST) Received: from ?IPV6:2001:16b8:2a30:2d00:817a:ccdf:b4da:ce60? (200116b82a302d00817accdfb4dace60.dip.versatel-1u1.de. [2001:16b8:2a30:2d00:817a:ccdf:b4da:ce60]) by smtp.gmail.com with ESMTPSA id bq26-20020a5d5a1a000000b0033e2777f313sm15675781wrb.72.2024.03.07.06.07.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Mar 2024 06:07:33 -0800 (PST) Content-Type: multipart/alternative; boundary="------------EOohqn18fyDeZFG2CcepR0n7" Message-ID: Date: Thu, 7 Mar 2024 15:07:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: GCN: Even with 'GCN_SUPPRESS_HOST_FALLBACK' set, failure to 'init_hsa_runtime_functions' is not fatal Content-Language: en-US To: Thomas Schwinge Cc: Jakub Jelinek , Andrew Stubbs , gcc-patches@gcc.gnu.org References: <8c5112624e3cd17dd478d0ca5a59b2d24d1b16a5.1573560401.git.ams@codesourcery.com> <87y1aue0vd.fsf@euler.schwinge.ddns.net> <87cys66u49.fsf@euler.schwinge.ddns.net> From: Tobias Burnus In-Reply-To: <87cys66u49.fsf@euler.schwinge.ddns.net> X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,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 List-Id: This is a multi-part message in MIME format. --------------EOohqn18fyDeZFG2CcepR0n7 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Thomas, first, I have the feeling we talk about (more or less) the same code region and use the same words – but we talk about rather different things. Thus, you confuse me (and possibly Andrew) – and my reply confuses you. Thomas Schwinge wrote: > On 2024-03-07T12:43:07+0100, Tobias Burnus wrote: >> Thomas Schwinge wrote: >>> First, I think most users do not set GCN_SUPPRESS_HOST_FALLBACK – and it >>> is also not really desirable. > External users probably don't, but certainly all our internal testing is > setting it, First, I doubt it – secondly, if it were true, it was broken for the last 5 years or so as we definitely did not notice fails due to not working offload devices. – Neither for AMD GCN nor ... > and also implicitly all nvptx offloading testing: simply by > means of having such knob in the libgomp nvptx plugin. I did see it at some places set for AMD but I do not see any nvptx-specific environment variable which permits to do the same. However: > That is, the > libgomp nvptx plugin has an implicit 'suppress_host_fallback = true' for > (the original meaning of) that flag I think that's one of the problems here – you talk about suppress_host_fallback (implicit, original meaning), while I talk about the GCN_SUPPRESS_HOST_FALLBACK environment variable. Besides all the talk about suppress_host_fallback, 'init_hsa_runtime_functions' is not fatal' of the subject line seems to be something to be considered (beyond the patches you already suggested). >> If I run on my Linux system the system compiler with nvptx + gcn suppost >> installed, I get (with a nvptx permission problem): >> >> $ GCN_SUPPRESS_HOST_FALLBACK=1 ./a.out >> >> libgomp: GCN host fallback has been suppressed >> >> And exit code = 1. The same result with '-foffload=disable' or with >> '-foffload=nvptx-none'. > I can't tell if that's what you expect to see there, or not? Well, obviously not that I get this error by default – and as your wording indicated that the internal variable will be always true – and not only when the env var GCN_SUPPRESS_HOST_FALLBACK is explicit set, I worry that I would get the error any time. > (For avoidance of doubt: I'm expecting silent host-fallback execution in > case that libgomp GCN and/or nvptx plugins are available, but no > corresponding devices. That's what my patch achieves.) I concur that the silent host fallback should happen by default (unless env vars tell otherwise) - at least when either no code was generated for the device (e.g. -foffload=disable) or when the vendor runtime library is not available or no device (be it no hardware or no permission). That's the current behavior and if that remains, my main concern evaporates. * * * >> If we want to remove it, we can make it always false - but I am strongly >> against making it always true. > I'm confused. So you want the GCN and nvptx plugins to behave > differently in that regard? No – or at least: not unless GCN_SUPPRESS_HOST_FALLBACK is set. >> Use OMP_TARGET_OFFLOAD=mandatory (or that GCN env) if you want to >> prevent the host fallback, but don't break somewhat common systems. > That's an orthogonal concept? No – It's the same concept of the main use of the GCN_SUPPRESS_HOST_FALLBACK environment variable: You get a run-time error instead of a silent host fallback. But I have in the whole thread the feeling that – while talking about the same code region and throwing in the same words – we actually talk about completely different things. Tobias --------------EOohqn18fyDeZFG2CcepR0n7--