[Openmp-dev] offloading to Nvidia GPUs

Eichstaedt, Jan R via Openmp-dev openmp-dev at lists.llvm.org
Thu Dec 14 03:39:00 PST 2017


both your suggestions of adding the compile flags
    -Xopenmp-target=nvptx64-nvidia-cuda -march=sm_35

    -Xopenmp-target -march=sm_35

still give me exactly the same error message.

Do you have any other suggestions?


From: Gheorghe-Teod Bercea <Gheorghe-Teod.Bercea at ibm.com>
Sent: 13 December 2017 18:30:00
To: Eichstaedt, Jan R
Cc: via Openmp-dev
Subject: Re: [Openmp-dev] offloading to Nvidia GPUs


Yes there is:

-Xopenmp-target=nvptx64-nvidia-cuda -march=sm_35

You may also run into the problem that target offloading is not yet fully supported.

Hope this helps!



From:        "Eichstaedt, Jan R via Openmp-dev" <openmp-dev at lists.llvm.org>
To:        via Openmp-dev <openmp-dev at lists.llvm.org>
Date:        12/13/2017 01:11 PM
Subject:        [Openmp-dev] offloading to Nvidia GPUs
Sent by:        "Openmp-dev" <openmp-dev-bounces at lists.llvm.org>


I am using llvm and clang version 5.0.0 together with the openmp project of that version on Ubuntu 16.04.
I try to compile a simple program involving a #pragma omp target teams distribute parallel for statement to offload to a Nvidia-GPU using the following flags:
-fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --cuda-path=/usr/local/cuda/ --cuda-gpu-arch=sm_35

However, the compilation fails, with the following being the first assertion that is triggered:
clang++: [...]/llvm-5.0.0.src/tools/clang/lib/Driver/ToolChains/Cuda.cpp:346: virtual void clang::driver::toolchains::CudaToolChain::addClangTargetOptions(const llvm::opt::ArgList&, llvm::opt::ArgStringList&, clang::driver::Action::OffloadKind) const: Assertion `!GpuArch.empty() && "Must have an explicit GPU arch."' failed.

Is there a way to pass the GPU architecture differently? Or is target offloading not fully supported in v5.0.0 yet and I might better use the clang-ykt project? Or have I overlooked something else completely?

Thanks for any help you can offer.


Openmp-dev mailing list
Openmp-dev at lists.llvm.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20171214/b87ad962/attachment.html>

More information about the Openmp-dev mailing list