diff --git a/paddle/phi/backends/gpu/gpu_resources.cc b/paddle/phi/backends/gpu/gpu_resources.cc index 02571399143845e1e0e662a2c2b65b94182bc9a6..4d2621cb6a049436d2650e22e5cf7bb902aab2fd 100644 --- a/paddle/phi/backends/gpu/gpu_resources.cc +++ b/paddle/phi/backends/gpu/gpu_resources.cc @@ -108,6 +108,20 @@ void InitGpuProperties(Place place, << "Please recompile or reinstall Paddle with compatible CUDA " "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 }