This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: nvptx offloading patches [3/n], RFD
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: Ilya Verbin <iverbin at gmail dot com>, Bernd Schmidt <bernds at codesourcery dot com>, Richard Biener <richard dot guenther at gmail dot com>, Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, Joseph Myers <joseph at codesourcery dot com>
- Date: Wed, 18 Feb 2015 13:35:18 +0100
- Subject: Re: nvptx offloading patches [3/n], RFD
- Authentication-results: sourceware.org; auth=none
- References: <20150204113817 dot GO1746 at tucnak dot redhat dot com> <CAFiYyc11FF2EeOQzqVmQu=q9-Uh-YCN0e38jUn-jmhD9gUrWsw at mail dot gmail dot com> <20150216210812 dot GO1746 at tucnak dot redhat dot com> <20150217133206 dot GA62715 at msticlxl57 dot ims dot intel dot com> <20150217153918 dot GX1746 at tucnak dot redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1502171619550 dot 19294 at digraph dot polyomino dot org dot uk> <20150217164033 dot GY1746 at tucnak dot redhat dot com> <87oaoreg7g dot fsf at kepler dot schwinge dot homeip dot net> <20150218113438 dot GI1746 at tucnak dot redhat dot com> <87vbize7zi dot fsf at schwinge dot name>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 18, 2015 at 01:09:53PM +0100, Thomas Schwinge wrote:
> On Wed, 18 Feb 2015 12:34:38 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Wed, Feb 18, 2015 at 10:12:19AM +0100, Thomas Schwinge wrote:
> > > Do you literally have »nvptx-newlib symlinked into the gcc tree as
> > > newlib«? If yes, then that should explain the problem: as I wrote in
> > > <http://news.gmane.org/find-root.php?message_id=%3C87egq8mir1.fsf%40schwinge.name%3E>,
> > > you need to »add a symbolic link to nvptx-newlib's newlib directory to
> > > the directory containing the GCC sources«, so not link [GCC]/newlib ->
> > > [newlib-nvptx], but [GCC]/newlib -> [newlib-nvptx]/newlib. Does that
> > > resolve the issue?
>
> (It did.) Can you suggest a better wording, to make this more clear in
> the documentation?
Your wording is fine, but should be listed on wiki/Offloading and
doc/install.texi perhaps too?
> > offloading fails:
> >
> > /usr/src/gcc/objnvptxinst/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/5.0.0//accel/nvptx-none/mkoffload @/tmp/cce9PdmR
> > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not recognized
> > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not recognized
> > mkoffload: fatal error: /usr/src/gcc/objnvptxinst/usr/local/bin/x86_64-pc-linux-gnu-accel-nvptx-none-gcc returned 1 exit status
> > compilation terminated.
> > lto-wrapper: fatal error: /usr/src/gcc/objnvptxinst/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/5.0.0//accel/nvptx-none/mkoffload returned 1 exit status
> > compilation terminated.
> > /usr/bin/ld: lto-wrapper failed
> > collect2: error: ld returned 1 exit status
> >
> > Is --enable-languages=c,c++,fortran,lto required when configuring the
> > offload compiler? It isn't required for intelmic.
>
> Yes, exactly. I assume the reason is that x86_64-intelmicemul-linux-gnu
> defaults to supporting LTO, and due to this also defaults to building the
> LTO front end. I'll enhance the nvptx offloading documentation
> accordingly. Maybe we should add some "magic" to build the LTO front end
> if --enable-as-accelerator-for=[...] has been specified?
Toplevel configure.ac has:
# If LTO is enabled, add the LTO front end.
if test "$enable_lto" = "yes" ; then
case ,${enable_languages}, in
*,lto,*) ;;
*) enable_languages="${enable_languages},lto" ;;
esac
if test "${build_lto_plugin}" = "yes" ; then
configdirs="$configdirs lto-plugin"
fi
fi
so IMHO we want similar snippet for the --enable-as-accelerator-for= case,
perhaps right below this one. Not building lto FE for the accelerator
compilers make them completely useless, thus I think we really want to do
that automatically.
> Note that I recently added another prerequisite patch for nvptx
> offloading to <https://gcc.gnu.org/wiki/Offloading#nvptx_Offloading>:
> <http://news.gmane.org/find-root.php?message_id=%3C546CF508.9010807%40codesourcery.com%3E>.
> If that is not applied, you'll get run-time errors because in
> libgomp/plugin/plugin-nvptx.c:GOMP_OFFLOAD_get_table, cuModuleGetFunction
> can't find main$_omp_fn$0 and similar symbols.
Can you adjust that to add a cgraph flag alongside of the offloadable
instead and use that instead of the attribute?
Jakub
- References:
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD
- Re: nvptx offloading patches [3/n], RFD