[Openmp-dev] Libomptarget fatal error 1: failure of target construct while offloading is mandatory

Jonas Hahnfeld via Openmp-dev openmp-dev at lists.llvm.org
Mon Oct 1 04:33:10 PDT 2018


A bit late to the party: You can also run under cuda-gdb. This should 
give you the CUDA error message.

Based on the filename (dot_prod_accelerator_OpenMP.c) I'd guess that you 
are using reduction() on a teams directive. This doesn't work yet, see
http://clang.llvm.org/docs/OpenMPSupport.html#features-not-supported-or-with-limited-support-for-cuda-devices

Jonas

On 2018-10-01 13:19, George Rokos via Openmp-dev wrote:
> Hi Siegmar,
> 
>  Apparently your application fails to offload to the GPU. And because
> offloading is mandatory (that's the default behavior) the library
> terminates the application.

(pedantic on; the default is "default" which is raised to "mandatory" 
iff libomptarget can find devices; pedantic off)

> 
>  Can you compile libomptarget in debug mode and run the app with
> LIBOMPTARGET_DEBUG=1 to see the debug output? That will help us
> identify the problem.
> 
>  George
> 
> -------------------------
> 
> FROM: Openmp-dev <openmp-dev-bounces at lists.llvm.org> on behalf of
> Siegmar Gross via Openmp-dev <openmp-dev at lists.llvm.org>
> SENT: 01 October 2018 13:26
> TO: llvm-openmp-dev
> SUBJECT: [Openmp-dev] Libomptarget fatal error 1: failure of target
> construct while offloading is mandatory
> 
> Hi,
> 
> today I've installed llvm-trunk. Unfortunately, I get an error for one
> of my
> programs.
> 
> loki introduction 110 clang -fopenmp
> -fopenmp-targets=nvptx64-nvidia-cuda
> dot_prod_accelerator_OpenMP.c
> loki introduction 111 a.out
> Number of processors:     24
> Number of devices:        1
> Default device:           0
> Is initial device:        1
> Libomptarget fatal error 1: failure of target construct while
> offloading is
> mandatory
> 
> loki introduction 112 setenv OMP_DEFAULT_DEVICE 1
> loki introduction 113 a.out
> Libomptarget fatal error 1: failure of target construct while
> offloading is
> mandatory
> 
> loki introduction 114 clang -v
> clang version 8.0.0 (trunk 343447)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> InstalledDir: /usr/local/llvm-trunk/bin
> Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
> Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
> Candidate multilib: .;@m64
> Candidate multilib: 32;@m32
> Selected multilib: .;@m64
> Found CUDA installation: /usr/local/cuda-9.0, version 9.0
> loki introduction 115
> 
> The program works fine with llvm-7.0.0.
> 
> loki introduction 125 clang -fopenmp
> -fopenmp-targets=nvptx64-nvidia-cuda
> dot_prod_accelerator_OpenMP.c
> loki introduction 126 a.out
> Number of processors:     24
> Number of devices:        1
> Default device:           0
> Is initial device:        1
> sum = 6.000000e+08
> 
> loki introduction 127 setenv OMP_DEFAULT_DEVICE 1
> loki introduction 128 a.out
> Number of processors:     24
> Number of devices:        1
> Default device:           1
> Is initial device:        1
> sum = 6.000000e+08
> 
> loki introduction 129 clang -v
> clang version 7.0.0 (tags/RELEASE_700/final)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> InstalledDir: /usr/local/llvm-7.0.0/bin
> Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
> Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
> Candidate multilib: .;@m64
> Candidate multilib: 32;@m32
> Selected multilib: .;@m64
> Found CUDA installation: /usr/local/cuda-9.0, version 9.0
> loki introduction 130
> 
> Hopefully somebody can fix the problem. Do you need anything else to
> locate the
> error? Thank you very much for any help in advance.
> 
> Kind regards
> 
> Siegmar
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list