GNOME Bugzilla – Bug 772688
nvenc does not build on Ubuntu 16.04
Last modified: 2018-11-03 13:56:00 UTC
Installed distro nvidia-cuda-dev (7.5.18-0ubuntu1) Copied Video_Codec_SDK_7.0.1 headers into /usr/local/include libnvidia-encode is provided by nvidia-361: /usr/lib/nvidia-361/libnvidia-encode.so.361.42 LDFLAGS="-L/usr/lib/nvidia-361/" ./configure --disable-gtk-doc --disable-opencv --with-cuda-prefix="/usr" Compiles but zero feature $ gst-inspect-1.0 nvenc Plugin Details: Name nvenc Description GStreamer NVENC plugin Filename /home/ubicast/gst/master/gst-plugins-bad/sys/nvenc/.libs/libgstnvenc.so Version 1.9.90 License LGPL Source module gst-plugins-bad Source release date 2016-09-30 Binary package GStreamer Bad Plug-ins source release Origin URL Unknown package origin 0 features:
Indeed the nvidia video encoding sdk 7.0.1 requires 367.35 or newer
It does work with SDK6 but custom paths have to be provided for Ubuntu. It may be nicer if NVENCODE_LIBS was looking into /usr/lib/nvidia-361/ and CUDA should also be looked into /usr (which seems to be ubuntu-specific apparently) NVENCODE_CFLAGS="-I/home/ubicast/src/nvidia_video_sdk_6.0.1/Samples/common/inc" NVENCODE_LIBS="-L/usr/lib/nvidia-361/" ./configure --disable-gtk-doc --with-cuda-prefix="/usr"
Actually i tried to reproduce on a fresh 16.04 install, but i still get a build error: * install fresh Ubuntu 16.04.1 * install the nvidia-361, nvidia-cuda-dev packages and misc packages: apt-get install nvidia-cuda-dev nvidia-361 git pkg-config bison flex * install the gst plugins bad build deps: apt-get build-deps gstreamer1.0-plugins-base gstreamer1.0-plugins-bad * download the 6.0 version of the nvidia video codec sdk (into ~/src in the example below), unzip the sdk * build a gst-uninstalled environment (compile gstreamer, gst-plugins-base) * compile gst-plugins-bad with: NVENCODE_CFLAGS="-I/home/user/src/nvidia_video_sdk_6.0.1/Samples/common/inc" NVENCODE_LIBS="-L/usr/lib/nvidia-361/" ./autogen.sh --disable-gtk-doc --with-cuda-prefix="/usr" && make make: Entering directory '/home/ubicast/gst/master/gst-plugins-bad/sys/nvenc' CC libgstnvenc_la-gstnvbaseenc.lo In file included from ../../gst-libs/gst/gl/gstgl_fwd.h:26:0, from ../../gst-libs/gst/gl/gl.h:29, from gstnvbaseenc.c:34: ../../gst-libs/gst/gl/glprototypes/eglimage.h:49:23: error: unknown type name ‘GLeglImageOES’ GLeglImageOES image)) ^ ../../gst-libs/gst/gl/gstglapi.h:161:24: note: in definition of macro ‘GST_GL_EXT_FUNCTION’ ret (GSTGLAPI *name) args; ^ ../../gst-libs/gst/gl/glprototypes/eglimage.h:52:23: error: unknown type name ‘GLeglImageOES’ GLeglImageOES image)) ^ ../../gst-libs/gst/gl/gstglapi.h:161:24: note: in definition of macro ‘GST_GL_EXT_FUNCTION’ ret (GSTGLAPI *name) args; ^ NB: Adding --disable-egl does not help
I could work around it by not defining NVENCODE_CFLAGS but copying the SDK header files into /usr/local/include instead cp ~/src/nvidia_video_sdk_6.0.1/Samples/common/inc/ /usr/local/include/ NVENCODE_LIBS="-L/usr/lib/nvidia-361/" ./configure --disable-gtk-doc --with-cuda-prefix="/usr" make -C sys/nvench I think there may be something wrong with NVENCODE_CFLAGS
What's the differences between the resulting gst-libs/gst/gl/gstglconfig.h between the working and non-working invocations? Also, the differences between the two config.log's?
The 2 gstglconfig.h files are exactly identical cmdline 1 (failure.log): $ NVENCODE_CFLAGS="-I/home/ubicast/src/nvidia_video_sdk_6.0.1/Samples/common/inc" NVENCODE_LIBS="-L/usr/lib/nvidia-361/" ./configure --disable-gtk-doc --with-cuda-prefix="/usr" && make -j8 cmdline 2 (success.log -- requires copying header files) cp ~/src/nvidia_video_sdk_6.0.1/Samples/common/inc/ /usr/local/include/ $ NVENCODE_LIBS="-L/usr/lib/nvidia-361/" ./configure --disable-gtk-doc --with-cuda-prefix="/usr" && make -j8 config.log diff: $ $ diff --suppress-common-lines -W230 -y config_failure.log config_success.log /tmp/ccVnUV6Q.o: In function `main': | /tmp/cckdGkjx.o: In function `main': /tmp/ccEhJBoV.o: In function `main': | /tmp/cct5xIMB.o: In function `main': /tmp/cc5CLVe0.o: In function `main': | /tmp/cc24ltPJ.o: In function `main': configure:39067: gcc -c -g -O2 -I/home/ubicast/src/nvidia_video_sdk_6.0.1/Samples/common/inc conftest.c >&5 | configure:39067: gcc -c -g -O2 conftest.c >&5 configure:39067: gcc -E -I/home/ubicast/src/nvidia_video_sdk_6.0.1/Samples/common/inc conftest.c | configure:39067: gcc -E conftest.c configure:39078: gcc -E -I/home/ubicast/src/nvidia_video_sdk_6.0.1/Samples/common/inc conftest.c | configure:39078: gcc -E conftest.c /tmp/ccOUjKAM.o: In function `main': | /tmp/ccAKvFDp.o: In function `main': > config.status:2799: config.h is unchanged ac_cv_env_NVENCODE_CFLAGS_set=set | ac_cv_env_NVENCODE_CFLAGS_set= ac_cv_env_NVENCODE_CFLAGS_value=-I/home/ubicast/src/nvidia_video_sdk_6.0.1/Samples/common/inc | ac_cv_env_NVENCODE_CFLAGS_value= NVENCODE_CFLAGS='-I/home/ubicast/src/nvidia_video_sdk_6.0.1/Samples/common/inc' | NVENCODE_CFLAGS=''
Created attachment 337999 [details] config_success.log
Created attachment 338000 [details] config_failure.log
These config.logs both pick up the correct headers. The only thing I can think of is that there's another set of OpenGL headers around that are being picked up instead of the mesa provided ones. Can you check if that is the case?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/431.