Discussion:
gstreamer-vaapi
Nick Kallen
2017-01-17 16:06:08 UTC
Permalink
Hi,

I’m trying to get gstreamer-vaapi installed on an Amazon ec2 GPU instance.
When I installed gstreamer on an Ubuntu AMI through apt-get, all gstreamer
decoding and encoding commands gave me an error like 'gstreamer-vaapi
cannot load library’ (I forget the exact error message). vainfo errored
that I didn’t have an x-server running.

I assumed I needed a newer version of gstreamer so I tried to build from
source using cerbero on a redhat AMI. Cerbero built everything successfully
(after I installed yasm by hand). I don’t know how to install the cerbero
generated packages on my system (rpm -i *.rpm seemed to have no effect). If
someone could explain that to me I would appreciate it.

But in any case, I ran 'cerbero shell' and I noticed gstreamer-vaapi was
not automatically installed. I’m having difficulty compiling
gstreamer-vaapi because of missing dependencies and I just have no idea if
I’m on the wrong track to getting this all working together. Can I use
cerbero to compile gstreamer-vaapi? What is the right way to build all of
this together and install it properly on a machine?

Thanks!!
Baby Octopus
2017-01-17 16:12:12 UTC
Permalink
I'm not sure if vaapi has support for addon GPU. It works for Intel's onboard
graphics now. Check if the onboard graphics supports hardware decode/encode

Also, check if vaapi would work on a VM. How would the Intel GMA be shared
across multiple VM on a bare metal hypervisor?

There seem to be many variable :)





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/gstreamer-vaapi-tp4681489p4681490.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
Víctor M. Jáquez L.
2017-01-17 16:43:19 UTC
Permalink
Hi,
I’m trying to get gstreamer-vaapi installed on an Amazon ec2 GPU instance.
When I installed gstreamer on an Ubuntu AMI through apt-get, all gstreamer
decoding and encoding commands gave me an error like 'gstreamer-vaapi
cannot load library’ (I forget the exact error message). vainfo errored
that I didn’t have an x-server running.
The first thing would be to get working vainfo. What kind of GPU does Amazon
provide? VAAPI works well on Intel GPUs and some other GPU using the gallium
drivers.

vainfo should work without an X server running, just it warns about it.

If vainfo doesn't work, which is the most basic libva tool, gstreamer-vaapi
won't work either.

vmjl
I assumed I needed a newer version of gstreamer so I tried to build from
source using cerbero on a redhat AMI. Cerbero built everything successfully
(after I installed yasm by hand). I don’t know how to install the cerbero
generated packages on my system (rpm -i *.rpm seemed to have no effect). If
someone could explain that to me I would appreciate it.
But in any case, I ran 'cerbero shell' and I noticed gstreamer-vaapi was
not automatically installed. I’m having difficulty compiling
gstreamer-vaapi because of missing dependencies and I just have no idea if
I’m on the wrong track to getting this all working together. Can I use
cerbero to compile gstreamer-vaapi? What is the right way to build all of
this together and install it properly on a machine?
Thanks!!
_______________________________________________
gstreamer-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Nick Kallen
2017-01-17 17:38:43 UTC
Permalink
Post by Nick Kallen
I’m trying to get gstreamer-vaapi installed on an Amazon ec2 GPU instance.
When I installed gstreamer on an Ubuntu AMI through apt-get, all gstreamer
decoding and encoding commands gave me an error like 'gstreamer-vaapi
cannot load library’ (I forget the exact error message). vainfo errored
that I didn’t have an x-server running.
The first thing would be to get working vainfo. What kind of GPU does Amazon
provide? VAAPI works well on Intel GPUs and some other GPU using the gallium
drivers.

vainfo should work without an X server running, just it warns about it.

If vainfo doesn't work, which is the most basic libva tool, gstreamer-vaapi
won't work either.


Here is some info about these machines:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html

