diff --git a/paddle/fluid/platform/device_context.cc b/paddle/fluid/platform/device_context.cc
index 61386bdf05ab4a5b11d94c942c4476abd8698714..f55c44402507fa30fa0ac554173d9896b703043e 100644
--- a/paddle/fluid/platform/device_context.cc
+++ b/paddle/fluid/platform/device_context.cc
@@ -268,12 +268,14 @@ CUDADeviceContext::CUDADeviceContext(CUDAPlace place)
   size_t cudnn_dso_ver = dynload::cudnnGetVersion();
   LOG_FIRST_N(WARNING, 1) << "device: " << place_.device
                           << ", cuDNN Version: " << cudnn_dso_ver / 1000 << "."
-                          << (cudnn_dso_ver % 100) / 10 << ".";
+                          << (cudnn_dso_ver % 1000) / 100 << ".";
 
   {
     // Check CUDA/CUDNN version compatiblity
-    auto local_cuda_version = runtime_version_ / 100;
-    auto compile_cuda_version = CUDA_VERSION / 100;
+    auto local_cuda_version =
+        (driver_version_ / 1000) * 10 + (driver_version_ % 100) / 10;
+    auto compile_cuda_version =
+        (CUDA_VERSION / 1000) * 10 + (CUDA_VERSION % 100) / 10;
     if (local_cuda_version < compile_cuda_version) {
       LOG_FIRST_N(WARNING, 1)
           << "WARNING: device: " << place_.device