From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 21212385742D for ; Thu, 12 May 2022 12:09:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 21212385742D Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EB7BD21C60; Thu, 12 May 2022 12:09:08 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BB2D413A84; Thu, 12 May 2022 12:09:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gAktLOT4fGKICgAAMHmgww (envelope-from ); Thu, 12 May 2022 12:09:08 +0000 Message-ID: <7ba7205d-5671-c577-853d-01556e8c08ec@suse.de> Date: Thu, 12 May 2022 14:09:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA' Content-Language: en-US To: Thomas Schwinge , gcc-patches@gcc.gnu.org Cc: Alexander Monakov , Jeff Law , Jakub Jelinek References: <20170113181123.GA1867@tucnak> <8735iottqe.fsf@dem-tschwing-1.ger.mentorg.com> <87k0b9e2z3.fsf@euler.schwinge.homeip.net> From: Tom de Vries In-Reply-To: <87k0b9e2z3.fsf@euler.schwinge.homeip.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2022 12:09:11 -0000 On 4/28/22 15:45, Thomas Schwinge wrote: > Hi Tom! > > On 2022-04-08T09:35:44+0200, Tom de Vries wrote: >> On 4/8/22 00:27, Thomas Schwinge wrote: >>> On 2017-01-13T19:11:23+0100, Jakub Jelinek wrote: >>>> Especially for distributions it is undesirable to need to have proprietary >>>> CUDA libraries and headers installed when building GCC. >>> >>>> --- libgomp/plugin/configfrag.ac.jj 2017-01-13 12:07:56.000000000 +0100 >>>> +++ libgomp/plugin/configfrag.ac 2017-01-13 17:33:26.608240936 +0100 >>> >>>> + PLUGIN_NVPTX_CPPFLAGS='-I$(srcdir)/plugin/cuda' >>>> + PLUGIN_NVPTX_LIBS='-ldl' >>>> + PLUGIN_NVPTX_DYNAMIC=1 >>> >>>> +AC_DEFINE_UNQUOTED([PLUGIN_NVPTX_DYNAMIC], [$PLUGIN_NVPTX_DYNAMIC], >>>> + [Define to 1 if the NVIDIA plugin should dlopen libcuda.so.1, 0 if it should be linked against it.]) >>> >>> Actually, the conditionals leading to 'PLUGIN_NVPTX_DYNAMIC=1' here do >>> control two orthogonal aspects; OK to disentangle that with the attached >>> "libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into >>> 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA'"? > >> we discussed dropping --with-cuda, so do I understand it correctly that >> you now propose to drop --with-cuda and --with-cuda-driver-lib but >> intend to keep --with-cuda-driver-include ? > > No, I think you're reading too much into this first patch. ;-) > > The goal with this patch is just to help disentangle two orthogonal > concepts (as described in the commit log), and then... > >> Can you explain what user or maintainer scenario is served by this? > > ... in a next step, we may indeed remove the current user-visible > '--with-cuda-driver' etc., but keep the underlying functionality > available for the developers. That's to address the point you'd made in > the "Proposal to remove '--with-cuda-driver'" thread: that it still > "could be useful for debugging / comparison purposes" -- and especially > for development purposes, in my opinion: if you develop CUDA API-level > changes in the libgomp nvptx plugin, it's likely to be easier to just use > the full CUDA toolkit 'cuda.h' and directly link against libcuda (so that > you've got all symbols etc. available), and only once you know what > exactly you need, update GCC's 'include/cuda/cuda.h' and > 'libgomp/plugin/cuda-lib.def'. > > With that hopefully clarified, OK to push the re-attached > "libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into > 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA'"? > Ack, understood, thanks for the detailed explanation. LGTM. Thanks, - Tom >> Is >> there a problem with using gcc's cuda.h? > > No, all good. > > > Grüße > Thomas > > > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955