From 4e83c67baa9ee50d9f1620186ce71de68c21202f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 12 Nov 2011 03:59:45 +0000 Subject: Hack-fix for crash-by-assertion on mingw builds on startup if the CUDA driver on the computer is too old (and probably can't be upgraded to a version that does) to support the cuDriverGetVersion method. --- intern/cycles/util/util_cuda.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/intern/cycles/util/util_cuda.cpp b/intern/cycles/util/util_cuda.cpp index fdf3d664a11..f81a11ba9da 100644 --- a/intern/cycles/util/util_cuda.cpp +++ b/intern/cycles/util/util_cuda.cpp @@ -147,6 +147,8 @@ tcuCtxSetCurrent *cuCtxSetCurrent; CCL_NAMESPACE_BEGIN /* utility macros */ +#define CUDA_LIBRARY_FIND_CHECKED(name) \ + name = (t##name*)dynamic_library_find(lib, #name); #define CUDA_LIBRARY_FIND(name) \ name = (t##name*)dynamic_library_find(lib, #name); \ @@ -188,7 +190,7 @@ bool cuLibraryInit() /* detect driver version */ int driver_version = 1000; - CUDA_LIBRARY_FIND(cuDriverGetVersion); + CUDA_LIBRARY_FIND_CHECKED(cuDriverGetVersion); if(cuDriverGetVersion) cuDriverGetVersion(&driver_version); -- cgit v1.2.3