Cuda-gdb on cuda Fortran

Hi,

While I compile my CUDA Fortran code with the switches -G, -gencode, and --maxrregcount=256; it gives the errors:

nvfortran-Error-Unknown switch: -G
nvfortran-Error-Unknown switch: -gencode
nvfortran-Error-Unknown switch: --maxrregcount=256.

On the system, cuda-gdb is installed and I can use it yet still the compiler cannot capture the switches. Why does it not capture the switches?

Thank you,
Yunus

Yes, you’re using nvcc (CUDA C) flags. You need to use the equivalent nvfortran flags.

“-G”: Device debugging. Nvfortran enables this when “-g” is used. Though can also be enabled via “-gpu=debug”

“-gencode”: Use “-gpu=ccXX” where “XX” is the compute capability of the device you wish to generate code for. Note that this flag is optional if compiling on the same system as you’re targeting as the compiler will auto-detect the device.

“–maxregcount=256”: Use “-gpu=maxregcount:256”. Though “256” is the max limit already so this flag isn’t needed.

Hope this helps,
Mat

1 Like

Thank you Mat, It actually helped. I could not find the documentation for the Fortran on web. Is it available?

Best regards,
Yunus

All NHPC SDK Docs: NVIDIA HPC SDK Version 23.3 Documentation

CUDA Fortran Programming Guide: CUDA Fortran Programming Guide Version 23.3 for ARM, OpenPower, x86

Fortran CUDA Libraries Interface Guide: NVIDIA Fortran CUDA Library Interfaces Version 23.3 for ARM, OpenPower, x86

Details on the “-gpu” flag is found in the Compiler Users Guide: HPC Compilers User's Guide Version 23.3 for ARM, OpenPower, x86

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.