diff options
author | Ray Molenkamp <github@lazydodo.com> | 2018-02-03 20:59:09 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2018-02-03 20:59:09 +0300 |
commit | a5052770b85fefe00511886429e6fc1f5056e1e8 (patch) | |
tree | 5dbe529f230833e71ee2504657ccec32364f4a01 /intern/cycles/CMakeLists.txt | |
parent | db989e1f118071aae6dcd9f29d10182bd5ebed0b (diff) |
cycles: Add an nvrtc based cubin cli compiler.
nvcc is very picky regarding compiler versions, severely limiting the compiler we can use, this commit adds a nvrtc based compiler that'll allow us to build the cubins even if the host compiler is unsupported. for details see D2913.
Differential Revision: http://developer.blender.org/D2913
Diffstat (limited to 'intern/cycles/CMakeLists.txt')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 543fb5b2cf8..3da1170ec77 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -242,6 +242,24 @@ if(CMAKE_COMPILER_IS_GNUCXX) unset(_has_no_error_unused_macros) endif() +if(WITH_CYCLES_CUDA_BINARIES AND (NOT WITH_CYCLES_CUBIN_COMPILER)) + if(MSVC) + set(MAX_MSVC 1800) + if(${CUDA_VERSION} EQUAL "8.0") + set(MAX_MSVC 1900) + elseif(${CUDA_VERSION} EQUAL "9.0") + set(MAX_MSVC 1910) + elseif(${CUDA_VERSION} EQUAL "9.1") + set(MAX_MSVC 1911) + endif() + if (NOT MSVC_VERSION LESS ${MAX_MSVC}) + message(STATUS "nvcc not supported for this compiler version, using cycles_cubin_cc instead.") + set(WITH_CYCLES_CUBIN_COMPILER ON) + endif() + unset(MAX_MSVC) + endif() +endif() + # Subdirectories @@ -254,7 +272,7 @@ if(WITH_CYCLES_NETWORK) add_definitions(-DWITH_NETWORK) endif() -if(WITH_CYCLES_STANDALONE OR WITH_CYCLES_NETWORK) +if(WITH_CYCLES_STANDALONE OR WITH_CYCLES_NETWORK OR WITH_CYCLES_CUBIN_COMPILER) add_subdirectory(app) endif() |