Print statement causes compiling

I’m having a bit of an odd bug. I’m trying to remove some print statements I was using for debugging but now I can’t seem to remove them without causing it to fail to compile. What is doubly strange is that isolating the function and removing the prints causes it to compile just fine. I suspect this points to a more sinister underlying problem, but I’m having some difficulty figuring out what that may be.

When compiling with nvfortran -cuda -v it outputs

_x86_64/21.7/cuda/11.4 -usenvvm -nvvm70 -reloc /home/acattan/pgcudafor5fcyhRlWmYrgH.gpu -computecap 70 -ptx /home/acattan/pgcudaforjfcyhBpIrJCqR.ptx -o /home/acattan/pgcudaforrfcyhZkuMQsQF.bin -cuda11040
nvdd-Fatal-/software/nvhpc-21.7-el8-x86_64/Linux_x86_64/21.7/cuda/11.4/bin/ptxas TERMINATED by signal 11
Arguments to /software/nvhpc-21.7-el8-x86_64/Linux_x86_64/21.7/cuda/11.4/bin/ptxas
/software/nvhpc-21.7-el8-x86_64/Linux_x86_64/21.7/cuda/11.4/bin/ptxas -arch=sm_70 -w -fmad true -m64 -O3 -o /home/acattan/pgcudaforrfcyhZkuMQsQF.bin --compile-only /home/acattan/pgcudaforjfcyhBpIrJCqR.ptx
NVFORTRAN-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (CRAFT_integrate.f90: 1)
NVFORTRAN/x86-64 Linux 21.7-0: compilation aborted
nvfortran-Fatal-f902 completed with exit code 1

but trying -Minfo=all doesn’t seem to give anymore information. I can’t seem to get the problem to occur in anything less than 575 lines, which feels a little long to dump on you guys here. I was wondering what flags I should use to try and get more information since -Minfo isn’t cutting it.

I can upload the code itself if anyone wants to see it. I can point you to exactly where it’s “happening” but it is a bit messy.

Interesting that device code assembler, ptxas, that’s seg faulting. No idea why.

You can try updating the NVHPC SDK to a new version and see if a newer version of CUDA (like 11.7) fixes the issue. Otherwise, we will need a reproducing example so we can investigate. Don’t worry about the size. You can attach the file to a post, or if you don’t want to post it publicly, send me a direct message and we can arrange another method for you send it.

Thanks,
Mat