no cuda capable device when starting with mpiexec


when I start a parallel program with mpiexec on windows, I don’t have a cuda capable device. If I start the program (running 1 process) itself, I have cuda devices.
I have mpich2 on windows server 2008 r2.


I had a similar issue last xeek (On linux and with OpenMPI …)
I solved it by calling “cudaFree(NULL)” just after cudaSetDevice(MPI_rank) to force the context creation at this point.


I have tried what you said, but it still not works.

After I got the exe file,I copy it to two different computers. One is a GPU server with Tesla 1060 in it,and it works fine, the other is a nomal computer with a GTX470 in it,and it did not work. This puzzled me a lot~

Still thanks for your reply.