summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2019-08-01 14:22:55 +0200
committerbartus2019-08-01 14:22:55 +0200
commit9bf2b60890b4d910865210879d040fdad1073202 (patch)
tree52228f5f83bf838bea0aba73cc11d665db5e18b9
parent92ff85adcbfe56aacb0bc8b14948c59f2346adf4 (diff)
downloadaur-9bf2b60890b4d910865210879d040fdad1073202.tar.gz
Update cuda build routines
* port SelectCudaComputeArch.patch from blender-2.8-git * add DISABLE_CUDA, allowing user to drop cuda build
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD32
-rw-r--r--SelectCudaComputeArch.patch9
3 files changed, 27 insertions, 16 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e5fd8efe787..62981b0263d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -57,7 +57,7 @@ pkgbase = blender-fracture_modifier-git
md5sums = SKIP
md5sums = SKIP
md5sums = 0a4847775c9eec16a76ec7d3a03a678d
- md5sums = 9454ff7e994f72ead5027356e227cbd2
+ md5sums = a9b7fea83b66f4ced146b32ef4433479
md5sums = df6f12c3327678b0a05f9e48e9ace67c
md5sums = 8679d9ab041141cf4fa1ae4da9389986
md5sums = bb325c8c879d677ad1f1c54797268716
diff --git a/PKGBUILD b/PKGBUILD
index 101a95a89e3..0b29394bc86 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,11 @@
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# shellcheck disable=SC2034
+#to enforce cuda verison uncomment this line and update value of sm_xx model accordingly
+#_cuda_capability+=(sm_30 sm_35 sm_37)
+#_cuda_capability+=(sm_50 sm_52 sm_60 sm_61 sm_70 sm_75)
+((TRAVIS)) && _cuda_capability+=(sm_50 sm_52 sm_60 sm_61 sm_70 sm_75) # suppress 3.x to prevent Travis build exceed time limit.
+
_branch="fracture_modifier"
_sufix=${_branch}
_blenver=2.82
@@ -14,8 +19,9 @@ url="https://blender.org/"
depends=('alembic' 'libgl' 'python' 'python-numpy' 'openjpeg' 'desktop-file-utils' 'hicolor-icon-theme'
'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio' 'opencolorio'
'openvdb' 'opencollada' 'opensubdiv' 'openshadinglanguage' 'libtiff' 'libpng')
-optdepends=('cuda: CUDA support in Cycles')
+
makedepends=('git' 'cmake' 'boost' 'mesa' 'llvm')
+((DISABLE_CUDA)) && optdepends=('cuda: CUDA support in Cycles') || makedepends+=('cuda')
provides=("blender-${_sufix}")
conflicts=("blender-${_sufix}")
#options=(!makeflags)
@@ -48,7 +54,7 @@ md5sums=('SKIP'
'SKIP'
'SKIP'
'0a4847775c9eec16a76ec7d3a03a678d'
- '9454ff7e994f72ead5027356e227cbd2'
+ 'a9b7fea83b66f4ced146b32ef4433479'
'df6f12c3327678b0a05f9e48e9ace67c'
'8679d9ab041141cf4fa1ae4da9389986'
'bb325c8c879d677ad1f1c54797268716'
@@ -56,13 +62,6 @@ md5sums=('SKIP'
'4e4423315f07bc724c7703c57c4481d7'
'f98eb0576a8e00444cc3e936d31a9812')
-# determine whether we can precompile CUDA kernels
-_CUDA_PKG=`pacman -Qq cuda 2>/dev/null` || true
-if [ "$_CUDA_PKG" != "" ]; then
- _EXTRAOPTS="-DWITH_CYCLES_CUDA_BINARIES=ON \
- -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda"
-fi
-
pkgver() {
cd "$srcdir/blender"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
@@ -72,7 +71,9 @@ prepare() {
cd "$srcdir/blender"
# update the submodules
git submodule update --init --recursive --remote
- git apply -v ${srcdir}/SelectCudaComputeArch.patch
+ if [ -z "$_cuda_capability" ] && grep -q nvidia <(lsmod); then
+ git apply -v ${srcdir}/SelectCudaComputeArch.patch
+ fi
git apply -v ${srcdir}/gcc8.patch
git apply -v ${srcdir}/ffmpeg.patch
git apply -v ${srcdir}/openvdb.patch
@@ -90,6 +91,15 @@ build() {
_pyver=$(python -c "from sys import version_info; print(\"%d.%d\" % (version_info[0],version_info[1]))")
msg "python version detected: ${_pyver}"
+ # determine whether we can precompile CUDA kernels
+ _CUDA_PKG=`pacman -Qq cuda 2>/dev/null` || true
+ if [ "$_CUDA_PKG" != "" ]; then
+ _EXTRAOPTS=(-DWITH_CYCLES_CUDA_BINARIES=ON \
+ -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda)
+ if [ -v _cuda_capability ]; then
+ _EXTRAOPTS+=(-DCYCLES_CUDA_BINARIES_ARCH=$(IFS=';'; echo "${_cuda_capability[*]}";))
+ fi
+ fi
cmake "$srcdir/blender" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_INSTALL_PORTABLE=OFF \
@@ -110,7 +120,7 @@ build() {
-DWITH_OPENVDB=ON \
-DWITH_OPENVDB_BLOSC=ON \
-DWITH_OPENCOLLADA=ON \
- $_EXTRAOPTS
+ ${_EXTRAOPTS[@]}
make
}
diff --git a/SelectCudaComputeArch.patch b/SelectCudaComputeArch.patch
index 540d50f0bcc..229e6bc7e2c 100644
--- a/SelectCudaComputeArch.patch
+++ b/SelectCudaComputeArch.patch
@@ -1,15 +1,16 @@
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
-index 8d04025e6fd..a6949c99f60 100644
+index 5bf681792ca..b975fb5db14 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
-@@ -41,6 +41,10 @@ if(WITH_CYCLES_CUDA_BINARIES OR NOT WITH_CUDA_DYNLOAD)
+@@ -41,6 +41,11 @@ if(WITH_CYCLES_CUDA_BINARIES OR NOT WITH_CUDA_DYNLOAD)
find_package(CUDA) # Try to auto locate CUDA toolkit
if(CUDA_FOUND)
message(STATUS "CUDA nvcc = ${CUDA_NVCC_EXECUTABLE}")
+ CUDA_SELECT_NVCC_ARCH_FLAGS(CUDA_ARCH_FLAGS Auto)
-+ set(CYCLES_CUDA_BINARIES_ARCH "${CUDA_ARCH_FLAGS_readable}")
++ 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: ${CUDA_ARCH_FLAGS_readable})")
++ " archs: ${CYCLES_CUDA_BINARIES_ARCH})")
else()
message(STATUS "CUDA compiler not found, disabling WITH_CYCLES_CUDA_BINARIES")
set(WITH_CYCLES_CUDA_BINARIES OFF)