如果与大于一起使用,我会遇到一些cudaGetDeviceCount返回零的问题。来自更大程序的代码部分是:mpirun-np2
bool cpuInterfaces::checkGPUCount(int gpusPerMachine){
int GPU_N;
cudaGetDeviceCount(&GPU_N);
//if the gpu count on this node does not equal what was given in fvSolution, return false
return ((gpusPerMachine>GPU_N || gpusPerMachine < 1)? false : true);
}
大部分代码位于cufflink-source 文件中。如果使用执行运行,mpirun -np 2 somethingsomething则一切运行正常并cudaGetDeviceCount返回4,好像mpirun -np 4 somethingsomething将导致cudaGetDeviceCount返回零。是否有cudaGetDeviceCount我不知道的在 MPI 中使用的特殊情况?任何帮助或建议都会有所帮助。