summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslaren <slarengh@gmail.com>2024-03-20 21:03:26 +0100
committerGitHub <noreply@github.com>2024-03-20 21:03:26 +0100
commit1c51f98adcbad40e3c41f0a6ffadeb723190b417 (patch)
treec37602fc2d582f42271005bb83dae4a2e9ea4c1d
parentf9c7ba34476ffc4f13ae2cdb1aec493a16eb8d47 (diff)
cuda : print the returned error when CUDA initialization fails (#6185)
-rw-r--r--ggml-cuda.cu5
1 files changed, 3 insertions, 2 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu
index e70b79c3..24af9f67 100644
--- a/ggml-cuda.cu
+++ b/ggml-cuda.cu
@@ -294,8 +294,9 @@ static ggml_cuda_device_info ggml_cuda_init() {
ggml_cuda_device_info info = {};
- if (cudaGetDeviceCount(&info.device_count) != cudaSuccess) {
- fprintf(stderr, "%s: no " GGML_CUDA_NAME " devices found, " GGML_CUDA_NAME " will be disabled\n", __func__);
+ cudaError_t err = cudaGetDeviceCount(&info.device_count);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "%s: failed to initialize " GGML_CUDA_NAME ": %s\n", __func__, cudaGetErrorString(err));
return info;
}