Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGon Solo <gonsolo>2022-11-08 21:31:48 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-11-08 21:40:57 +0300
commitc306ccb67fcf44d9bca3c4ed0f20d1af1df29f26 (patch)
tree26f6dbf70e7e919208c75f1a07770b51b5d939d8 /intern/cycles/device/cuda/device_impl.cpp
parent5925b1821a5706d59d1504ab3b426ce5df6aff52 (diff)
Fix Cycles error with runtime compilation when there is no path to OptiX SDK
If no OPTIX_ROOT is set, nvcc fails to compile because there is a stray "-I" in the arguments. Detect if the include path is empty and act accordingly. Differential Revision: https://developer.blender.org/D16308
Diffstat (limited to 'intern/cycles/device/cuda/device_impl.cpp')
-rw-r--r--intern/cycles/device/cuda/device_impl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/device/cuda/device_impl.cpp b/intern/cycles/device/cuda/device_impl.cpp
index 01c021551f3..b56765208ee 100644
--- a/intern/cycles/device/cuda/device_impl.cpp
+++ b/intern/cycles/device/cuda/device_impl.cpp
@@ -232,7 +232,7 @@ string CUDADevice::compile_kernel_get_common_cflags(const uint kernel_features)
return cflags;
}
-string CUDADevice::compile_kernel(const uint kernel_features,
+string CUDADevice::compile_kernel(const string& common_cflags,
const char *name,
const char *base,
bool force_ptx)
@@ -281,7 +281,6 @@ string CUDADevice::compile_kernel(const uint kernel_features,
/* We include cflags into md5 so changing cuda toolkit or changing other
* compiler command line arguments makes sure cubin gets re-built.
*/
- string common_cflags = compile_kernel_get_common_cflags(kernel_features);
const string kernel_md5 = util_md5_string(source_md5 + common_cflags);
const char *const kernel_ext = force_ptx ? "ptx" : "cubin";
@@ -417,7 +416,8 @@ bool CUDADevice::load_kernels(const uint kernel_features)
/* get kernel */
const char *kernel_name = "kernel";
- string cubin = compile_kernel(kernel_features, kernel_name);
+ string cflags = compile_kernel_get_common_cflags(kernel_features);
+ string cubin = compile_kernel(cflags, kernel_name);
if (cubin.empty())
return false;