summaryrefslogtreecommitdiff
path: root/sci-libs/vtk/vtk-9.0.1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/vtk/vtk-9.0.1.ebuild')
-rw-r--r--sci-libs/vtk/vtk-9.0.1.ebuild25
1 files changed, 23 insertions, 2 deletions
diff --git a/sci-libs/vtk/vtk-9.0.1.ebuild b/sci-libs/vtk/vtk-9.0.1.ebuild
index 6e0717f814c3..a38e3f1c3270 100644
--- a/sci-libs/vtk/vtk-9.0.1.ebuild
+++ b/sci-libs/vtk/vtk-9.0.1.ebuild
@@ -41,7 +41,7 @@ RESTRICT="!test? ( test )"
REQUIRED_USE="
all-modules? ( boost ffmpeg gdal imaging mysql odbc postgres qt5 rendering theora views )
- cuda? ( X )
+ cuda? ( X video_cards_nvidia )
java? ( rendering )
python? ( ${PYTHON_REQUIRED_USE} )
qt5? ( X rendering )
@@ -294,7 +294,28 @@ src_configure() {
fi
if use cuda; then
- mycmakeargs+=( -DVTKm_CUDA_Architecture="native" )
+ local cuda_arch=
+ case ${VTK_CUDA_ARCH:-native} in
+ # we ignore fermi arch, because current nvidia-cuda-toolkit-11*
+ # no longer supports it
+ kepler|maxwell|pascal|volta|turing|ampere|all)
+ cuda_arch=${VTK_CUDA_ARCH}
+ ;;
+ native)
+ ewarn "If auto detection fails for you, please try and export the"
+ ewarn "VTK_CUDA_ARCH environment variable to one of the common arch"
+ ewarn "names: kepler, maxwell, pascal, volta, turing, ampere or all."
+ cuda_arch=native
+ ;;
+ *)
+ eerror "Please properly set the VTK_CUDA_ARCH environment variable to"
+ eerror "one of: kepler, maxwell, pascal, volta, turing, ampere, all"
+ die "Invalid CUDA architecture given: '${VTK_CUDA_ARCH}'!"
+ ;;
+ esac
+ ewarn "Using CUDA architecture '${cuda_arch}'"
+
+ mycmakeargs+=( -DVTKm_CUDA_Architecture=${cuda_arch} )
fi
if use ffmpeg; then