2

When I use gcc-10 (and 9, 8, 7) from default repositories on Ubuntu 18.04, omp_get_num_devices() returns 0, even though I have:

paul@desktop:~$ nvidia-smi
...
| NVIDIA-SMI 450.80.02    Driver Version: 450.80.02    CUDA Version: 11.0     |

Do I need a special version of gcc to get target offload capability? A special build process for my project?

Paul Jurczak
  • 7,008
  • 3
  • 47
  • 72

1 Answers1

0

What was missing is nvptx-tools. I installed them with:

sudo apt install nvptx-tools libgomp-plugin-nvptx1 gcc-10-offload-nvptx

and omp_get_num_devices() returns 1 now. Unfortunately, there is still something missing preventing code with offload directives from linking.

Bear in mind that gcc-10 is not officially supported in Ubuntu 18.04, so testing repositories have to be used

Paul Jurczak
  • 7,008
  • 3
  • 47
  • 72
  • Try this, perhaps? https://stackoverflow.com/questions/57206552/openmp-4-5-wont-offload-to-gpu-with-target-directive/57224430#57224430 – Richard Nov 11 '20 at 06:06
  • @Richard I tried everything I could find there. I'm still not sure, if I need a custom gcc build or just different linker options. I posted a more detailed question: https://stackoverflow.com/questions/64781646 – Paul Jurczak Nov 11 '20 at 06:41
  • Hello, did you solve this problem? Actually, I am using WSL Ubuntu and trying to use OpenMP or OpenACC for GPU parallelization but somehow I cannot use it. So I was wondering whether you could use OpenMP or OpenACC. – Changseok Ma Mar 06 '21 at 22:27
  • @ChangseokMa I didn't have time to solve this problem. I will post the solution when I find time to work on this problem. – Paul Jurczak Mar 07 '21 at 21:46