From 0d4dad4dd95c4a645743d63a4ed9ee3386673f26 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 24 Feb 2023 22:06:44 -0500 Subject: opensubdiv cuda 12 --- .../opensubdiv-3.3.0-use-gnuinstalldirs.patch | 39 +++++++++++++ ...ensubdiv-3.4.3-install-tutorials-into-bin.patch | 52 +++++++++++++++++ ...opensubdiv-3.4.4-add-CUDA12-compatibility.patch | 21 +++++++ .../files/opensubdiv-3.4.4-tbb-2021.patch | 65 ++++++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100644 media-libs/opensubdiv/files/opensubdiv-3.3.0-use-gnuinstalldirs.patch create mode 100644 media-libs/opensubdiv/files/opensubdiv-3.4.3-install-tutorials-into-bin.patch create mode 100644 media-libs/opensubdiv/files/opensubdiv-3.4.4-add-CUDA12-compatibility.patch create mode 100644 media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch (limited to 'media-libs/opensubdiv/files') diff --git a/media-libs/opensubdiv/files/opensubdiv-3.3.0-use-gnuinstalldirs.patch b/media-libs/opensubdiv/files/opensubdiv-3.3.0-use-gnuinstalldirs.patch new file mode 100644 index 0000000..0202776 --- /dev/null +++ b/media-libs/opensubdiv/files/opensubdiv-3.3.0-use-gnuinstalldirs.patch @@ -0,0 +1,39 @@ +diff -purN a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2017-07-25 21:58:09.000000000 +0100 ++++ b/CMakeLists.txt 2017-08-15 14:51:36.771044414 +0100 +@@ -23,6 +23,7 @@ + # + + project(OpenSubdiv) ++include(GNUInstallDirs) + + cmake_minimum_required(VERSION 2.8.6) + +@@ -63,15 +64,15 @@ if (NOT DEFINED CMAKE_INSTALL_PREFIX) + endif() + + if (NOT DEFINED CMAKE_INCDIR_BASE) +- set( CMAKE_INCDIR_BASE include/opensubdiv ) ++ set( CMAKE_INCDIR_BASE ${CMAKE_INSTALL_INCLUDEDIR}/opensubdiv ) + endif() + + if (NOT DEFINED CMAKE_BINDIR_BASE) +- set( CMAKE_BINDIR_BASE bin ) ++ set( CMAKE_BINDIR_BASE ${CMAKE_INSTALL_BINDIR} ) + endif() + + if (NOT DEFINED CMAKE_LIBDIR_BASE) +- set( CMAKE_LIBDIR_BASE lib ) ++ set( CMAKE_LIBDIR_BASE ${CMAKE_INSTALL_LIBDIR} ) + endif() + + if (NOT DEFINED CMAKE_FRAMEWORKDIR_BASE) +@@ -83,7 +84,7 @@ if (NOT DEFINED CMAKE_PLUGINDIR_BASE) + endif() + + if (NOT DEFINED CMAKE_DOCDIR_BASE) +- set( CMAKE_DOCDIR_BASE share/doc/opensubdiv ) ++ set( CMAKE_DOCDIR_BASE ${CMAKE_INSTALL_DOCDIR} ) + else() + if (IS_ABSOLUTE ${CMAKE_DOCDIR_BASE}) + set( CMAKE_DOCDIR_BASE "${CMAKE_DOCDIR_BASE}" ) diff --git a/media-libs/opensubdiv/files/opensubdiv-3.4.3-install-tutorials-into-bin.patch b/media-libs/opensubdiv/files/opensubdiv-3.4.3-install-tutorials-into-bin.patch new file mode 100644 index 0000000..f042967 --- /dev/null +++ b/media-libs/opensubdiv/files/opensubdiv-3.4.3-install-tutorials-into-bin.patch @@ -0,0 +1,52 @@ +diff -Naur a/tutorials/far/CMakeLists.txt b/tutorials/far/CMakeLists.txt +--- a/tutorials/far/CMakeLists.txt 2020-05-11 14:48:35.145797436 +1000 ++++ b/tutorials/far/CMakeLists.txt 2020-05-11 14:49:39.445969003 +1000 +@@ -30,7 +30,7 @@ + $ + ) + +- install(TARGETS ${NAME} DESTINATION "${CMAKE_BINDIR_BASE}/tutorials") ++ install(TARGETS ${NAME} DESTINATION "${CMAKE_BINDIR_BASE}") + + endmacro() + +diff -Naur a/tutorials/hbr/tutorial_0/CMakeLists.txt b/tutorials/hbr/tutorial_0/CMakeLists.txt +--- a/tutorials/hbr/tutorial_0/CMakeLists.txt 2020-05-11 14:48:35.145797436 +1000 ++++ b/tutorials/hbr/tutorial_0/CMakeLists.txt 2020-05-11 14:50:38.076125987 +1000 +@@ -30,5 +30,5 @@ + ${SOURCE_FILES} + ) + +-install(TARGETS hbr_tutorial_0 DESTINATION "${CMAKE_BINDIR_BASE}/tutorials") ++install(TARGETS hbr_tutorial_0 DESTINATION "${CMAKE_BINDIR_BASE}") + +diff -Naur a/tutorials/hbr/tutorial_1/CMakeLists.txt b/tutorials/hbr/tutorial_1/CMakeLists.txt +--- a/tutorials/hbr/tutorial_1/CMakeLists.txt 2020-05-11 14:48:35.145797436 +1000 ++++ b/tutorials/hbr/tutorial_1/CMakeLists.txt 2020-05-11 14:50:10.406051839 +1000 +@@ -30,5 +30,5 @@ + ${SOURCE_FILES} + ) + +-install(TARGETS hbr_tutorial_1 DESTINATION "${CMAKE_BINDIR_BASE}/tutorials") ++install(TARGETS hbr_tutorial_1 DESTINATION "${CMAKE_BINDIR_BASE}") + +diff -Naur a/tutorials/hbr/tutorial_2/CMakeLists.txt b/tutorials/hbr/tutorial_2/CMakeLists.txt +--- a/tutorials/hbr/tutorial_2/CMakeLists.txt 2020-05-11 14:48:35.145797436 +1000 ++++ b/tutorials/hbr/tutorial_2/CMakeLists.txt 2020-05-11 14:50:20.706079428 +1000 +@@ -30,5 +30,5 @@ + ${SOURCE_FILES} + ) + +-install(TARGETS hbr_tutorial_2 DESTINATION "${CMAKE_BINDIR_BASE}/tutorials") ++install(TARGETS hbr_tutorial_2 DESTINATION "${CMAKE_BINDIR_BASE}") + +diff -Naur a/tutorials/osd/tutorial_0/CMakeLists.txt b/tutorials/osd/tutorial_0/CMakeLists.txt +--- a/tutorials/osd/tutorial_0/CMakeLists.txt 2020-05-11 14:48:35.145797436 +1000 ++++ b/tutorials/osd/tutorial_0/CMakeLists.txt 2020-05-11 14:50:51.446161856 +1000 +@@ -35,5 +35,5 @@ + osd_static_cpu + ) + +-install(TARGETS osd_tutorial_0 DESTINATION "${CMAKE_BINDIR_BASE}/tutorials") ++install(TARGETS osd_tutorial_0 DESTINATION "${CMAKE_BINDIR_BASE}") + diff --git a/media-libs/opensubdiv/files/opensubdiv-3.4.4-add-CUDA12-compatibility.patch b/media-libs/opensubdiv/files/opensubdiv-3.4.4-add-CUDA12-compatibility.patch new file mode 100644 index 0000000..413659e --- /dev/null +++ b/media-libs/opensubdiv/files/opensubdiv-3.4.4-add-CUDA12-compatibility.patch @@ -0,0 +1,21 @@ +From: "Alexander Golubev" + +Set correct default minimal -arch for CUDA 9 and 11 +--- OpenSubdiv-3_4_4/CMakeLists.txt 2021-11-07 02:01:07.899484952 +0300 ++++ OpenSubdiv-3_4_4/CMakeLists.txt.new 2021-11-07 02:01:23.402764409 +0300 +@@ -587,8 +587,14 @@ + 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_52 ) + endif() + endif() + endif() diff --git a/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch b/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch new file mode 100644 index 0000000..bae9c4a --- /dev/null +++ b/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch @@ -0,0 +1,65 @@ +https://github.com/PixarAnimationStudios/OpenSubdiv/pull/1234 +https://bugs.gentoo.org/820824 + +From 7375c99a4d1337f9b79775fb2c753e7865968642 Mon Sep 17 00:00:00 2001 +From: Artur Sinila +Date: Sun, 25 Jul 2021 20:34:48 +0300 +Subject: [PATCH 1/2] Fix typo: schedular -> scheduler + +--- + opensubdiv/osd/tbbEvaluator.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/opensubdiv/osd/tbbEvaluator.h b/opensubdiv/osd/tbbEvaluator.h +index 6bd365bc5..886a94837 100644 +--- a/opensubdiv/osd/tbbEvaluator.h ++++ b/opensubdiv/osd/tbbEvaluator.h +@@ -1226,7 +1226,7 @@ class TbbEvaluator { + /// \brief synchronize all asynchronous computation invoked on this device. + static void Synchronize(void *deviceContext = NULL); + +- /// \brief initialize tbb task schedular ++ /// \brief initialize tbb task scheduler + /// (optional: client may use tbb::task_scheduler_init) + /// + /// @param numThreads how many threads + +From 9079a517f406afba9ea50657b0a0786ad7a7bdcb Mon Sep 17 00:00:00 2001 +From: Artur Sinila +Date: Sun, 25 Jul 2021 20:58:27 +0300 +Subject: [PATCH 2/2] Support oneTBB 2021 + +--- + opensubdiv/osd/tbbEvaluator.cpp | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/opensubdiv/osd/tbbEvaluator.cpp b/opensubdiv/osd/tbbEvaluator.cpp +index c98db9f6d..66c2ed58f 100644 +--- a/opensubdiv/osd/tbbEvaluator.cpp ++++ b/opensubdiv/osd/tbbEvaluator.cpp +@@ -25,7 +25,8 @@ + #include "../osd/tbbEvaluator.h" + #include "../osd/tbbKernel.h" + +-#include ++#define TBB_PREVIEW_GLOBAL_CONTROL true ++#include + + namespace OpenSubdiv { + namespace OPENSUBDIV_VERSION { +@@ -215,10 +216,11 @@ TbbEvaluator::Synchronize(void *) { + /* static */ + void + TbbEvaluator::SetNumThreads(int numThreads) { +- if (numThreads == -1) { +- tbb::task_scheduler_init init; +- } else { +- tbb::task_scheduler_init init(numThreads); ++ if (numThreads != -1) { ++ tbb::global_control tbb_global_control( ++ tbb::global_control::max_allowed_parallelism, ++ numThreads ++ ); + } + } + -- cgit v1.2.3