CMake: support CUDA 9 toolkit, and automatically disable sm_2x binaries.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 1 Oct 2017 12:04:34 +0000 (14:04 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 1 Oct 2017 12:14:53 +0000 (14:14 +0200)
Fermi cards (GTX 4xx and 5xx) are no longer supported with this version, so
we can keep supporting both CUDA 8 and 9 for a while.

intern/cycles/kernel/CMakeLists.txt

index b4ca16bdb48939bfde31a93f18c37273053873c2..b10dd05cb9b1fe74fb3039ebd4f93994bf77aaae 100644 (file)
@@ -321,7 +321,7 @@ if(WITH_CYCLES_CUDA_BINARIES)
        set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
 
        # warn for other versions
-       if(CUDA_VERSION MATCHES "80")
+       if(CUDA_VERSION MATCHES "80" OR CUDA_VERSION MATCHES "90")
        else()
                message(WARNING
                        "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
@@ -399,13 +399,17 @@ if(WITH_CYCLES_CUDA_BINARIES)
        endmacro()
 
        foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
-               # Compile regular kernel
-               CYCLES_CUDA_KERNEL_ADD(${arch} kernel "" "${cuda_sources}" FALSE)
-               CYCLES_CUDA_KERNEL_ADD(${arch} filter "" "${cuda_filter_sources}" FALSE)
-
-               if(WITH_CYCLES_CUDA_SPLIT_KERNEL_BINARIES)
-                       # Compile split kernel
-                       CYCLES_CUDA_KERNEL_ADD(${arch} kernel_split "-D__SPLIT__" ${cuda_sources} FALSE)
+               if(CUDA_VERSION MATCHES "90" AND ${arch} MATCHES "sm_2.")
+                       message(STATUS "CUDA binaries for ${arch} disabled, not supported by CUDA 9.")
+               else()
+                       # Compile regular kernel
+                       CYCLES_CUDA_KERNEL_ADD(${arch} kernel "" "${cuda_sources}" FALSE)
+                       CYCLES_CUDA_KERNEL_ADD(${arch} filter "" "${cuda_filter_sources}" FALSE)
+
+                       if(WITH_CYCLES_CUDA_SPLIT_KERNEL_BINARIES)
+                               # Compile split kernel
+                               CYCLES_CUDA_KERNEL_ADD(${arch} kernel_split "-D__SPLIT__" ${cuda_sources} FALSE)
+                       endif()
                endif()
        endforeach()