Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
cudaGetDeviceCount在>;上并行执行时返回0;2个CPU_Cuda_Openmpi - Fatal编程技术网

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()
返回一个错误代码,应该首先检查该错误代码。此外,它在所有列组中返回零,或者仅在其中一些列组中返回零?在所有列组中返回零。我将查看错误代码。哪个驱动程序更新?你用的是什么硬件?