issue compiling for cuda

I’ve never seen this one before:

[leiderml@ebwilson-mpi ~]$ pgfortran -Mcuda=cc20 ibe-i4six-Cuda.f
pgnvd-Fatal-/shared/pgi/linux86-64/2011/cuda/3.1/bin/ptxas TERMINATED by signal 11
Arguments to /shared/pgi/linux86-64/2011/cuda/3.1/bin/ptxas
/shared/pgi/linux86-64/2011/cuda/3.1/bin/ptxas -arch=sm_20 -m64 -o /tmp/pgcudaforqgOeWVzTsHme.bin /tmp/pgcudaforqgOeWHThsljZ.ptx
PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code 0 (ibe-i4six-Cuda.f: 881)
PGF90/x86-64 Linux 11.5-0: compilation aborted

Any ideas? The line number it gives is simply the last line of the last function before the end of module statement. I’m not seeing a segmentation fault so I don’t think I’m accessing any arrays outside of their bounds. Could it simply be taking too long and timing out on compile as this program tends to take a while to compile?


Hi Morgan,

This is a problem with an old NVIDIA device assembler (ptxas) that was fixed in newer CUDA versions, though I’ve forgotten if it was fixed in CUDA 3.2 or CUDA 4.0. Can you try using CUDA 3.2, i.e. “-Mcuda=cc20,3.2”? If that doesn’t work, you’ll need to update you compiler version to at least 11.6, which is when we first shipped CUDA 4.0.

Hope this helps,

Thanks for the help Mat! Once my admin comes back I’ll have them upgrade as we’re still using 11.5.

1 more quick question. I run into this same problem with gfortran and pgfortran but not ifort. Basically, it appears that the compiler builds up a buffer of 50 lines before it will do any writing to file. The problem is my code sometimes takes weeks to evaluate an integral, and with functions that have triple infinite sums that converge particularly slow I might only get 1 intermediate value a day after a certain point. Is there any way to turn off the buffering so that it writes to file right away or am I forced to put flush statements everywhere?


Hi Morgan,

It’s actually the OS that’s buffering the I/O so you need to make a system call, setvbuf3f, to change the behaviour of the buffer. You can find the full details in the PGI Fortran Reference Guide under the lib3f functions (

Note that this not a standardize method hence you may have issue using when compiling with other compilers or on systems that doesn’t support setvbuf. Also, stdio is not guaranteed to honour your request.

  • Mat