diff --git a/paddle/fluid/platform/gpu_info.cc b/paddle/fluid/platform/gpu_info.cc index 4b10efcaf09e7c86a75b1b8ce0b2b10bd6b2589e..1f66c37bac0c8a7527023379349bcd397628835c 100644 --- a/paddle/fluid/platform/gpu_info.cc +++ b/paddle/fluid/platform/gpu_info.cc @@ -109,10 +109,16 @@ int GetCUDAComputeCapability(int id) { PADDLE_ENFORCE_LT(id, GetCUDADeviceCount(), "id must less than GPU count"); cudaDeviceProp device_prop; auto e = cudaGetDeviceProperties(&device_prop, id); - int a = 10; - char c[] = "helloworld"; - string str = "helloworld"; - PADDLE_ENFORCE(cudaGetDeviceProperties(&device_prop, id), a, c, str); + char ErrorLog[50]; + snprintf(ErrorLog, sizeof(ErrorLog), + "cudaGetDeviceProperties failed in" + "paddle::platform::GetCUDAComputeCapability!" + "Error Type ID = %d , Detail:" + "https://docs.nvidia.com/cuda/cuda-runtime-api/" + "group__CUDART__TYPES.html#group__CUDART__TYPES_" + "1g3f51e3575c2178246db0a94a430e0038", + e); + PADDLE_ENFORCE(e, ErrorLog); return device_prop.major * 10 + device_prop.minor; }