summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
author Christoph Willing2023-06-01 09:19:58 +0200
committer Willy Sudiarto Raharjo2023-06-03 05:38:29 +0200
commit62875008414ac218517c5b569137c5b048cd21dc (patch)
treeceea09c35edcf4d561d362ebf83c93125896564e /graphics
parent8320f13649915c2c0721671c1545b822f20cbc48 (diff)
downloadslackbuilds-62875008414ac218517c5b569137c5b048cd21dc.tar.gz
graphics/OpenSubdiv: Option for CUDA support
Signed-off-by: Christoph Willing <chris.willing@linux.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'graphics')
-rw-r--r--graphics/OpenSubdiv/CUDA-compatibility.patch18
-rw-r--r--graphics/OpenSubdiv/OpenSubdiv.SlackBuild11
-rw-r--r--graphics/OpenSubdiv/README8
3 files changed, 34 insertions, 3 deletions
diff --git a/graphics/OpenSubdiv/CUDA-compatibility.patch b/graphics/OpenSubdiv/CUDA-compatibility.patch
new file mode 100644
index 0000000000..c1cf2981e2
--- /dev/null
+++ b/graphics/OpenSubdiv/CUDA-compatibility.patch
@@ -0,0 +1,18 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -590,8 +590,14 @@ if(CUDA_FOUND)
+ if (NOT DEFINED OSD_CUDA_NVCC_FLAGS)
+ if (CUDA_VERSION_MAJOR LESS 6)
+ set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_11 )
+- else()
++ elseif (CUDA_VERSION_MAJOR LESS 9)
+ set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_20 )
++ elseif (CUDA_VERSION_MAJOR LESS 11)
++ set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_30 )
++ elseif (CUDA_VERSION_MAJOR LESS 12)
++ set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_35 )
++ else()
++ set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_50 )
+ endif()
+ endif()
+ endif()
diff --git a/graphics/OpenSubdiv/OpenSubdiv.SlackBuild b/graphics/OpenSubdiv/OpenSubdiv.SlackBuild
index 1a6aa7bd1e..3c11bac9d4 100644
--- a/graphics/OpenSubdiv/OpenSubdiv.SlackBuild
+++ b/graphics/OpenSubdiv/OpenSubdiv.SlackBuild
@@ -3,7 +3,7 @@
# Slackware build script for Opensubdiv
# Copyright 2019 J. "MUFTI" Scheurich Stuttgart/Germany
-# Copyright 2021-3 Christoph Willing Brisbane/Australia
+# Copyright 2021-2023 Christoph Willing Brisbane/Australia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -32,7 +32,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=OpenSubdiv
VERSION=${VERSION:-3.5.0}
SRCVER=$(echo $VERSION | tr . _)
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -75,6 +75,8 @@ rm -rf $PRGNAM-$SRCVER
tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
cd $PRGNAM-$SRCVER
sed -i -e '/${OPENGL_gl_LIBRARY}/a${OPENGL_glx_LIBRARY}' CMakeLists.txt
+patch -p1 < $CWD/CUDA-compatibility.patch
+
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -82,6 +84,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
+cuda="-DNO_CUDA=ON";
+[ "${ENABLE_CUDA:-no}" = "yes" ] && cuda=""
+
mkdir -p build
cd build
cmake \
@@ -90,6 +95,8 @@ cd build
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_LIBDIR_BASE=lib${LIBDIRSUFFIX} \
-DCMAKE_DOCDIR_BASE=doc/$PRGNAM-$VERSION \
+ -DNO_CLEW=ON \
+ $cuda \
-DCMAKE_BUILD_TYPE=Release ..
make
diff --git a/graphics/OpenSubdiv/README b/graphics/OpenSubdiv/README
index 500d706797..18ad40a900 100644
--- a/graphics/OpenSubdiv/README
+++ b/graphics/OpenSubdiv/README
@@ -6,5 +6,11 @@ framerates.
Additional utility is available in OpenSubdiv when the following SBo
packages are installed and detected at build time:
- tbb cudatoolkit glfw3
+ tbb glfw3 ptex
+
+Some graphics cards are not supported with the existing version of
+the cudatoolkit at SBo. Therefore CUDA backend support is not enabled
+by default in this SlackBuild. It must be explicitly enabled (as well
+as cudatoolkit being installed) to use it in the build e.g.
+ ENABLE_CUDA=yes bash OpenSubdiv.SlackBuild