[cfe-users] omp_get_num_devices() returns 0 even though I have GPUs

mashilamani sambasivam via cfe-users cfe-users at lists.llvm.org
Thu Jul 2 22:26:10 PDT 2020


Hi,
I am trying to offload to my GPUs. I have GTX1060 6GB with compute
capability of 6.1.

I followed the instructions given in
https://hpc-wiki.info/hpc/Building_LLVM/Clang_with_OpenMP_Offloading_to_NVIDIA_GPUs

Then I compiled my helloworld program using the following environment
variables:
CFLAGS="-fopenmp -fopenmp-targets=nvptx64-sm_61 -pthread -I
/usr/lib/gcc/x86_64-linux-gnu/9/include -O2
--libomptarget-nvptx-path=$CLANG_HOME/lib --cuda-gpu-arch=sm_61"

LD_LIBRARY_PATH=$CLANG_HOME/lib:$LD_LIBRARY_PATH

CC=clang

my helloworld program simply printfs omp_get_num_devices() after #including
<omp.h>

it compiles fine; but when i run it i get the number of devices as 0.

Does someone have any idea?
Thanks much,
Mani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20200703/0af9c203/attachment.html>


More information about the cfe-users mailing list