より大きい値で使用するとcudaGetDeviceCount
、ゼロを返す際に問題が発生します。はるかに大きなプログラムからのコードの部分は次のとおりです。mpirun
-np
2
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
ヘルプや提案があれば役に立ちます。