From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7338 invoked by alias); 18 Mar 2016 17:49:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7256 invoked by uid 89); 18 Mar 2016 17:49:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=HX-HELO:eggs.gnu.org, Hx-spam-relays-external:208.118.235.92, H*RU:208.118.235.92 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 18 Mar 2016 17:48:57 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agyW4-0006b9-5l for gcc-patches@gcc.gnu.org; Fri, 18 Mar 2016 13:48:54 -0400 Received: from smtp.ispras.ru ([83.149.199.79]:58806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agyW3-0006aL-UT for gcc-patches@gcc.gnu.org; Fri, 18 Mar 2016 13:48:52 -0400 Received: from condor.intra.ispras.ru (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id DCA06226C8 for ; Fri, 18 Mar 2016 20:48:47 +0300 (MSK) Received: by condor.intra.ispras.ru (Postfix, from userid 23246) id 8BC7F1220719; Fri, 18 Mar 2016 20:48:47 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org Subject: [gomp-nvptx 3/7] libgomp plugin: make cuMemFreeHost error non-fatal Date: Fri, 18 Mar 2016 17:49:00 -0000 Message-Id: <1458323327-9908-4-git-send-email-amonakov@ispras.ru> In-Reply-To: <1458323327-9908-1-git-send-email-amonakov@ispras.ru> References: <1458323327-9908-1-git-send-email-amonakov@ispras.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.149.199.79 X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg01110.txt.bz2 Unlike cuMemFree and other resource-releasing functions called on exit, cuMemFreeHost appears to re-report errors encountered in kernel launch. This leads to a deadlock after GOMP_PLUGIN_fatal is reentered. While the behavior on libgomp side is suboptimal (there's no need to call resource-releasing functions if we're about to destroy the CUDA context anyway), this behavior on cuMemFreeHost part is not useful and just makes error "recovery" harder. This was reported to NVIDIA (bug ref. 1737876), but we can work around it by simply reporting the error without making it fatal. * plugin/plugin-nvptx.c (map_fini): Make cuMemFreeHost error non-fatal. --- libgomp/ChangeLog.gomp-nvptx | 4 ++++ libgomp/plugin/plugin-nvptx.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index adf57b1..4e44242 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -135,7 +135,7 @@ map_fini (struct ptx_stream *s) r = cuMemFreeHost (s->h); if (r != CUDA_SUCCESS) - GOMP_PLUGIN_fatal ("cuMemFreeHost error: %s", cuda_error (r)); + GOMP_PLUGIN_error ("cuMemFreeHost error: %s", cuda_error (r)); } static void