diff options
author | Thomas Dinges <blender@dingto.org> | 2014-10-30 13:42:59 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2014-10-30 13:42:59 +0300 |
commit | 4ff87446690edd15e49d5f8610db150428690a98 (patch) | |
tree | 759c52a6d021f841d7b2717a9c0230c6b2fe21c6 /intern | |
parent | d5ed153760d32ca6c5f6ca5acc5ec6126a7f3eee (diff) |
Cycles / CUDA: Better fix for missing sm_52 kernel, in case user compiles himself.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
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 |