I am compiling a cuda fortran code and getting this error:
nvlink error : Entry function ‘function-name’ uses too much data for compiler-generated constants; please recompile with -Xptxas --disable-optimizer-constants
But the problem is option “-Xptxas --disable-optimizer-constants” does not work with pgfortran compiler:
Is there any way to pass the options through pgfortran?
No, sorry. There isn’t a way to pass options to nvlink.
Though, I doubt it would help here since the problem is that you’re using too much constant memory which will cause your program to silently fail at runtime.
Can you try removing the “constant” attribute from one or more of your variables until it fits?
Do you have several parameter arrays in you modules? One change we made in 18.1 was to store module parameter arrays in constant memory. It’s possible that you’re encountering an issue due to this.
If you can, please post or send a reproducing example to PGI Customer Service (support@pgroup.com) so we can have our compiler engineers take a look at the problem.