より大きい値で使用すると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が返されるかのようになります。私が知らないMPIcudaGetDeviceCountでの使用の特別なケースはありますか?cudaGetDeviceCountヘルプや提案があれば役に立ちます。