I always need to pass the -ta=tesla:nordc option to files which contain OpenACC code? If I remove this option I get linking error at the linking stage.
By default, PGI compiles code with RDC enabled so we can link device code and allow for cross-file device routine calling and used of global device data. However, nvcc does not set RDC by default and why you’re needing to disable it with PGI. To work together, you must compile both with or without RDC.
Can you try adding “-rdc=true” to you NVCC compilation flags and remove “-ta=tesla:nordc”?
Invoking the nvcc wrapper compiler at the linking stage is the correct way to link all files together?
You’ll want to use PGI to link. In addition to using RDC (we invoke the device linker, nvlink, when RDC is enabled), the compiler will also implicitly generate the CUDA registration code during the link step for the OpenACC kernels.
Also, we implicitly add the CUDA runtime libraries to the link when using the “-Mcuda” flag so you shouldn’t need to add any additional libraries. When using other CUDA libraries, such as cuBLAS, I’d suggest using the PGI flag “-Mcudalib[=cublas|cufft|curand|cusolver|cusparse]” and the appropriate libraries will be added.
The CUDA toolkit version which will be used by the PGI compiler is 10.0 because the CUDA driver version is 10.0?