Commit: 4ff87446690edd15e49d5f8610db150428690a98
Author: Thomas Dinges
Date:   Thu Oct 30 11:42:59 2014 +0100
Branches: master
https://developer.blender.org/rB4ff87446690edd15e49d5f8610db150428690a98

Cycles / CUDA: Better fix for missing sm_52 kernel, in case user compiles 
himself.

===================================================================

M       intern/cycles/device/device_cuda.cpp

===================================================================

diff --git a/intern/cycles/device/device_cuda.cpp 
b/intern/cycles/device/device_cuda.cpp
index 844fb3b..b3d4215 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -203,12 +203,24 @@ public:
                int major, minor;
                cuDeviceComputeCapability(&major, &minor, cuDevId);
                
-               /* workaround to make sm_52 cards work, until we bundle kernel 
*/
-               if(major == 5 && minor == 2)
-                       minor = 0;
+               string cubin;
+
+               /* ToDo: We don't bundle sm_52 kernel yet */
+               if(major == 5 && minor == 2) {
+                       if(experimental)
+                               cubin = 
path_get(string_printf("lib/kernel_experimental_sm_%d%d.cubin", major, minor));
+                       else
+                               cubin = 
path_get(string_printf("lib/kernel_sm_%d%d.cubin", major, minor));
+
+                       if(path_exists(cubin))
+                               /* self build sm_52 kernel? Use it. */
+                               return cubin;
+                       else
+                               /* use 5.0 kernel as workaround */
+                               minor = 0;
+               }
 
                /* attempt to use kernel provided with blender */
-               string cubin;
                if(experimental)
                        cubin = 
path_get(string_printf("lib/kernel_experimental_sm_%d%d.cubin", major, minor));
                else

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to