[Openmp-dev] offloading to Nvidia GPUs

Georgios Rokos via Openmp-dev openmp-dev at lists.llvm.org
Wed Dec 13 10:26:27 PST 2017


Hi Jan,

Can you try compiling with:

-fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda
--cuda-path=/usr/local/cuda/ -Xopenmp-target -march=sm_35

and see if it works?

George



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



Hello,

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.

Cheers,
Jan

_______________________________________________
Openmp-dev mailing list
Openmp-dev at lists.llvm.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_openmp-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=vUzu_jPe12M6_8ewEkPhMQEAXBAOQHu8IN-_tSnF_Vs&s=LtMWpij0-tQi1INxgWhLXGMEgqeWC7FwoPemRWaDtfw&e=



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20171213/e427c177/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20171213/e427c177/attachment.gif>


More information about the Openmp-dev mailing list