aboutsummarylogtreecommitdiffstats
path: root/SelectCudaComputeArch.patch
blob: f876b48b2aee4ca698d0e0fc648aaa5624b5d51f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index c59f78b1f1a..8cad057f3ab 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -30,6 +30,11 @@ if(WITH_CYCLES_DEVICE_CUDA AND (WITH_CYCLES_CUDA_BINARIES OR NOT WITH_CUDA_DYNLO
 
   if(CUDA_FOUND)
     message(STATUS "Found CUDA ${CUDA_NVCC_EXECUTABLE} (${CUDA_VERSION})")
+      CUDA_SELECT_NVCC_ARCH_FLAGS(CUDA_ARCH_FLAGS Auto)
+        string(REGEX REPLACE " compute_[0-9]+" "" CYCLES_CUDA_BINARIES_ARCH "${CUDA_ARCH_FLAGS_readable}")
+        string(REGEX REPLACE " " ";" CYCLES_CUDA_BINARIES_ARCH "${CYCLES_CUDA_BINARIES_ARCH}")
+        message(STATUS "Enabling CUDA support (version: ${CUDA_VERSION_STRING},"
+          " archs: ${CYCLES_CUDA_BINARIES_ARCH})")
   else()
     if(NOT WITH_CUDA_DYNLOAD)
       message(STATUS "Additionally falling back to dynamic CUDA load")