cudaGetDeviceCount在>;上并行执行时返回0;2个CPU
如果在cudaGetDeviceCount在>;上并行执行时返回0;2个CPU,cuda,openmpi,Cuda,Openmpi,如果在mpirun中使用-np大于2的cudaGetDeviceCount返回零,我遇到一些问题。来自更大程序的代码部分是: 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
mpirun
中使用-np
大于2
的cudaGetDeviceCount
返回零,我遇到一些问题。来自更大程序的代码部分是:
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);
}
boolcpuinterfaces::checkGPUCount(int-gpusPerMachine){
int GPU\N;
cudaGetDeviceCount(&GPU\N);
//如果此节点上的gpu计数不等于fvSolution中给出的值,则返回false
返回((gpusPerMachine>GPU|N|gpusPerMachine<1)?false:true);
}
代码的较大部分位于。如果使用
mpirun-np 2 somethingsomething
执行运行,则一切正常运行,并且cudaGetDeviceCount
返回4
,其中好像mpirun-np 4 somethingsomething
将导致cudaGetDeviceCount
返回零。在MPI中使用cudaGetDeviceCount
是否有我不知道的特殊情况?任何帮助或建议都会很有帮助。感谢那些提供了一些答案的人。这原来是一个司机的问题。等待一段时间后,驱动程序更新解决了这个问题。cudaGetDeviceCount()
返回一个错误代码,应该首先检查该错误代码。此外,它在所有列组中返回零,或者仅在其中一些列组中返回零?在所有列组中返回零。我将查看错误代码。哪个驱动程序更新?你用的是什么硬件?