Compiling for a GTX 950M

Hi,

I’m really new at PGI compilers and OpenACC, I’m following the tutorials and guides.

I wanted to know how to compile my accelerated code for a NVIDIA GTX 950M. I know that for a tesla i just need to do:

make jsolvec.exe OPT="-ta:tesla:cc60-Minfo=accel"

How should i do it for my gtx gpu? when i try to change tesla to gtx i get errors saying that gts is not a keyword.

thanks

Hi Caap,

GTX950 is a Maxwell based card so has a compute capability of 5.0 (-ta=tesla:cc50). “-ta=tesla:cc60” will target a Pascal based card.

FYI, you can run the PGI utility “pgaccelinfo” to get more information about your card, including the “-ta” option to use.

Hope this helps,
Mat

Hi mkcolg,

thanks for your reply. So, if i understood, running with “make jsolvec.exe OPT=”-ta:tesla:cc50 -Minfo=accel" it will run on my gtx?

I already tried that command before, but the result is a segmentation fault error, i dont know why…

I have some problems installing pgi, i followed this guide: https://www.pgroup.com/resources/docs/17.10/x86/pgi-install-guide/index.htm#install-linux-pgi, and i can compile simple programs, although i experience some problems, for example:

everytime i run with -Minfo:accel option to get the messages, but only the first time i run the problem i get the messages, after that i just receive the result of the program;
Another problem is that when my pc starts, pgi is not recognized, i need to do this steps every time:

$ export PGI=/opt/pgi;
$ export PATH=/opt/pgi/linux86-64/17.10/bin:$PATH;
$ export MANPATH=$MANPATH:/opt/pgi/linux86-64/17.10/man;
$ export LM_LICENSE_FILE=$LM_LICENSE_FILE:/opt/pgi/license.dat;

Also, if i run pgaccelinfo with sudo, i get “command not found”

Hi Caap,

So, if i understood, running with “make jsolvec.exe OPT=”-ta:tesla:cc50 -Minfo=accel" it will run on my gtx?

The cc50 option will tell the compiler to target a Maxwell based device, including a GTX950.

I already tried that command before, but the result is a segmentation fault error, i dont know why…

Can you post more details such as the source you’re using, the output from the compilation, and the output from the run? That might help determining the problem.

everytime i run with -Minfo:accel option to get the messages, but only the first time i run the problem i get the messages, after that i just receive the result of the program;

The compiler feedback messages are only emitted during compilation. Hence, my guess is that you’re makefile isn’t rebuilding the binary and you’re just rerunning it.

Another problem is that when my pc starts, pgi is not recognized, i need to do this steps every time:

You need to include these commands in your shell start-up configuration file. The specifics depend upon what shell you’re using.

From section 4.2 Step 3 of the PGI Installation Guide:

Tip: You should add these commands to your shell startup files to ensure that you have access to the PGI products in future login sessions.



Also, if i run pgaccelinfo with sudo, i get “command not found”

sudo runs the command as root and uses roots environment. So this is not unexpected since the PGI install directory is probably not in root’s PATH.

-Mat

Thanks for the help Mat, i managed to solve all this problems.

Just to future reference, if anyone comes up with the same problems:

To run on my GTX 950M is indeed using the option “-ta:tesla:cc50”, because as you said this gtx 950m is a Maxwell based card so having a compute capability 5.0.

I don’t know why pgaccelinfo was giving segmentation fault, although after i update my CUDA drivers i can perform that command with no problems.