Re: OpenACC offload to nvptx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

On Tue, 26 Apr 2016 09:30:04 +0100, Salvatore Filippone <filippone.salvatore@xxxxxxxxx> wrote:
> I seem unable to get this to work: I managed to build and install
> trunk using the trunk-offload-big scripts by Thomas Schwinge

(As published on
<https://gcc.gnu.org/wiki/Offloading#How_to_try_offloading_enabled_GCC>,
I suppose.)  Do your libgomp test results
(build-gcc/x86_64-pc-linux-gnu/libgomp/testsuite/libgomp.sum) look
reasonable?  That is, are you seeing in there about 2800 lines that match
the "^PASS: libgomp\.oacc-.* -DACC_DEVICE_TYPE_nvidia=1" regular
expression?

> and have
> been trying the test program at
> http://scelementary.com/2015/04/25/openacc-in-gcc.html, with the
> following result:
> e802756@sow768056c-li [128] 09:21 AM [OPENACC] gcc pi.c -fopenacc
> -foffload=nvptx-none -foffload="-O3" -O3 -o gpu.x
> gcc: warning: '-x lto' after last input file has no effect
> gcc: fatal error: no input files
> compilation terminated.
> lto-wrapper: fatal error: gcc returned 1 exit status
> compilation terminated.
> collect2: fatal error: lto-wrapper returned 1 exit status
> compilation terminated.

Certainly not a very helpful error message...  :-)

> e802756@sow768056c-li [129] 09:21 AM [OPENACC] module li
> Currently Loaded Modulefiles:
>   1) gnu/7.0.0-acc

I don't know what that "module" stuff is, but I think I have an idea what
the problem might be: if you want to use the plain "gcc" command with
offloading (without setting up a lot of "-B" paths), you'll have to
configure the target and all offloading compilers to install into the
same prefix -- which my scripts (intentionally) are not doing.  (The
reason is that the installation of several toolchains into the same
prefix will trample upon some of each other's files, which we have not
yet sorted out properly.  It probably won't do any actual harm, but I
wanted to avoid that anyway.  I have some ideas about how to
improve/resolve that.)

If you modify the BUILD-nvptx-tools, BUILD-gcc-offload-nvptx-none,
INSTALL-gcc-offload-nvptx-none,
INSTALL-gcc-offload-x86_64-intelmicemul-linux-gnu, and BUILD-gcc scripts
to refer to "$T"/install instead of "$T"/install/offload-nvptx-none, and
also to "$T"/install instead of
"$T"/install/offload-x86_64-intelmicemul-linux-gnu, and rebuild
everything, does it then work?

> e802756@sow768056c-li [130] 09:21 AM [OPENACC] gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/opt/gnu/7.0.0-acc/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
> OFFLOAD_TARGET_NAMES=nvptx-none
> Target: x86_64-pc-linux-gnu
> Configured with:
> /home/travel/GCC/BUILDS/TRY-offload/source/gcc/configure --prefix=
> --disable-bootstrap --enable-languages=c,c++,fortran,lto
> --disable-multilib
> --enable-offload-targets=nvptx-none=/opt/gnu/7.0.0-acc
> --with-cuda-driver-include=/opt/cuda/7.5/include
> --with-cuda-driver-lib=/usr/lib64/nvidia CC='gcc -m64' CXX='g++ -m64'
> --with-sysroot=
> Thread model: posix
> gcc version 7.0.0 20160425 (experimental) (GCC)

Part of the problem is that the path specified with
--enable-offload-targets=nvptx-none=[...] is only used for internal
testing (libgomp testsuite), but is not considered for use for the
installed compiler.  (It's a bit compplicated to do that.)


Grüße
 Thomas

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux