From 450e6c00580ec322d8408b081b08f082de73038f Mon Sep 17 00:00:00 2001 From: Arnaud Bergeron Date: Mon, 5 Nov 2018 13:52:08 -0500 Subject: [PATCH 1/2] Support more recent versions and make sure to not always report errors for nvrtc64_70 --- src/gpuarray_buffer_cuda.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gpuarray_buffer_cuda.c b/src/gpuarray_buffer_cuda.c index f518ce901b..bed012d6d5 100644 --- a/src/gpuarray_buffer_cuda.c +++ b/src/gpuarray_buffer_cuda.c @@ -176,7 +176,7 @@ static int setup_lib(void) { res = load_libnvrtc(major, minor, global_err); if (res != GA_NO_ERROR) { /* Else, let's try to find a nvrtc corresponding to supported CUDA versions. */ - int versions[][2] = {{9, 1}, {9, 0}, {8, 0}, {7, 5}, {7, 0}}; + int versions[][2] = {{10, 0}, {9, 2}, {9, 1}, {9, 0}, {8, 0}, {7, 5}, {7, 0}}; int versions_length = sizeof(versions) / sizeof(versions[0]); int i = 0; /* Skip versions that are higher or equal to the driver version */ @@ -190,7 +190,8 @@ static int setup_lib(void) { } while (res != GA_NO_ERROR && i < versions_length); } if (res != GA_NO_ERROR) - return res; + // Return the error from the original attempt + return load_libnvrtc(major, minor, global_err); setup_done = 1; } return GA_NO_ERROR; From c3dae992336deb9ab306fdd35016e145b0945434 Mon Sep 17 00:00:00 2001 From: Arnaud Bergeron Date: Wed, 14 Nov 2018 14:22:22 -0500 Subject: [PATCH 2/2] Actually use the origin versions for the reported error --- src/gpuarray_buffer_cuda.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gpuarray_buffer_cuda.c b/src/gpuarray_buffer_cuda.c index bed012d6d5..772e9757f0 100644 --- a/src/gpuarray_buffer_cuda.c +++ b/src/gpuarray_buffer_cuda.c @@ -159,6 +159,7 @@ static int minor = -1; static int setup_lib(void) { CUresult err; int res, tmp; + int orig_major, orig_minor; if (!setup_done) { res = load_libcuda(global_err); @@ -174,6 +175,8 @@ static int setup_lib(void) { minor = (tmp / 10) % 10; /* Let's try to load a nvrtc corresponding to detected CUDA version. */ res = load_libnvrtc(major, minor, global_err); + orig_major = major; + orig_minor = minor; if (res != GA_NO_ERROR) { /* Else, let's try to find a nvrtc corresponding to supported CUDA versions. */ int versions[][2] = {{10, 0}, {9, 2}, {9, 1}, {9, 0}, {8, 0}, {7, 5}, {7, 0}}; @@ -191,7 +194,7 @@ static int setup_lib(void) { } if (res != GA_NO_ERROR) // Return the error from the original attempt - return load_libnvrtc(major, minor, global_err); + return load_libnvrtc(orig_major, orig_minor, global_err); setup_done = 1; } return GA_NO_ERROR;