-Mcuda=nollvm for CURAND device api fails on ubuntu 18.10

I want to use CURAND device api, which requires -Mcuda=nollvm.

My code works on CentOS with CUDA-10.0 and PGI 18.10.
It does not work under Ubuntu 18.10 with CUDA-10.1 and PGI 18.10.
The error message is :

In file included from /opt/pgi/linux86-64/2018/cuda/10.0/include/cuda_runtime.h:83,
from /tmp/pgcudaforJgJfPIzD7NCc.gpu:1:
/opt/pgi/linux86-64/2018/cuda/10.0/include/crt/host_config.h:127:2: error: #error – unsupported GNU version! gcc versions later than 7 are not supported!
#error – unsupported GNU version! gcc versions later than 7 are not supported!
^~~~~
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (a.cuf: 1)
PGF90/x86-64 Linux 18.10-1: compilation aborted

But CUDA 10.1 is supposed to support gcc 8, which I have.
I now realize that PGI 18.10 officially does not support Ubuntu 18.10. Is this the problem? Code not requiring -Mcuda=nollvm seem to work without any problem.

Hi abalogh,

How are you setting PGI 18.10 to use CUDA 10.1? Via setting “CUDA_HOME” in your environment?

I ask because it looks like you’re still using CUDA 10.0 to compile:

/opt/pgi/linux86-64/2018/cuda/> 10.0> /include/crt/host_config.h:127:2: error: #error – unsupported GNU version! gcc versions later than 7 are not supported!



I now realize that PGI 18.10 officially does not support Ubuntu 18.10. Is this the problem?

Possible, but typically not. By not supported it simply means that we were unable to test 18.10 on Ubuntu 18.10. While it has happened, Linux releases haven’t had backwards compatibility issues for many year, so should be fine.

Code not requiring -Mcuda=nollvm seem to work without any problem.

Correct since our LLVM back-end doesn’t include the CUDA header files, which is the problem.

-Mat

You are right, I missed the fact that PGI comes with its own CUDA.
Now if I set it to use the separately installed CUDA 10.1, even with llvm

export CUDA_HOME=/usr/local/cuda-10.1
pgfortran a.cuf
fails to compile with messages:


fatbinary warning : option ‘cuda’ has been deprecated
/usr/bin/ld: /opt/pgi/linux86-64/18.10/lib/libcudafor.so: undefined reference to cudaSetupArgument' /usr/bin/ld: /opt/pgi/linux86-64/18.10/lib/libcudafor.so: undefined reference to cudaConfigureCall’
/usr/bin/ld: /opt/pgi/linux86-64/18.10/lib/libcudafor.so: undefined reference to `cudaLaunch’
pgacclnk: child process exit status 1: /usr/bin/ld

Hi abalogh,

My apologies, I forgot that CUDA 10.1 removed these symbols which our 18.10 runtime used so you wont be able to use CUDA 10.1 until PGI 19.3 or PGI 19.4 if you’re using the Community Edition.

-Mat

Thanks for letting me know!
I will downgrade CUDA.