简体   繁体   中英

Do I have to build gcc-10 from source on Ubuntu 18.04 to have OpenMP GPU target offload?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM