From f63da3dcf59f87b34aa916b2c65ce5a40a48fd92 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 4 Dec 2018 11:49:57 +0100 Subject: Buildbot: enable support for NVIDIA Turing cards in Cycles (like GTX 20xx). We currently only build the sm_7x kernels with CUDA 10.0, older cards still use 9.1 until rendering errors are solved for them. --- intern/cycles/kernel/CMakeLists.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'intern/cycles/kernel') diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 3ba43a9e0bd..73ff7aeda15 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -397,17 +397,29 @@ if(WITH_CYCLES_CUDA_BINARIES) set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__) endif() - if(WITH_CYCLES_CUBIN_COMPILER) + # Workaround to build only sm_7x kernels with CUDA 10, until + # older kernels work well with this version. + if(DEFINED CUDA10_NVCC_EXECUTABLE AND (${arch} MATCHES "sm_7.")) + set(with_cubin_compiler OFF) + set(cuda_nvcc_executable "${CUDA10_NVCC_EXECUTABLE}") + set(cuda_toolkit_root_dir "${CUDA10_TOOLKIT_ROOT_DIR}") + else() + set(with_cubin_compiler ${WITH_CYCLES_CUBIN_COMPILER}) + set(cuda_nvcc_executable "${CUDA_NVCC_EXECUTABLE}") + set(cuda_toolkit_root_dir "${CUDA_TOOLKIT_ROOT_DIR}") + endif() + + if(with_cubin_compiler) string(SUBSTRING ${arch} 3 -1 CUDA_ARCH) # Needed to find libnvrtc-builtins.so. Can't do it from inside # cycles_cubin_cc since the env variable is read before main() if(APPLE) set(CUBIN_CC_ENV ${CMAKE_COMMAND} - -E env DYLD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib") + -E env DYLD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib") elseif(UNIX) set(CUBIN_CC_ENV ${CMAKE_COMMAND} - -E env LD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib64") + -E env LD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib64") endif() add_custom_command( @@ -418,12 +430,12 @@ if(WITH_CYCLES_CUDA_BINARIES) -i ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src} ${cuda_flags} -v - -cuda-toolkit-dir "${CUDA_TOOLKIT_ROOT_DIR}" + -cuda-toolkit-dir "${cuda_toolkit_root_dir}" DEPENDS ${kernel_sources} cycles_cubin_cc) else() add_custom_command( OUTPUT ${cuda_cubin} - COMMAND ${CUDA_NVCC_EXECUTABLE} + COMMAND ${cuda_nvcc_executable} -arch=${arch} ${CUDA_NVCC_FLAGS} --cubin -- cgit v1.2.3