After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772688 - nvenc does not build on Ubuntu 16.04
nvenc does not build on Ubuntu 16.04
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-10 12:18 UTC by Florent Thiéry
Modified: 2018-11-03 13:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config_success.log (394.58 KB, text/x-log)
2016-10-19 08:55 UTC, Florent Thiéry
Details
config_failure.log (394.83 KB, text/x-log)
2016-10-19 08:55 UTC, Florent Thiéry
Details

Description Florent Thiéry 2016-10-10 12:18:19 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:
Comment 1 Florent Thiéry 2016-10-10 12:27:14 UTC
Indeed the nvidia video encoding sdk 7.0.1 requires 367.35 or newer
Comment 2 Florent Thiéry 2016-10-10 12:37:06 UTC
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"
Comment 3 Florent Thiéry 2016-10-10 22:42:41 UTC
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
Comment 4 Florent Thiéry 2016-10-11 07:47:27 UTC
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
Comment 5 Matthew Waters (ystreet00) 2016-10-19 07:31:10 UTC
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?
Comment 6 Florent Thiéry 2016-10-19 08:54:51 UTC
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=''
Comment 7 Florent Thiéry 2016-10-19 08:55:27 UTC
Created attachment 337999 [details]
config_success.log
Comment 8 Florent Thiéry 2016-10-19 08:55:56 UTC
Created attachment 338000 [details]
config_failure.log
Comment 9 Matthew Waters (ystreet00) 2018-05-06 12:40:02 UTC
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?
Comment 10 GStreamer system administrator 2018-11-03 13:56:00 UTC
-- 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.