From patchwork Tue Sep 22 11:39:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 1369018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BwfVg2f0Wz9sSC for ; Tue, 22 Sep 2020 21:39:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EDDFC386F441; Tue, 22 Sep 2020 11:39:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 8088C386F430 for ; Tue, 22 Sep 2020 11:39:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8088C386F430 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 14461B28E; Tue, 22 Sep 2020 11:40:25 +0000 (UTC) Date: Tue, 22 Sep 2020 13:39:46 +0200 From: Tom de Vries To: gcc-patches@gcc.gnu.org Subject: [committed][libgomp, nvptx] Print error log for link error Message-ID: <20200922113945.GA4471@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jakub Jelinek Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, By running libgomp test-case libgomp.c/target-28.c with GOMP_NVPTX_PTXRW=w (using a maintenance patch that adds support for this env var), we dump the ptx in target-28.exe to file. By editing one ptx file to rename gomp_nvptx_main to gomp_nvptx_main2 in both declaration and call, and running with GOMP_NVPTX_PTXRW=r, we trigger a link error: ... $ GOMP_NVPTX_PTXRW=r ./target-28.exe libgomp: cuLinkComplete error: unknown error ... The error is somewhat uninformative. Fix this by dumping the error log returned by the failing cuda call, such that we have instead: ... $ GOMP_NVPTX_PTXRW=r ./target-28.exe libgomp: Link error log error : \ Undefined reference to 'gomp_nvptx_main2' in '' libgomp: cuLinkComplete error: unknown error ... Build on x86_64 with nvptx accelerator, tested libgomp. Committed to trunk. Thanks, - Tom [libgomp, nvptx] Print error log for link error libgomp/ChangeLog: * plugin/plugin-nvptx.c (link_ptx): Print elog if cuLinkComplete call fails. --- libgomp/plugin/plugin-nvptx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 390804ad1fa..a63dd1a99fb 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -701,6 +701,7 @@ link_ptx (CUmodule *module, const struct targ_ptx_obj *ptx_objs, if (r != CUDA_SUCCESS) { + GOMP_PLUGIN_error ("Link error log %s\n", &elog[0]); GOMP_PLUGIN_error ("cuLinkComplete error: %s", cuda_error (r)); return false; }