diff --git a/paddle/fluid/platform/gpu_info.cc b/paddle/fluid/platform/gpu_info.cc index a8f3b084b0d8b7f792520d0335cce9580ec12a0c..b12647e0f2669a24150959c999f6411a04aa186b 100644 --- a/paddle/fluid/platform/gpu_info.cc +++ b/paddle/fluid/platform/gpu_info.cc @@ -106,9 +106,11 @@ int GetCUDADeviceCount() { int GetCUDAComputeCapability(int id) { PADDLE_ENFORCE_LT(id, GetCUDADeviceCount(), "id must less than GPU count"); cudaDeviceProp device_prop; - PADDLE_ENFORCE(cudaGetDeviceProperties(&device_prop, id), + auto error_code = cudaGetDeviceProperties(&device_prop, id); + PADDLE_ENFORCE(error_code, "cudaGetDeviceProperties failed in " - "paddle::platform::GetCUDAComputeCapability"); + "paddle::platform::GetCUDAComputeCapability, error code : %d", + error_code); return device_prop.major * 10 + device_prop.minor; }