[Bug 785085] New: multiple vaapi encoding pipelines on radeonsi segfault

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Jul 18 20:20:49 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=785085

            Bug ID: 785085
           Summary: multiple vaapi encoding pipelines on radeonsi segfault
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gstreamer-vaapi
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: rataj28 at gmail.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
                CC: bsreerenj at gmail.com, vjaquez at igalia.com
     GNOME version: ---

Created attachment 355885
  --> https://bugzilla.gnome.org/attachment.cgi?id=355885&action=edit
simple test app

Hello,

I am writing and application which creates up to 12 encoding pipelines using
vaapih264enc. It is working fine on Intel with i965 driver, but it is
segfaulting on AMD using mesa gallium radeonsi driver. 

I have attached simple testcase application which simply start multiple
pipelines using gst_parse_launch:

pipelines[i] = gst_parse_launch("videotestsrc is-live=true !
video/x-raw,width=1280,height=1024,framerate=20/1 ! vaapih264enc ! testsink",
&error);

I am able to run up to 6 pipelines with very unstable operation. When used with
single pipeline per process I am able to run up to 16 pipelines until I get:

[ 6791.275650] [drm:radeon_vce_cs_parse [radeon]] *ERROR* No more free VCE
handles!
[ 6791.277803] [drm:radeon_cs_ioctl [radeon]] *ERROR* Invalid command stream !

When more then 6 pipelines are run as a single process it ends with segfault:

Thread 48 "videotestsrc7:s" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffad424700 (LWP 4962)]
0x00007fffee44ae6d in vlVaEndPicture (ctx=<optimized out>,
context_id=<optimized out>) at picture.c:596
596          context->decoder->encode_bitstream(context->decoder,
context->target,
(gdb) backtrace 
#0  0x00007fffee44ae6d in vlVaEndPicture (ctx=<optimized out>,
context_id=<optimized out>) at picture.c:596
#1  0x00007ffff238aeaf in vaEndPicture () at
/usr/lib/x86_64-linux-gnu/libva.so.1
#2  0x00007ffff2c62039 in gst_vaapi_enc_picture_encode
(picture=picture at entry=0x7fff9c1fa320) at gstvaapiencoder_objects.c:581
#3  0x00007ffff2c5bf08 in gst_vaapi_encoder_h264_encode
(base_encoder=<optimized out>, picture=0x7fff9c1fa320, codedbuf=<optimized
out>) at gstvaapiencoder_h264.c:2581
#4  0x00007ffff2c529c9 in gst_vaapi_encoder_put_frame (encoder=0x555555ab2e60,
frame=<optimized out>, frame at entry=0x7fff9c1fa0c0)
    at gstvaapiencoder.c:407
#5  0x00007ffff2c23eca in gst_vaapiencode_handle_frame (venc=0x5555559696e0
[GstVaapiEncodeH264], frame=0x7fff9c1fa0c0)
    at gstvaapiencode.c:643
#6  0x00007ffff477fc1f in gst_video_encoder_chain (pad=<optimized out>,
parent=<optimized out>, buf=<optimized out>)
    at gstvideoencoder.c:1438
#7  0x00007ffff7465f52 in gst_pad_chain_data_unchecked (data=0x7fff9c0188f0,
type=4112, pad=0x555555969bf0 [GstPad]) at gstpad.c:4205
#8  0x00007ffff7465f52 in gst_pad_push_data (pad=pad at entry=0x55555596cc30
[GstPad], type=type at entry=4112, data=<optimized out>, 
    data at entry=0x7fff9c0188f0) at gstpad.c:4457
#9  0x00007ffff746e3e2 in gst_pad_push (pad=0x55555596cc30 [GstPad],
buffer=0x7fff9c0188f0) at gstpad.c:4576
#10 0x00007ffff5c0b1fa in gst_base_transform_chain (pad=<optimized out>,
parent=<optimized out>, buffer=<optimized out>)
    at gstbasetransform.c:2312
#11 0x00007ffff7465f52 in gst_pad_chain_data_unchecked (data=0x7fff9c0188f0,
type=4112, pad=0x55555596c810 [GstPad]) at gstpad.c:4205
#12 0x00007ffff7465f52 in gst_pad_push_data (pad=pad at entry=0x555555968ff0
[GstPad], type=type at entry=4112, data=<optimized out>, 
    data at entry=0x7fff9c0188f0) at gstpad.c:4457
#13 0x00007ffff746e3e2 in gst_pad_push (pad=pad at entry=0x555555968ff0 [GstPad],
buffer=0x7fff9c0188f0) at gstpad.c:4576
#14 0x00007ffff5c04275 in gst_base_src_loop (pad=0x555555968ff0 [GstPad]) at
gstbasesrc.c:2913
#15 0x00007ffff7499551 in gst_task_func (task=0x555555ab3b70 [GstTask]) at
gsttask.c:332
#16 0x00007ffff6f19eee in g_thread_pool_thread_proxy (data=<optimized out>) at
././glib/gthreadpool.c:307
#17 0x00007ffff6f194f5 in g_thread_proxy (data=0x7fffb0017cf0) at
././glib/gthread.c:784
#18 0x00007ffff6c91494 in start_thread (arg=0x7fffad424700) at
pthread_create.c:333
#19 0x00007ffff6137a8f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:97

I am using latest mesa from git master.

libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'radeonsi'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: mesa gallium vaapi
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileNone                   :    VAEntrypointVideoProc

Thanks. Tomas

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list