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

This commit is contained in:
Thomas Dinges 2014-10-30 11:42:59 +01:00
parent d5ed153760
commit 4ff8744669

@ -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