diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-20 17:10:47 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-20 17:10:47 +0400 |
commit | 8d6e5e2feeecdcff4d4b0d3651043ca561af2cb4 (patch) | |
tree | 20b1d6af934f0387a286eb696b5aec3605f57218 /intern/cycles | |
parent | a92468c7d7bd3171cc04dc956f559f6c8f4f338c (diff) |
Cycles: update build configurations to include CUDA sm_35 architecture. When using
a compiler older than CUDA 5.0 it will give a warning and skip this architecture.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 28 | ||||
-rw-r--r-- | intern/cycles/kernel/SConscript | 4 | ||||
-rw-r--r-- | intern/cycles/util/util_types.h | 2 |
4 files changed, 22 insertions, 14 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 1f96ed0ae83..27c54af5153 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -304,7 +304,7 @@ public: } } else { - /* CUDA 4.x */ + /* CUDA 5.x */ if(major == 1) { /* sm_1x */ arch_flags = "--maxrregcount=24 --opencc-options -OPT:Olimit=0 --use_fast_math"; diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 5e9dd15b812..2fa1393e935 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -130,6 +130,12 @@ if(WITH_CYCLES_CUDA_BINARIES) string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}") + # warn for other versions + if(CUDA_VERSION MATCHES "50") + else() + message(WARNING "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, build may succeed but only CUDA 5.0 is officially supported") + endif() + # build for each arch set(cuda_sources kernel.cu ${SRC_HEADERS} ${SRC_SVM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS}) set(cuda_cubins) @@ -139,12 +145,6 @@ if(WITH_CYCLES_CUDA_BINARIES) set(cuda_version_flags "-D__KERNEL_CUDA_VERSION__=${CUDA_VERSION}") - # warn for other versions - if(CUDA_VERSION MATCHES "50") - else() - message(STATUS "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, build may succeed but only CUDA 5.0 is officially supported") - endif() - # build flags depending on CUDA version and arch if(CUDA_VERSION LESS 50) # CUDA 4.x @@ -176,13 +176,17 @@ if(WITH_CYCLES_CUDA_BINARIES) set(cuda_math_flags "--use_fast_math") endif() - add_custom_command( - OUTPUT ${cuda_cubin} - COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" ${cuda_arch_flags} ${cuda_version_flags} ${cuda_math_flags} -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC - DEPENDS ${cuda_sources}) + if(CUDA_VERSION LESS 50 AND ${arch} MATCHES "sm_35") + message(WARNING "Can't build kernel for CUDA sm_35 architecture, skipping") + else() + add_custom_command( + OUTPUT ${cuda_cubin} + COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" ${cuda_arch_flags} ${cuda_version_flags} ${cuda_math_flags} -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC + DEPENDS ${cuda_sources}) - delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib) - list(APPEND cuda_cubins ${cuda_cubin}) + delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib) + list(APPEND cuda_cubins ${cuda_cubin}) + endif() endforeach() add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins}) diff --git a/intern/cycles/kernel/SConscript b/intern/cycles/kernel/SConscript index 353ec1ce9d8..6459c3ed183 100644 --- a/intern/cycles/kernel/SConscript +++ b/intern/cycles/kernel/SConscript @@ -88,6 +88,10 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']: # build flags depending on CUDA version and arch if cuda_version < 50: + if arch == "sm_35": + print("Can't build kernel for CUDA sm_35 architecture, skipping") + continue + # CUDA 4.x if arch.startswith("sm_1"): # sm_1x diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 4fd1e9d8807..a67c55acf3d 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -517,7 +517,7 @@ __device_inline const __m128 shuffle_swap(const __m128& a, const shuffle_swap_t& #else -/* somewhat slower version for SSE3 */ +/* somewhat slower version for SSE2 */ typedef int shuffle_swap_t; __device_inline const shuffle_swap_t shuffle_swap_identity(void) |