SelectCudaComputeArch.patch 932 B

1234567891011121314151617
  1. diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
  2. index d0f473a2939..90fcb40107a 100644
  3. --- a/intern/cycles/cmake/external_libs.cmake
  4. +++ b/intern/cycles/cmake/external_libs.cmake
  5. @@ -41,6 +41,11 @@ if(WITH_CYCLES_CUDA_BINARIES OR NOT WITH_CUDA_DYNLOAD)
  6. find_package(CUDA) # Try to auto locate CUDA toolkit
  7. if(CUDA_FOUND)
  8. message(STATUS "CUDA nvcc = ${CUDA_NVCC_EXECUTABLE}")
  9. + CUDA_SELECT_NVCC_ARCH_FLAGS(CUDA_ARCH_FLAGS Auto)
  10. + string(REGEX REPLACE " compute_[0-9]+" "" CYCLES_CUDA_BINARIES_ARCH "${CUDA_ARCH_FLAGS_readable}")
  11. + string(REGEX REPLACE " " ";" CYCLES_CUDA_BINARIES_ARCH "${CYCLES_CUDA_BINARIES_ARCH}")
  12. + message(STATUS "Enabling CUDA support (version: ${CUDA_VERSION_STRING},"
  13. + " archs: ${CYCLES_CUDA_BINARIES_ARCH})")
  14. else()
  15. message(STATUS "CUDA compiler not found, disabling WITH_CYCLES_CUDA_BINARIES")
  16. set(WITH_CYCLES_CUDA_BINARIES OFF)