未验证 提交 b96a21df 编写于 作者: P pangyoki 提交者: GitHub

change cudnn error to cuda error if compiled cuda version is incompatible with...

change cudnn error to cuda error if compiled cuda version is incompatible with installed cuda version (#47743)

* fix cudnn error

* fix

* fix

* fix
上级 3b91f8f3
...@@ -97,6 +97,22 @@ void InitGpuProperties(Place place, ...@@ -97,6 +97,22 @@ void InitGpuProperties(Place place,
(*driver_version / 1000) * 10 + (*driver_version % 100) / 10; (*driver_version / 1000) * 10 + (*driver_version % 100) / 10;
auto compile_cuda_version = auto compile_cuda_version =
(CUDA_VERSION / 1000) * 10 + (CUDA_VERSION % 100) / 10; (CUDA_VERSION / 1000) * 10 + (CUDA_VERSION % 100) / 10;
#if defined(__linux__)
PADDLE_ENFORCE_EQ(
(local_cuda_version / 10 < compile_cuda_version / 10) &&
(cudnn_dso_ver / 1000 < CUDNN_VERSION / 1000),
false,
phi::errors::InvalidArgument(
"The installed Paddle is compiled with CUDA%d/cuDNN%d,"
"but CUDA/cuDNN version in your machine is CUDA%d/cuDNN%d. "
"which will cause serious incompatible bug. "
"Please recompile or reinstall Paddle with compatible CUDA/cuDNN "
"version.",
compile_cuda_version / 10,
CUDNN_VERSION / 1000,
local_cuda_version / 10,
cudnn_dso_ver / 1000));
#endif
if (local_cuda_version < compile_cuda_version) { if (local_cuda_version < compile_cuda_version) {
LOG_FIRST_N(WARNING, 1) LOG_FIRST_N(WARNING, 1)
<< "WARNING: device: " << static_cast<int>(place.device) << "WARNING: device: " << static_cast<int>(place.device)
...@@ -108,20 +124,6 @@ void InitGpuProperties(Place place, ...@@ -108,20 +124,6 @@ void InitGpuProperties(Place place,
<< "Please recompile or reinstall Paddle with compatible CUDA " << "Please recompile or reinstall Paddle with compatible CUDA "
"version."; "version.";
} }
auto local_cudnn_version = cudnn_dso_ver / 1000;
auto compile_cudnn_version = CUDNN_VERSION / 1000;
PADDLE_ENFORCE_EQ(
compile_cudnn_version,
local_cudnn_version,
phi::errors::InvalidArgument(
"The installed Paddle is compiled with CUDNN "
"%d, but CUDNN version in your machine is %d. "
"which will cause serious incompatible bug. "
"Please recompile or reinstall Paddle with compatible CUDNN "
"version.",
compile_cudnn_version,
local_cudnn_version));
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册