summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSnir Sheriber <ssheribe@redhat.com>2018-03-22 10:18:57 +0200
committerJan Schmidt <jan@centricular.com>2018-04-17 23:33:04 +1000
commit73cd1aa9dc1d9c56caaa8bf60198afdd26a58f06 (patch)
treeb910a11b61aa9ed5fdc3e8313e641d84390c53e3 /configure.ac
parent142ad9dbad7a4f0e0af7e033d01e22b069d4ace9 (diff)
nvdec/nvenc: Support CUDA Toolkit 9
Since cuda-tools 9.0, nvcuvid.h is replaced by dynlink_nvcuvid.h. This patch changes nvdec to use run-time dynamic linking if cuda-tools version >= 9. nvenc does not require any change since its necessary headers are still available. https://bugzilla.gnome.org/show_bug.cgi?id=791724
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 20 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 23254ae81..0a04dcd1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -941,17 +941,22 @@ AG_GST_CHECK_FEATURE(CUDA, [NVIDIA CUDA API],, [
CUDA_LIBS="-L$CUDA_PREFIX/lib -L$CUDA_PREFIX/lib64 -L$CUDA_PREFIX/lib/stubs -L$CUDA_PREFIX/lib64/stubs -lcuda -lcudart"
fi
else
- PKG_CHECK_MODULES([CUDA], [cuda-8.0 cudart-8.0],, [
- PKG_CHECK_MODULES([CUDA], [cuda-7.5 cudart-7.5],, [
- PKG_CHECK_MODULES([CUDA], [cuda-7.0 cudart-7.0],, [
- PKG_CHECK_MODULES([CUDA], [cuda-6.5 cudart-6.5],, [
- AC_MSG_WARN([Could not find cuda headers/libraries])])])])])
+ PKG_CHECK_MODULES([CUDA], [cuda-9.1 cudart-9.1],, [
+ PKG_CHECK_MODULES([CUDA], [cuda-9.0 cudart-9.0],, [
+ PKG_CHECK_MODULES([CUDA], [cuda-8.0 cudart-8.0],, [
+ PKG_CHECK_MODULES([CUDA], [cuda-7.5 cudart-7.5],, [
+ PKG_CHECK_MODULES([CUDA], [cuda-7.0 cudart-7.0],, [
+ PKG_CHECK_MODULES([CUDA], [cuda-6.5 cudart-6.5],, [
+ AC_MSG_WARN([Could not find cuda headers/libraries])])])])])])])
fi
HAVE_CUDA_H=no
HAVE_CUDART_H=no
+ HAVE_CUDA_DYN_H=no
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CUDA_CFLAGS $save_CPPFLAGS "
+ AC_CHECK_HEADER([dynlink_cuda.h], [HAVE_CUDA_DYN_H=yes],
+ AC_MSG_WARN([Could not find dynlink_cuda.h]))
AC_CHECK_HEADER([cuda.h], [HAVE_CUDA_H=yes],
AC_MSG_WARN([Could not find cuda.h]))
AC_CHECK_HEADER([cuda_runtime_api.h], [HAVE_CUDART_H=yes],
@@ -974,10 +979,14 @@ dnl *** NVDEC ***
translit(dnm, m, l) AM_CONDITIONAL(USE_NVDEC, true)
AG_GST_CHECK_FEATURE(NVDEC, [nvdec], nvdec, [
HAVE_NVCUVID_H=no
+ HAVE_NCUVID_DYN_H=no
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CUDA_CFLAGS $save_CPPFLAGS"
AC_CHECK_HEADER([nvcuvid.h], [HAVE_NVCUVID_H=yes],
AC_MSG_WARN([Could not find nvcuvid.h]))
+ AC_CHECK_HEADER([dynlink_nvcuvid.h], [HAVE_NVCUVID_DYN_H=yes],
+ AC_MSG_WARN([Could not find dynlink_nvcuvid.h]))
+
CPPFLAGS=$save_CPPFLAGS
HAVE_NVCUVID=no
@@ -987,7 +996,12 @@ AG_GST_CHECK_FEATURE(NVDEC, [nvdec], nvdec, [
AC_MSG_WARN([Could not find library nvcuvid]))
LIBS="$save_LIBS"
- if test "x$HAVE_NVCUVID_H" = "xyes" -a "x$HAVE_NVCUVID" = "xyes"; then
+ AM_CONDITIONAL(USE_DYNLINK_NVDEC, false)
+ if test "x$HAVE_NVCUVID_DYN_H" = "xyes" -a "x$HAVE_NVCUVID" = "xyes"; then
+ HAVE_NVDEC=yes
+ AM_CONDITIONAL(USE_DYNLINK_NVDEC, true)
+ AC_DEFINE(HAVE_DYNLINK_HEADERS_NVDEC, 1, [Define if dynlink headers for nvdec are available])
+ elif test "x$HAVE_NVCUVID_H" = "xyes" -a "x$HAVE_NVCUVID" = "xyes"; then
HAVE_NVDEC=yes
else
HAVE_NVDEC=no