diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 844fb3b8d50..b3d4215e51b 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