From 35ff1568e993d2d4569b94d74820d8717201f903 Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Mon, 30 Dec 2019 22:23:16 +0800 Subject: [PATCH] Add error message for cublas inItizalize failed (#21995) --- paddle/fluid/platform/cuda_helper.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/platform/cuda_helper.h b/paddle/fluid/platform/cuda_helper.h index 74cf554523..54f5e911e3 100644 --- a/paddle/fluid/platform/cuda_helper.h +++ b/paddle/fluid/platform/cuda_helper.h @@ -29,7 +29,14 @@ namespace platform { class CublasHandleHolder { public: CublasHandleHolder(cudaStream_t stream, cublasMath_t math_type) { - PADDLE_ENFORCE_CUDA_SUCCESS(dynload::cublasCreate(&handle_)); + PADDLE_ENFORCE_CUDA_SUCCESS( + dynload::cublasCreate(&handle_), + platform::errors::External( + "The cuBLAS library was not initialized. This is usually caused by " + "an error in the CUDA Runtime API called by the cuBLAS routine, or " + "an error in the hardware setup.\n" + "To correct: check that the hardware, an appropriate version of " + "the driver, and the cuBLAS library are correctly installed.")); PADDLE_ENFORCE_CUDA_SUCCESS(dynload::cublasSetStream(handle_, stream)); #if CUDA_VERSION >= 9000 if (math_type == CUBLAS_TENSOR_OP_MATH) { -- GitLab