I naively thought this would be easy. I am clearly in over my head :(

Back to Ubuntu: After install 'apt install vainfo', it coredumps when I run
it.

(gdb) run

Starting program: /usr/bin/vainfo

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

error: can't connect to X server!

error: failed to initialize display


Program received signal SIGABRT, Aborted.

0x00007ffff6cd2428 in __GI_raise (sig=***@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:54

54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

(gdb)


I installed the nvidia drivers successfully FWIW


****@ip-172-31-9-90*:*~*$ nvidia-smi -q | head


==============NVSMI LOG==============


Timestamp : Tue Jan 17 17:36:42 2017

Driver Version : 367.57


Attached GPUs : 1

GPU 0000:00:03.0

Product Name : GRID K520

Product Brand : Grid
Tim Müller
2017-01-17 18:10:32 UTC
Permalink
On Tue, 2017-01-17 at 12:38 -0500, Nick Kallen wrote:

Hi,
Post by Nick Kallen
Post by Nick Kallen
I’m trying to get gstreamer-vaapi installed on an Amazon ec2 GPU
instance.
... (snip) ...
I installed the nvidia drivers successfully FWIW
==============NVSMI LOG==============
Timestamp                           : Tue Jan 17 17:36:42 2017
Driver Version                      : 367.57
Attached GPUs                       : 1
GPU 0000:00:03.0
    Product Name                    : GRID K520
    Product Brand                   : Grid
For encoding you should be able to use the 'nvenc' plugin from gst-
plugins-bad on these machines, once you've downloaded and installed the
nvidia sdk.
Cheers -Tim

-- 
Tim MÃŒller, Centricular Ltd - http://www.centricular.com
Nick Kallen
2017-01-18 10:33:52 UTC
Permalink
Hi Tim,

For encoding you should be able to use the 'nvenc' plugin from
gst-plugins-bad on these machines, once you've downloaded and
installed the nvidia sdk.

I’m sorry if this is a dumb question, but even after following the README
instructions here (
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/nvenc/README )
I can’t find the element nvenc

gst-launch-1.0 rtmpsrc location=rtsp://
wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov ! decodebin !
nvenc

WARNING: erroneous pipeline: no element “nvenc"


But I have gstreamer-plugins-bad installed:


libgstreamer-plugins-bad1.0-0 is already the newest version
(1.8.2-1ubuntu0.2).

libgstreamer-plugins-bad1.0-dev is already the newest version
(1.8.2-1ubuntu0.2).


As far as I can tell, nothing in the sys/ directory of
gstreamer-plugins-bad is available on my ubuntu distribution.


Any suggestions?


Thanks!
Tim Müller
2017-01-18 11:06:13 UTC
Permalink
On Wed, 2017-01-18 at 05:33 -0500, Nick Kallen wrote:

Hi Nick,
Post by Tim Müller
For encoding you should be able to use the 'nvenc' plugin from gst-
plugins-bad on these machines, once you've downloaded and installed
the nvidia sdk.
I’m sorry if this is a dumb question, but even after following the
README instructions here ( https://cgit.freedesktop.org/gstreamer/gst
-plugins-bad/tree/sys/nvenc/README ) I can’t find the element nvenc
gst-launch-1.0 rtmpsrc
location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k
.mov ! decodebin ! nvenc
WARNING: erroneous pipeline: no element “nvenc"
libgstreamer-plugins-bad1.0-0 is already the newest version (1.8.2-
1ubuntu0.2).
libgstreamer-plugins-bad1.0-dev is already the newest version (1.8.2-
1ubuntu0.2).
As far as I can tell, nothing in the sys/ directory of gstreamer-
plugins-bad is available on my ubuntu distribution.
Yes, ubuntu doesn't ship the nvenc plugin by default (they can't
because it needs to be compiled against the nvidia headers + libs which
are not FLOSS software).

So you'd have to compile gst-plugins-bad yourself - it's enough to
configure it and then cd sys/nvenc; make; make install in there - no
need for all the other plugins.

Then by default the plugin will be installed into a different prefix,
so you either need to copy it into /usr/lib/../gstreamer-1.0/ manually
or set the GST_PLUGIN_PATH variable to where it was installed, so that
GStreamer finds it.

It's a bit fiddly I'm afraid, but I can assure you it'll work :)

Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
Nick Kallen
2017-01-18 12:34:29 UTC
Permalink
Hi

So you'd have to compile gst-plugins-bad yourself - it's enough to
configure it and then cd sys/nvenc; make; make install in there - no
need for all the other plugins.

Then by default the plugin will be installed into a different prefix,
so you either need to copy it into /usr/lib/../gstreamer-1.0/ manually
or set the GST_PLUGIN_PATH variable to where it was installed, so that
GStreamer finds it.

I’m stuck again, sorry :( . I configured with the nvidia libraries:

LDFLAGS="-L/usr/lib/nvidia-367" ./*configure*
--with-cuda-prefix='/usr/local/cuda’


But building nvenc fails when it tries to make the gl module. Here is the
error when I try to make gl directly:


*~/gst-plugins-bad-1.8.3/gst-libs/gst/gl*$ make

Making all in glprototypes

make[1]: Entering directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/glprototypes'

make[1]: Nothing to be done for 'all'.

make[1]: Leaving directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/glprototypes'

Making all in x11

make[1]: Entering directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/x11'

make[1]: Nothing to be done for 'all'.

make[1]: Leaving directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/x11'

make[1]: Entering directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl'

CC libgstgl_1.0_la-gstglcontext.lo

*gstglcontext.c:* In function ‘*gst_gl_context_get_current_gl_api*’:

*gstglcontext.c:607:22:* *error: *‘*GL_CONTEXT_PROFILE_MASK*’ undeclared
(first use in this function)

GetIntegerv (GL_CONTEXT_PROFILE_MASK, &context_flags);

* ^*

*gstglcontext.c:607:22:* *note: *each undeclared identifier is reported
only once for each function it appears in

*gstglcontext.c:608:29:* *error: *‘*GL_CONTEXT_CORE_PROFILE_BIT*’
undeclared (first use in this function)

if (context_flags & GL_CONTEXT_CORE_PROFILE_BIT)

* ^*

*gstglcontext.c:610:29:* *error: *‘*GL_CONTEXT_COMPATIBILITY_PROFILE_BIT*’
undeclared (first use in this function)

if (context_flags & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)

* ^*

*gstglcontext.c:* In function ‘*_create_context_info*’:

*gstglcontext.c:990:23:* *error: *‘*GL_SHADING_LANGUAGE_VERSION*’
undeclared (first use in this function)

if (!gl->GetString (GL_SHADING_LANGUAGE_VERSION)) {

* ^*

Makefile:1125: recipe for target 'libgstgl_1.0_la-gstglcontext.lo' failed

make[1]: *** [libgstgl_1.0_la-gstglcontext.lo] Error 1

make[1]: Leaving directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl'

Makefile:1403: recipe for target 'all-recursive' failed

make: *** [all-recursive] Error 1


For what it’s worth, there is a libGL.so in the /usr/lib/nvidia-367
Nick Kallen
2017-01-18 14:46:09 UTC
Permalink
Hi,

I miraculously got it to compile, replacing everywhere it said

# include <GL/gl.h>

with

# include <GL/gl.h>
# include <GL/glext.h>

"sudo make install" put the libraries in /usr/local/lib/gstreamer-1.0

however, simply copying the files libgstnvenc.la libgstnvenc.so into
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/
or /usr/lib/x86_64-linux-gnu doesn’t seem to install the plugin:

gst-launch-1.0 fakesrc ! nvenc


WARNING: erroneous pipeline: no element "nvenc"

On January 18, 2017 at 1:34:29 PM, Nick Kallen (
***@gmail.com) wrote:

Hi

So you'd have to compile gst-plugins-bad yourself - it's enough to
configure it and then cd sys/nvenc; make; make install in there - no
need for all the other plugins.

Then by default the plugin will be installed into a different prefix,
so you either need to copy it into /usr/lib/../gstreamer-1.0/ manually
or set the GST_PLUGIN_PATH variable to where it was installed, so that
GStreamer finds it.

I’m stuck again, sorry :( . I configured with the nvidia libraries:

LDFLAGS="-L/usr/lib/nvidia-367" ./*configure*
--with-cuda-prefix='/usr/local/cuda’


But building nvenc fails when it tries to make the gl module. Here is the
error when I try to make gl directly:


*~/gst-plugins-bad-1.8.3/gst-libs/gst/gl*$ make

Making all in glprototypes

make[1]: Entering directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/glprototypes'

make[1]: Nothing to be done for 'all'.

make[1]: Leaving directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/glprototypes'

Making all in x11

make[1]: Entering directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/x11'

make[1]: Nothing to be done for 'all'.

make[1]: Leaving directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl/x11'

make[1]: Entering directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl'

CC libgstgl_1.0_la-gstglcontext.lo

*gstglcontext.c:* In function ‘*gst_gl_context_get_current_gl_api*’:

*gstglcontext.c:607:22:* *error:* ‘*GL_CONTEXT_PROFILE_MASK*’ undeclared
(first use in this function)

GetIntegerv (GL_CONTEXT_PROFILE_MASK, &context_flags);

* ^*

*gstglcontext.c:607:22:* *note:* each undeclared identifier is reported
only once for each function it appears in

*gstglcontext.c:608:29:* *error:* ‘*GL_CONTEXT_CORE_PROFILE_BIT*’
undeclared (first use in this function)

if (context_flags & GL_CONTEXT_CORE_PROFILE_BIT)

* ^*

*gstglcontext.c:610:29:* *error:* ‘*GL_CONTEXT_COMPATIBILITY_PROFILE_BIT*’
undeclared (first use in this function)

if (context_flags & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)

* ^*

*gstglcontext.c:* In function ‘*_create_context_info*’:

*gstglcontext.c:990:23:* *error:* ‘*GL_SHADING_LANGUAGE_VERSION*’
undeclared (first use in this function)

if (!gl->GetString (GL_SHADING_LANGUAGE_VERSION)) {

* ^*

Makefile:1125: recipe for target 'libgstgl_1.0_la-gstglcontext.lo' failed

make[1]: *** [libgstgl_1.0_la-gstglcontext.lo] Error 1

make[1]: Leaving directory
'/home/ubuntu/gst-plugins-bad-1.8.3/gst-libs/gst/gl'

Makefile:1403: recipe for target 'all-recursive' failed

make: *** [all-recursive] Error 1


For what it’s worth, there is a libGL.so in the /usr/lib/nvidia-367
Tim Müller
2017-01-18 14:48:49 UTC
Permalink
however, simply copying the files libgstnvenc.la  libgstnvenc.so
into /usr/lib/x86_64-linux-gnu/gstreamer-1.0/ or /usr/lib/x86_64-
gst-launch-1.0 fakesrc ! nvenc
WARNING: erroneous pipeline: no element "nvenc"
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/ is the right directory, and
you just need to copy the .so file.

Start by running gst-inspect-1.0 on the .so file with the absolute
path, i.e.

gst-inspect-1.0 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvenc.so

and see what it says.

Cheers
-Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
Nick Kallen
2017-01-18 14:50:08 UTC
Permalink
On January 18, 2017 at 3:48:52 PM, Tim MÃŒller (***@centricular.com) wrote:


Start by running gst-inspect-1.0 on the .so file with the absolute
path, i.e.

gst-inspect-1.0 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvenc.so

and see what it says.


****@ip-172-31-9-90*:*~/gst-plugins-bad-1.8.3/sys/nvenc*$
gst-inspect-1.0 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvenc.so

Plugin Details:

Name nvenc

Description GStreamer NVENC plugin

Filename
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvenc.so

Version 1.8.3

License LGPL

Source module gst-plugins-bad

Source release date 2016-08-19

Binary package GStreamer Bad Plug-ins source release

Origin URL Unknown package origin



0 features:


That doesn’t look good :(
Tim Müller
2017-01-18 14:55:10 UTC
Permalink
Plugin Details:  Name                     nvenc
That doesn’t look good :(
Probably means NvEncodeAPICreateInstance() failed. Might be a case of
driver not being loaded or wrong driver version or something. Or some
incompatibility of the SDK and the distro/version you use. It's all a
bit painful sadly, the joy of proprietary hardware drivers.

Cheers
 -Tim


-- 
Tim MÃŒller, Centricular Ltd - http://www.centricular.com

Nick Kallen
2017-01-17 14:20:10 UTC
Permalink
Hi,

I’m trying to get gstreamer-vaapi installed on an Amazon ec2 GPU instance. When I installed gstreamer on an Ubuntu AMI through apt-get, all gstreamer decoding and encoding commands gave me an error like 'gstreamer-vaapi cannot find source’ (I forget the exact error message). vainfo errored that I didn’t have an x-server installed.

I assumed I needed a newer version of gstreamer so I tried to build from source using cerbero on a redhat enterprise AMI. Cerbero built everything successfully (after I installed yasm by hand). I don’t know how to install the generated packages on my system (rpm -i *.rpm seemed to have no effect). If someone could explain that to me I would appreciate it.

But in any case, I ran 'cerbero shell' and I noticed gstreamer-vaapi was not automatically installed. I’m having difficulty compiling gstreamer-vaapi because of missing dependencies and I just have no idea if I’m on the wrong track. Can I use cerbero to compile gstreamer-vaapi? What is the right way to build all of this together and install it properly on a machine?

Thanks!!
Loading...