<div dir="ltr"><div>Hi,</div><div> I figured it out. I hadnt downloaded the proper NVIDIA drivers.</div><div><a href="https://linuxhint.com/ubuntu_nvidia_ppa/">https://linuxhint.com/ubuntu_nvidia_ppa/</a></div><div>proved useful to me.</div><div>Now I am able to detect my GPU.</div><div><br></div><div>Thanks much,</div><div>mashilamani<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 3, 2020 at 11:11 AM mashilamani sambasivam <<a href="mailto:kandanarul1976@gmail.com">kandanarul1976@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div>I forgot to mention that I am using the latest clang-llvm-openmp versions of source code (10.0.0).<br><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <b class="gmail_sendername" dir="auto">mashilamani sambasivam</b> <span dir="auto"><<a href="mailto:kandanarul1976@gmail.com" target="_blank">kandanarul1976@gmail.com</a>></span><br>Date: Fri, Jul 3, 2020 at 10:56 AM<br>Subject: omp_get_num_devices() returns 0 even though I have GPUs<br>To: <<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a>><br></div><br><br><div dir="ltr"><div>Hi,</div><div>I am trying to offload to my GPUs. I have GTX1060 6GB with compute capability of 6.1.</div><div><br></div><div>I followed the instructions given in <br></div><div><a href="https://hpc-wiki.info/hpc/Building_LLVM/Clang_with_OpenMP_Offloading_to_NVIDIA_GPUs" target="_blank">https://hpc-wiki.info/hpc/Building_LLVM/Clang_with_OpenMP_Offloading_to_NVIDIA_GPUs</a></div><div><br></div><div>Then I compiled my helloworld program using the following environment variables:</div><div>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"</div><div><br></div><div>LD_LIBRARY_PATH=$CLANG_HOME/lib:$LD_LIBRARY_PATH</div><div><br></div><div>CC=clang</div><div><br></div><div>my helloworld program simply printfs omp_get_num_devices() after #including <omp.h><br></div><div><br></div><div>it compiles fine; but when i run it i get the number of devices as 0.</div><div><br></div><div>Does someone have any idea?</div><div>Thanks much,</div><div>Mani<br></div></div>
</div></div></div>
</blockquote></div>