diff --git a/gpu/gpu_info_cudart.c b/gpu/gpu_info_cudart.c index 9f69f845..ef13f5c0 100644 --- a/gpu/gpu_info_cudart.c +++ b/gpu/gpu_info_cudart.c @@ -62,6 +62,10 @@ void cudart_init(char *cudart_lib_path, cudart_init_resp_t *resp) { LOG(resp->ch.verbose, "cudaSetDevice err: %d\n", ret); UNLOAD_LIBRARY(resp->ch.handle); resp->ch.handle = NULL; + if (ret == CUDA_ERROR_INSUFFICIENT_DRIVER) { + resp->err = strdup("your nvidia driver is too old or missing, please upgrade to run ollama"); + return; + } snprintf(buf, buflen, "cudart init failure: %d", ret); resp->err = strdup(buf); return; diff --git a/gpu/gpu_info_cudart.h b/gpu/gpu_info_cudart.h index 476e7555..492704a8 100644 --- a/gpu/gpu_info_cudart.h +++ b/gpu/gpu_info_cudart.h @@ -7,6 +7,7 @@ typedef enum cudartReturn_enum { CUDART_SUCCESS = 0, CUDART_UNSUPPORTED = 1, + CUDA_ERROR_INSUFFICIENT_DRIVER = 35, // Other values omitted for now... } cudartReturn_t;