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 14:34:59 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-12-04 18:03:18 +0300
commitb14ec1860127eddf9a46132c4877bd4a7ee385a2 (patch)
tree72db903da88d3589c639984c86159ed5e19c1dd2 /intern/cycles/kernel
parent3f31ec83984b19efe174319ae1d86995a4c26ecc (diff)
Cycles: add initial CUDA 10.0 support, but only recommend use for Turing cards.
There may still be rendering errors when used for older graphics cards.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/CMakeLists.txt6
-rw-r--r--intern/cycles/kernel/kernels/cuda/kernel_config.h18
2 files changed, 19 insertions, 5 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index d4145225b77..3ba43a9e0bd 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -343,11 +343,11 @@ if(WITH_CYCLES_CUDA_BINARIES)
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
# warn for other versions
- if(CUDA_VERSION MATCHES "90" OR CUDA_VERSION MATCHES "91")
+ if(CUDA_VERSION MATCHES "90" OR CUDA_VERSION MATCHES "91" OR CUDA_VERSION MATCHES "100")
else()
message(WARNING
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
- "build may succeed but only CUDA 9.0 and 9.1 are officially supported")
+ "build may succeed but only CUDA 9.0, 9.1 and 10.0 are officially supported")
endif()
# build for each arch
@@ -442,6 +442,8 @@ if(WITH_CYCLES_CUDA_BINARIES)
foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
if(${arch} MATCHES "sm_2.")
message(STATUS "CUDA binaries for ${arch} are no longer supported, skipped.")
+ elseif(${arch} MATCHES "sm_7." AND NOT (${CUDA_VERSION} VERSION_GREATER_EQUAL 10.0))
+ message(STATUS "CUDA binaries for ${arch} require CUDA 10.0+, skipped.")
else()
# Compile regular kernel
CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} filter "" "${cuda_filter_sources}" FALSE)
diff --git a/intern/cycles/kernel/kernels/cuda/kernel_config.h b/intern/cycles/kernel/kernels/cuda/kernel_config.h
index 3808898c5ca..6d41dc15785 100644
--- a/intern/cycles/kernel/kernels/cuda/kernel_config.h
+++ b/intern/cycles/kernel/kernels/cuda/kernel_config.h
@@ -52,8 +52,8 @@
# define CUDA_KERNEL_MAX_REGISTERS 63
# define CUDA_KERNEL_BRANCHED_MAX_REGISTERS 63
-/* 5.0, 5.2, 5.3, 6.0, 6.1 */
-#elif __CUDA_ARCH__ >= 500
+/* 5.x, 6.x */
+#elif __CUDA_ARCH__ <= 699
# define CUDA_MULTIPRESSOR_MAX_REGISTERS 65536
# define CUDA_MULTIPROCESSOR_MAX_BLOCKS 32
# define CUDA_BLOCK_MAX_THREADS 1024
@@ -62,13 +62,25 @@
/* tunable parameters */
# define CUDA_THREADS_BLOCK_WIDTH 16
/* CUDA 9.0 seems to cause slowdowns on high-end Pascal cards unless we increase the number of registers */
-# if __CUDACC_VER_MAJOR__ == 9 && __CUDA_ARCH__ >= 600
+# if __CUDACC_VER_MAJOR__ >= 9 && __CUDA_ARCH__ >= 600
# define CUDA_KERNEL_MAX_REGISTERS 64
# else
# define CUDA_KERNEL_MAX_REGISTERS 48
# endif
# define CUDA_KERNEL_BRANCHED_MAX_REGISTERS 63
+/* 7.x */
+#elif __CUDA_ARCH__ <= 799
+# define CUDA_MULTIPRESSOR_MAX_REGISTERS 65536
+# define CUDA_MULTIPROCESSOR_MAX_BLOCKS 32
+# define CUDA_BLOCK_MAX_THREADS 1024
+# define CUDA_THREAD_MAX_REGISTERS 255
+
+/* tunable parameters */
+# define CUDA_THREADS_BLOCK_WIDTH 16
+# define CUDA_KERNEL_MAX_REGISTERS 64
+# define CUDA_KERNEL_BRANCHED_MAX_REGISTERS 72
+
/* unknown architecture */
#else