[Openmp-dev] clang-7: warning: No library'libomptarget-nvptx-sm_35.bc'

Jonas Hahnfeld via Openmp-dev openmp-dev at lists.llvm.org
Mon Jul 2 09:29:10 PDT 2018


Hi Siegmar,

please note that building the bclib requires Clang trunk itself, so you 
will have to rebuild the openmp repository with the "new" compiler. It 
doesn't work at all if you use GCC to compile the runtime libraries 
(which makes sense because GCC cannot generate LLVM Bitcode).

> Why do I get different numbers of devices, if I compile the program 
> with different options.

I think I already answered this in the past: libomptarget will show you 
the devices you compiled for. It creates 4 "virtual" devices for x86_64 
and you probably have 1 GPU in your system.

Jonas

On 2018-07-02 17:10, Gheorghe-Teod Bercea via Openmp-dev wrote:
> Hi Siegmar,
> 
> It all depends on how you build the compiler.
> 
> If you want to build the .bc library you will need to have the
> following two cmake flags:
> 
>     -DOPENMP_ENABLE_LIBOMPTARGET=ON
>     -DLIBOMPTARGET_NVPTX_ENABLE_BCLIB=true
> 
> This will enable the building of libomptarget library and the
> ...sm_35.bc library. sm_35 is the default compute capability used by
> the compiler if you don't specify anything else.
> 
> You can control this default value when you build your compiler by
> passing the following flag to your cmake command:
> 
>     -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_50
> 
> You can also build the .bc library for more than one compute
> capability using the following cmake flag:
> 
>     -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=50,60,70
> 
> Make sure to also include the default in the list (in this case 50).
> 
> When you compile your application/program you can control which
> compute capability the OpenMP device offloading toolchain uses by
> passing the following flag to clang/clang++:
> 
> -Xopenmp-target -march=sm_70
> 
> This compile line flag is only required if you want a compute
> capability other than the default (in this case sm_50) i.e. the one
> specified using the -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH flag.
> 
> I hope this helps,
> 
> --Doru
> 
> From:        Siegmar Gross via Openmp-dev <openmp-dev at lists.llvm.org>
> To:        llvm-openmp-dev <openmp-dev at lists.llvm.org>
> Date:        07/02/2018 09:27 AM
> Subject:        [Openmp-dev] clang-7: warning: No library
> 'libomptarget-nvptx-sm_35.bc'
> Sent by:        "Openmp-dev" <openmp-dev-bounces at lists.llvm.org>
> 
> -------------------------
> 
> Hi,
> 
> today I've built the latest version of llvm-trunk using Cmake on my
> "SUSE
> Linux Enterprise Server 12.3 (x86_64)". I get the following warnings,
> if I
> compile a small program.
> 
> loki introduction 162 \clang --cuda-gpu-arch=sm_50 -fopenmp
> -fopenmp-targets=nvptx64-nvidia-cuda dot_prod_accelerator_OpenMP.c
> -lomptarget
> clang-7: warning: No library 'libomptarget-nvptx-sm_35.bc' found in
> the default
> clang lib directory or in LIBRARY_PATH. Expect degraded performance
> due to no
> inlining of runtime functions on target devices. [-Wopenmp-target]
> clang-7: warning: argument unused during compilation:
> '--cuda-gpu-arch=sm_50'
> [-Wunused-command-line-argument]
> loki introduction 163
> 
> Why does the compiler ignore "--cuda-gpu-arch=sm_50". How can I create
> "libomptarget-nvptx-sm_35.bc" and probably
> "libomptarget-nvptx-sm_50.bc"?
> 
> Why do I get different numbers of devices, if I compile the program
> with
> different options. I use a machine with two "Intel Xeon E5-2620 v3"
> processors (6 cores and 12 hwthreads each) and one Nvidia Quadro K2200
> device.
> 
> loki introduction 183 clang -fopenmp
> -fopenmp-targets=x86_64-pc-linux-gnu \
> ? dot_prod_accelerator_OpenMP.c -lomptarget
> loki introduction 184 a.out
> Number of processors:     24
> Number of devices:        4
> Default device:           0
> sum = 6.000000e+08
> 
> loki introduction 185 clang -fopenmp
> -fopenmp-targets=nvptx64-nvidia-cuda \
> ? dot_prod_accelerator_OpenMP.c -lomptarget
> clang-7: warning: No library 'libomptarget-nvptx-sm_35.bc' found in
> the default
> clang lib directory or in LIBRARY_PATH. Expect degraded performance
> due to no
> inlining of runtime functions on target devices. [-Wopenmp-target]
> loki introduction 186 a.out
> Number of processors:     24
> Number of devices:        1
> Default device:           0
> sum = 6.000000e+08
> loki introduction 187
> 
> Thank you very much for any answers 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 [1]
> 
> 
> 
> Links:
> ------
> [1] http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
> _______________________________________________
> 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