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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-12-04 13:49:57 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-12-04 18:03:18 +0300
commitf63da3dcf59f87b34aa916b2c65ce5a40a48fd92 (patch)
treeee6a479c01fb80c8193c6eefbcf8d65b40a68366 /intern/cycles/kernel
parentb14ec1860127eddf9a46132c4877bd4a7ee385a2 (diff)
Buildbot: enable support for NVIDIA Turing cards in Cycles (like GTX 20xx).
We currently only build the sm_7x kernels with CUDA 10.0, older cards still use 9.1 until rendering errors are solved for them.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/CMakeLists.txt22
1 files changed, 17 insertions, 5 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 3ba43a9e0bd..73ff7aeda15 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -397,17 +397,29 @@ if(WITH_CYCLES_CUDA_BINARIES)
set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__)
endif()
- if(WITH_CYCLES_CUBIN_COMPILER)
+ # Workaround to build only sm_7x kernels with CUDA 10, until
+ # older kernels work well with this version.
+ if(DEFINED CUDA10_NVCC_EXECUTABLE AND (${arch} MATCHES "sm_7."))
+ set(with_cubin_compiler OFF)
+ set(cuda_nvcc_executable "${CUDA10_NVCC_EXECUTABLE}")
+ set(cuda_toolkit_root_dir "${CUDA10_TOOLKIT_ROOT_DIR}")
+ else()
+ set(with_cubin_compiler ${WITH_CYCLES_CUBIN_COMPILER})
+ set(cuda_nvcc_executable "${CUDA_NVCC_EXECUTABLE}")
+ set(cuda_toolkit_root_dir "${CUDA_TOOLKIT_ROOT_DIR}")
+ endif()
+
+ if(with_cubin_compiler)
string(SUBSTRING ${arch} 3 -1 CUDA_ARCH)
# Needed to find libnvrtc-builtins.so. Can't do it from inside
# cycles_cubin_cc since the env variable is read before main()
if(APPLE)
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
- -E env DYLD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib")
+ -E env DYLD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib")
elseif(UNIX)
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
- -E env LD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib64")
+ -E env LD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib64")
endif()
add_custom_command(
@@ -418,12 +430,12 @@ if(WITH_CYCLES_CUDA_BINARIES)
-i ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
${cuda_flags}
-v
- -cuda-toolkit-dir "${CUDA_TOOLKIT_ROOT_DIR}"
+ -cuda-toolkit-dir "${cuda_toolkit_root_dir}"
DEPENDS ${kernel_sources} cycles_cubin_cc)
else()
add_custom_command(
OUTPUT ${cuda_cubin}
- COMMAND ${CUDA_NVCC_EXECUTABLE}
+ COMMAND ${cuda_nvcc_executable}
-arch=${arch}
${CUDA_NVCC_FLAGS}
--cubin