@@ -97,6 +97,22 @@ void InitGpuProperties(Place place,
97
97
(*driver_version / 1000 ) * 10 + (*driver_version % 100 ) / 10 ;
98
98
auto compile_cuda_version =
99
99
(CUDA_VERSION / 1000 ) * 10 + (CUDA_VERSION % 100 ) / 10 ;
100
+ #if defined(__linux__)
101
+ PADDLE_ENFORCE_EQ (
102
+ (local_cuda_version / 10 < compile_cuda_version / 10 ) &&
103
+ (cudnn_dso_ver / 1000 < CUDNN_VERSION / 1000 ),
104
+ false ,
105
+ phi::errors::InvalidArgument (
106
+ " The installed Paddle is compiled with CUDA%d/cuDNN%d,"
107
+ " but CUDA/cuDNN version in your machine is CUDA%d/cuDNN%d. "
108
+ " which will cause serious incompatible bug. "
109
+ " Please recompile or reinstall Paddle with compatible CUDA/cuDNN "
110
+ " version." ,
111
+ compile_cuda_version / 10 ,
112
+ CUDNN_VERSION / 1000 ,
113
+ local_cuda_version / 10 ,
114
+ cudnn_dso_ver / 1000 ));
115
+ #endif
100
116
if (local_cuda_version < compile_cuda_version) {
101
117
LOG_FIRST_N (WARNING, 1 )
102
118
<< " WARNING: device: " << static_cast <int >(place.device )
@@ -108,20 +124,6 @@ void InitGpuProperties(Place place,
108
124
<< " Please recompile or reinstall Paddle with compatible CUDA "
109
125
" version." ;
110
126
}
111
-
112
- auto local_cudnn_version = cudnn_dso_ver / 1000 ;
113
- auto compile_cudnn_version = CUDNN_VERSION / 1000 ;
114
- PADDLE_ENFORCE_EQ (
115
- compile_cudnn_version,
116
- local_cudnn_version,
117
- phi::errors::InvalidArgument (
118
- " The installed Paddle is compiled with CUDNN "
119
- " %d, but CUDNN version in your machine is %d. "
120
- " which will cause serious incompatible bug. "
121
- " Please recompile or reinstall Paddle with compatible CUDNN "
122
- " version." ,
123
- compile_cudnn_version,
124
- local_cudnn_version));
125
127
#endif
126
128
}
127
129
0 commit comments