未验证 提交 acf4a2ae 编写于 作者: M ming1753 提交者: GitHub

fix bug on case with gpu driver but no gpu (#55335)

上级 0a21836d
......@@ -64,7 +64,12 @@ static int GetGPUDeviceCountImpl() {
}
}
int count;
PADDLE_ENFORCE_GPU_SUCCESS(cudaGetDeviceCount(&count));
status = cudaGetDeviceCount(&count);
if (status != cudaSuccess) {
VLOG(2) << "You have gpu driver and cuda installed, but the machine not "
"has any gpu card.";
count = 0;
}
return count;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册