[Openmp-dev] when is offloading to NVIDIA targets available?

Georgios Rokos via Openmp-dev openmp-dev at lists.llvm.org
Wed Nov 1 11:09:06 PDT 2017


Hi Siegmar,

The trunk is currently missing the nvptx runtime, so even if you enable
OPENMP_ENABLE_LIBOMPTARGET you only build the base library, the CUDA plugin
and the generic-elf-64 plugin. The nvptx runtime contains CUDA versions of
runtime functions and is necessary for proper execution on the device.

We are currently working on upstreaming the nvptx runtime, I expect to have
something ready by the end of next week.


George



From:	Siegmar Gross via Openmp-dev <openmp-dev at lists.llvm.org>
To:	llvm-openmp-dev <openmp-dev at lists.llvm.org>
Date:	01/11/2017 13:21
Subject:	[Openmp-dev] when is offloading to NVIDIA targets available?
Sent by:	"Openmp-dev" <openmp-dev-bounces at lists.llvm.org>



Hi,

today I've built the latest version of llvm-trunk. I used the following
commands.

svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_llvm_trunk&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=710WXoxgahW8AI9Az1d2vRcMDGktkM77IWUciRGHl6s&e=
 llvm
cd llvm/tools
svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_cfe_trunk&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=d5o7htFtbu9MK03JZjWZD16cliXPqxSygC-Q2RmJi_8&e=
 clang
svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_polly_trunk&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=TKMjDZ_c_JiIZ8qMYzICPjvbPt5Vcm90ASgary0tyiY&e=
 polly
svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_lldb_trunk&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=6u_hAn46jfS5xqOjdvX56EptE_37rhkTmavqdklyXlI&e=
 lldb
svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_lld_trunk&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=6MysombLEXNufPayLWiaVWAVRsZD80tVm4kgO4_7CsY&e=
 lld
cd clang/tools
svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_clang-2Dtools-2Dextra_trunk_&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=67igpu2UpnxvDsfB0sATacqK1J2M6lMbam-QfIrjVEk&e=
 extra
cd ../../../projects
svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_compiler-2Drt_trunk&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=MGi9gqeKa-M_r8iyc-tH978WlFVxvPzGJ8rSNXUD10c&e=
 compiler-rt
svn co
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_svn_llvm-2Dproject_openmp_trunk&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=vvbeBRrp5QeTLVCVmBGKHqtmVLTbNjivt9dwSlHrX9I&e=
 openmp
svn co
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_clang-2Dykt_openmp&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=BgWtMM1dTJtjFHbXIgA8ui3mdHPkVLn8wCnjuXjhRZM&e=
 libomptarget
cd ../..

set LLVM_VERSION=llvm-trunk
rm -r build
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/${LLVM_VERSION} \
   -GNinja \
   -DLLVM_TARGETS_TO_BUILD:STRING="NVPTX;X86" \
   -DCMAKE_BUILD_TYPE:STRING="Release" \
   -DLLVM_PARALLEL_COMPILE_JOBS:STRING="4" \
   -DLLVM_PARALLEL_LINK_JOBS:STRING="4" \
   -DCMAKE_C_COMPILER:STRING="/usr/local/gcc-6.4.0/bin/gcc" \
   -DCMAKE_C_FLAGS:STRING="-m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses" \
   -DCMAKE_C_STANDARD_LIBRARIES="-lpthread" \
   -DCMAKE_CXX_COMPILER:STRING="/usr/local/gcc-6.4.0/bin/g++" \
   -DCMAKE_CXX_FLAGS:STRING="-m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses" \
   -DCMAKE_CXX_STANDARD_LIBRARIES="-lpthread" \
   -DCMAKE_EXE_LINKER_FLAGS:STRING="-m64" \
   -DLLVM_LIBDIR_SUFFIX:STRING="64" \
   -DLLVM_POLLY_LINK_INTO_TOOLS:BOOL=ON \

-DLIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR:STRING="/usr/local/elfutils-0.169/include"
 \

-DLIBOMPTARGET_DEP_LIBELF_LIBRARIES:STRING="/usr/local/elfutils-0.169/lib64/libelf.so"

\
   -DLIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIR:STRING="/usr/include" \
   -DLIBOMPTARGET_DEP_LIBFFI_LIBRARIES:STRING="/usr/lib64/libffi.so" \
   -DCUDA_INCLUDE_DIRS:STRING="/usr/local/cuda/include" \
   -DCUDA_LIBRARIES:STRING="/usr/local/cuda/lib64/libcudart.so" \
   -DBUILD_SHARED_LIBS:BOOL=ON \
   -DOPENMP_ENABLE_LIBOMPTARGET:BOOL=On \
   ../llvm \
   |& tee log.cmake


Unfortunately I still have the same problems which I reported in Bug 34104
nearly two months ago, if I try to offload to a NVIDIA target. I know that
OPENMP_ENABLE_LIBOMPTARGET isn't enabled by default at the moment.
Nevertheless, I would be grateful if somebody can tell me when offloading
to NVIDIA targets will be available. Does somebody know, why I get a wrong
value for the number of devices if I use the CPU version?

loki introduction 107 clang -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu
dot_prod_accelerator_OpenMP.c -lomptarget
loki introduction 108 a.out
Number of processors:     24
Number of devices:        4
Default device:           0
sum = 6.000000e+08

The output is wrong, because I have two six-core processors (24 hwthreads)
and
one NVIDIA GPU. gcc-7.1.0 reports correct values.

loki introduction 109 gcc -fopenmp dot_prod_accelerator_OpenMP.c
          loki introduction 110 a.out
Number of processors:     24
Number of devices:        1
Default device:           0
sum = 6.000000e+08
loki introduction 111


Thank you very much for your help in advance.


Kind regards

Siegmar
_______________________________________________
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=GVX2jHNx8YWmYfE6cxWPwtacQu_4RtD8EzqtibA-1Do&s=T4vpYZ9RUOTK4wtWChJSpGc7tBtvOI3SCeZA9Tx4AOA&e=




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20171101/373ac7aa/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/20171101/373ac7aa/attachment.gif>


More information about the Openmp-dev mailing list