From 3a2dc4ba87f593292e06443a0228125a945d2590 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Fri, 26 Jun 2020 12:42:03 +0000 Subject: [PATCH] community/blender to 2.83.1-1 --- community/blender/D8063-cuda11.diff | 105 ++++++++++++++++++++++++++++ community/blender/PKGBUILD | 7 +- 2 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 community/blender/D8063-cuda11.diff diff --git a/community/blender/D8063-cuda11.diff b/community/blender/D8063-cuda11.diff new file mode 100644 index 000000000..26be31849 --- /dev/null +++ b/community/blender/D8063-cuda11.diff @@ -0,0 +1,105 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -375,7 +375,7 @@ + option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF) + option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF) + mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL) +-set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 CACHE STRING "CUDA architectures to build binaries for") ++set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_80 CACHE STRING "CUDA architectures to build binaries for") + mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH) + unset(PLATFORM_DEFAULT) + option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON) +diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake +--- a/build_files/cmake/config/blender_release.cmake ++++ b/build_files/cmake/config/blender_release.cmake +@@ -52,7 +52,7 @@ + set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE) + set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE) + set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE) +-set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75 CACHE STRING "" FORCE) ++set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;sm_80 CACHE STRING "" FORCE) + set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE) + + # platform dependent options +diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt +--- a/intern/cycles/CMakeLists.txt ++++ b/intern/cycles/CMakeLists.txt +@@ -313,7 +313,7 @@ + set(MAX_MSVC 1910) + elseif(${CUDA_VERSION} EQUAL "9.1") + set(MAX_MSVC 1911) +- elseif(${CUDA_VERSION} LESS "11.0") ++ elseif(${CUDA_VERSION} LESS "12.0") + set(MAX_MSVC 1999) + endif() + if(NOT MSVC_VERSION LESS ${MAX_MSVC} OR CMAKE_C_COMPILER_ID MATCHES "Clang") +diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt +--- a/intern/cycles/kernel/CMakeLists.txt ++++ b/intern/cycles/kernel/CMakeLists.txt +@@ -485,8 +485,12 @@ + foreach(arch ${CYCLES_CUDA_BINARIES_ARCH}) + if(${arch} MATCHES "sm_2.") + message(STATUS "CUDA binaries for ${arch} are no longer supported, skipped.") ++ elseif(${arch} MATCHES "sm_30" AND ${CUDA_VERSION} GREATER 109) ++ message(STATUS "CUDA binaries for ${arch} are no longer supported, skipped.") + elseif(${arch} MATCHES "sm_7." AND ${CUDA_VERSION} LESS 100) + message(STATUS "CUDA binaries for ${arch} require CUDA 10.0+, skipped.") ++ elseif(${arch} MATCHES "sm_8." AND ${CUDA_VERSION} LESS 110) ++ message(STATUS "CUDA binaries for ${arch} require CUDA 11.0+, skipped.") + else() + # Compile regular kernel + CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} filter "" "${cuda_filter_sources}" FALSE) +@@ -525,6 +529,11 @@ + set(cuda_flags ${cuda_flags} + -D __KERNEL_DEBUG__) + endif() ++ set(OPTIX_TARGET 30) ++ if(${CUDA_VERSION} GREATER 109) #cuda 11 ++ set(OPTIX_TARGET 52) ++ endif() ++ + if(WITH_CYCLES_CUBIN_COMPILER) + + # Needed to find libnvrtc-builtins.so. Can't do it from inside +@@ -536,7 +545,6 @@ + set(CUBIN_CC_ENV ${CMAKE_COMMAND} + -E env LD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib64") + endif() +- + add_custom_command( + OUTPUT ${output} + DEPENDS +@@ -551,7 +559,7 @@ + ${SRC_UTIL_HEADERS} + COMMAND ${CUBIN_CC_ENV} + "$" +- -target 30 ++ -target ${OPTIX_TARGET} + -ptx + -i ${CMAKE_CURRENT_SOURCE_DIR}/${input} + ${cuda_flags} +@@ -575,7 +583,7 @@ + COMMAND + ${CUDA_NVCC_EXECUTABLE} + --ptx +- -arch=sm_30 ++ -arch=sm_${OPTIX_TARGET} + ${cuda_flags} + ${input} + WORKING_DIRECTORY +diff --git a/intern/cycles/kernel/kernels/cuda/kernel_config.h b/intern/cycles/kernel/kernels/cuda/kernel_config.h +--- a/intern/cycles/kernel/kernels/cuda/kernel_config.h ++++ b/intern/cycles/kernel/kernels/cuda/kernel_config.h +@@ -70,8 +70,8 @@ + # endif + # define CUDA_KERNEL_BRANCHED_MAX_REGISTERS 63 + +-/* 7.x */ +-#elif __CUDA_ARCH__ <= 799 ++/* 7.x / 8.x */ ++#elif __CUDA_ARCH__ <= 899 + # define CUDA_MULTIPRESSOR_MAX_REGISTERS 65536 + # define CUDA_MULTIPROCESSOR_MAX_BLOCKS 32 + # define CUDA_BLOCK_MAX_THREADS 1024 + diff --git a/community/blender/PKGBUILD b/community/blender/PKGBUILD index 1fee9dad6..488bf9623 100644 --- a/community/blender/PKGBUILD +++ b/community/blender/PKGBUILD @@ -21,11 +21,11 @@ buildarch=8 # just build the package against them. I checked with NVIDIA and this way is # fine with them. -_gittag=v2.83 +_gittag=v2.83.1 # _gitcommit=054dbb833e15275e0e991e2c15e754a3e7583716 pkgname=blender -pkgver=2.83 +pkgver=2.83.1 [[ -n $_gitcommit ]] && pkgver=${pkgver}.git1.${_gitcommit:0:8} pkgrel=1 epoch=17 @@ -45,6 +45,7 @@ source=("git://git.blender.org/blender-addons.git" "git://git.blender.org/blender-translations.git" "git://git.blender.org/blender-dev-tools.git" embree.patch + D8063-cuda11.diff https://developer.download.nvidia.com/redist/optix/v7.0/OptiX-7.0.0-include.zip) if [[ -n $_gittag ]]; then source+=("${pkgname}-${pkgver}::git://git.blender.org/blender.git#tag=${_gittag}") @@ -56,6 +57,7 @@ sha512sums=('SKIP' 'SKIP' 'SKIP' '6de779ad8649a034ee65c45a36d7838ac0b8b32c3336b4d476186265c060f56276e3e0a2860ec4bff42bef7d5582ee82238013845f6a697672767a05a455aaca' + '7b0dc31c8babaaeed35807d27cc54e6e9fb79a08c4c267244bea2b47149e05089fe495f239fff7d4fff9b1ebcafd588396e8d1db5529dc7ac49d78731575e128' 'b2cff73def3757d4259f4b4d318a8ccfe166bf7c215cbb2124f1c81bd6e742f96207285b24eb4d99b527b7b97dc6d5e8fdf2f16d78d5d1e2684c26d681328491' 'SKIP') @@ -70,6 +72,7 @@ prepare() { git submodule update patch -Np1 -i "$srcdir"/embree.patch + patch -Np1 -i "$srcdir"/D8063-cuda11.diff mkdir build }