[Openmp-dev] Using OpenMP target offloading in llvm-8.0.0

Alok Mishra via Openmp-dev openmp-dev at lists.llvm.org
Thu Jun 20 11:37:14 PDT 2019


Hi Doru,

I am running it on a linux cluster which has two NVIDIA P100-PCIE-16GB GPUs
on its node. I also tried on an AWS machine with NVIDIA Tesla
V100-SXM2-16GB GPU.

I tried setting OMP_DEFAULT_DEVICE=1 and  CUDA_VISIBLE_DEVICES=0,1,2,3, but
I'm getting the same error.

I'm using the same OpenMP runtime which I built.

My LD_LIBRARY_PATH is set to $LLVM_PATH/lib and $LLVM_PATH/lib64  (where
both llvm-8 and openmp-8 are installed)
My C_INCLUDE_PATH and CXX_INCLUDE_PATH are set to $LLVM_PATH/include

--
Thank You.
Regards,
Alok
*'FOR THE GREATER GOOD'*


On Thu, Jun 20, 2019 at 11:12 AM Gheorghe-Teod Bercea <
Gheorghe-Teod.Bercea at ibm.com> wrote:

> Hi Alok,
>
> What type of machine are you running on?
>
> Can you try to see if any of the following env variables help in any way?
>
> export OMP_DEFAULT_DEVICE=1
> export CUDA_VISIBLE_DEVICES=0,1,2,3
>
> Which OpenMP runtime are you using and are you picking up the correct one?
>
> To resolve that use -I -L in the compile line:
>
> Use -I to point to the dir containing omp.h header and -L to point to the
> OpenMP runtime library you're aiming to use. Make sure that you don't pick
> them from different installations.
>
> Make sure that your LD_LIBRARY_PATH also contains the path to the OpenMP
> runtime library directory.
>
> Thanks,
>
> --Doru
>
>
>
>
>
> From:        Alok Mishra via Openmp-dev <openmp-dev at lists.llvm.org>
> To:        openmp-dev at lists.llvm.org
> Date:        06/20/2019 02:01 PM
> Subject:        [EXTERNAL] [Openmp-dev] Using OpenMP target offloading in
> llvm-8.0.0
> Sent by:        "Openmp-dev" <openmp-dev-bounces at lists.llvm.org>
> ------------------------------
>
>
>
> Hi,
>
> When trying to use openmp target offloading with llvm I get the following
> error
>
> *$ cat offload.cpp*
> #include <omp.h>
> int main() {
> #pragma omp target teams distribute parallel for
>     for(int i=0; i<100; i++);
>      return 0;
> }
>
> *$ clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda
> --cuda-path=$CUDA_TOOLKIT_ROOT_DIR offload.cpp -o offload$ ./offload*
> Libomptarget fatal error 1: default offloading policy must switched to
> mandatory or disabled
> *$*
>
> I have llvm-8.0.0 installed in my system at LLVM_PATH.
> I downloaded openmp-8.0.0 source from the llvm download page. To build
> openmp I used the following command:
>
> $ mkdir build && cd build
> $ cmake -DCMAKE_BUILD_TYPE=Debug
> -DCMAKE_INSTALL_PREFIX=$LLVM_PATH -DCMAKE_C_COMPILER=$LLVM_PATH/bin/clang
> -DCMAKE_CXX_COMPILER= $LLVM_PATH/bin/clang++
> -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=35,60,70 ..
> $ make && make install
> $
>
> OpenMP got built without giving any error. But when trying to use target
> offloading with OpenMP I get the above mentioned fatal error. I tried this
> on 3 different machines, with same result.
>
> --
> Thank You.
> Regards,
> Alok
> *'FOR THE GREATER GOOD'*_______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190620/528bfe28/attachment.html>


More information about the Openmp-dev mailing list