PGI Compilers and CUDA 5


nVidia TESLA GPU (Photo credit: Philippe Lin)

I’ve been using the PGI Compilers along with CUDA to do GPGPU development for some time. The compilers themselves are fantastic – OpenACC support, OpenMP support and loads of other cool things.

Recently I upgraded to CUDA 5.0 and noticed that a number of programs now failed to compile, as the compiler wasn’t seeing CUDA 5 correctly. After a while searching the docs, searching the errors and doing big dirty greps, I eventually stumbled upon the answer.

To override what the PGI compiler thinks the correct CUDA version is, simple create a file called .mypgirc in your home directory with the line set DEFCUDAVERSION=5.0;

A nice one liner is;

echo "set DEFCUDAVERSION=5.0;" > ~/.mypgirc