Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied #9662

Closed
1 of 2 tasks
IvensaMDH opened this issue Feb 20, 2023 · 7 comments
Closed
1 of 2 tasks

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied #9662

IvensaMDH opened this issue Feb 20, 2023 · 7 comments

Comments

@IvensaMDH
Copy link

IvensaMDH commented Feb 20, 2023

Version

1.1.2.0

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.83.1

Distro Version

Ubuntu 22.04

Other Software

Docker Desktop 4.16.3
Intel driver 31.0.101.4091

Repro Steps

Trying to follow the examples given in https://devblogs.microsoft.com/commandline/d3d12-gpu-video-acceleration-in-the-windows-subsystem-for-linux-now-available/ and https://github.com/microsoft/wslg/blob/main/samples/container/Containers.md#containerized-applications-access-to-vgpu-accelerated-video I am getting the below error when running the example:

gst-launch-1.0 -v videotestsrc num-buffers=250 ! video/x-raw,width=1920,height=1200 ! vaapipostproc ! vaapih264enc ! filesink location=~/wsl_test.h264

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
and
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument

Setting sudo chmod 666 /dev/dri/* as suggested in #9523 (comment) does not help

Output of vainfo --display drm --device /dev/dri/card0:

libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'd3d12'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 23.1.0-devel for D3D12 (Intel(R) UHD Graphics)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Expected Behavior

Expected the example pipeline to run encoding using vaapi as described in the blog post

Actual Behavior

Pipeline crashes when running the command:

gst-launch-1.0 -v videotestsrc num-buffers=250 ! video/x-raw,width=1920,height=1200 ! vaapipostproc ! vaapih264enc ! filesink location=~/wsl_test.h264

Diagnostic Logs

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'vaapiencodeh264-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm2", gst.vaapi.Display.GObject=(GstObject)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm2";
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:sink: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument
D3D12: Removing Device.
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
@elsaco
Copy link

elsaco commented Feb 20, 2023

@IvensaMDH are you running the command in a Docker container? It seems to work when using a WSL distro:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'vaapiencodeh264-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1", gst.vaapi.Display.GObject=(GstObject)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1";
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:sink: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)constrained-baseline, level=(string)5, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)constrained-baseline, level=(string)5, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
Got EOS from element "pipeline0".
Execution ended after 0:00:02.783985754
Setting pipeline to NULL ...
Freeing pipeline ...

Ignore the DRM_IOCTL_MODE_CREATE_DUMB. Looking at your log there's D3D12: Removing Device. I didn't notice such message when I run the command.

@IvensaMDH
Copy link
Author

IvensaMDH commented Feb 20, 2023

@IvensaMDH are you running the command in a Docker container? It seems to work when using a WSL distro:

Ignore the DRM_IOCTL_MODE_CREATE_DUMB. Looking at your log there's D3D12: Removing Device. I didn't notice such message when I run the command.

Yes - the issue is present when running directly in WSL as well as in docker.

Below log with GST_DEBUG=2 - however the error seems vaapi related and not gstreamer:

gst-launch-1.0 -v videotestsrc num-buffers=250 ! video/x-raw,width=1920,height=1200 ! vaapipostproc ! vaapih264enc ! filesink location=~/wsl_test.h264

Setting pipeline to PAUSED ...
0:00:01.702460003  5445 0x5605404dea90 WARN                   vaapi gstvaapiutils.c:78:gst_vaapi_warning: /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so init failed
0:00:01.703716161  5445 0x5605404dea90 WARN                   vaapi gstvaapiutils.c:78:gst_vaapi_warning: /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so init failed
0:00:01.704832207  5445 0x5605404dea90 WARN                   vaapi gstvaapiutils.c:78:gst_vaapi_warning: /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so init failed
Pipeline is PREROLLING ...
Got context from element 'vaapiencodeh264-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1", gst.vaapi.Display.GObject=(GstObject)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1";
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
0:00:02.249309149  5445 0x560540af3d20 WARN             vaapifilter gstvaapifilter.c:2393:gst_vaapi_filter_set_colorimetry_unlocked:<vaapifilter1> driver does not support 'bt709' input colorimetry. vpp may fail or produce unexpected results.
0:00:02.249337857  5445 0x560540af3d20 WARN             vaapifilter gstvaapifilter.c:2403:gst_vaapi_filter_set_colorimetry_unlocked:<vaapifilter1> driver does not support 'bt709' output colorimetry. vpp may fail or produce unexpected results.
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:sink: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)P010_10LE, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
D3D12: Removing Device.
0:00:02.411503543  5445 0x560540af3d20 ERROR                  vaapi gstvaapiencoder.c:348:gst_vaapi_encoder_encode_and_queue: failed to encode frame (status = -1)
0:00:02.411532558  5445 0x560540af3d20 ERROR            vaapiencode gstvaapiencode.c:694:gst_vaapiencode_handle_frame: failed to encode frame 0 (status -1)
0:00:02.411560935  5445 0x560540af3d20 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<videotestsrc0> error: Internal data stream error.
0:00:02.411605953  5445 0x560540af3d20 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<videotestsrc0> error: streaming stopped, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

EDIT: Getting below error from LIBVA_TRACE. See attachment trace.log

[59220.796644][ctx       none]=========vaUnmapBuffer ret = VA_STATUS_SUCCESS, success (no error) 
[59220.796730][ctx       none]=========vaRenderPicture ret = VA_STATUS_ERROR_ALLOCATION_FAILED, resource allocation failed 
[59220.796759][ctx       none]=========vaDestroyBuffer
 ret = VA_STATUS_SUCCESS, success (no error) 
[59220.796760][ctx       none]=========vaDestroyBuffer ret = VA_STATUS_SUCCESS, success (no error) 
[59220.796760][ctx       none]=========vaDestroyBuffer ret = VA_STATUS_SUCCESS, success (no error) 

@elsaco
Copy link

elsaco commented Feb 20, 2023

This is the vainfo output on my system using an Nvidia card:

[tux@RIPPER ~]$ vainfo --display drm --device /dev/dri/card0
Trying display: drm
Xlib:  extension "DRI2" missing on display ":0".
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.4 for D3D12 (NVIDIA RTX A4000)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Could be driver issue!

DRM device info:

[tux@RIPPER ~]$ drmdevice
--- Checking the number of DRM device available ---
--- Devices reported 2 ---
--- Retrieving devices information (PCI device revision is ignored) ---
device[0]
+-> available_nodes 0x01
+-> nodes
|   +-> nodes[0] /dev/dri/card1
+-> bustype 0002
|   +-> platform
|       +-> fullname    vkms
+-> deviceinfo
    +-> platform
        +-> compatible
                    vkms

--- Opening device node /dev/dri/card1 ---
--- Retrieving device info, for node /dev/dri/card1 ---
device[0]
+-> available_nodes 0x01
+-> nodes
|   +-> nodes[0] /dev/dri/card1
+-> bustype 0002
|   +-> platform
|       +-> fullname    vkms
+-> deviceinfo
    +-> platform
        +-> compatible
                    vkms

device[1]
+-> available_nodes 0x05
+-> nodes
|   +-> nodes[0] /dev/dri/card0
|   +-> nodes[2] /dev/dri/renderD128
+-> bustype 0002
|   +-> platform
|       +-> fullname    vgem
+-> deviceinfo
    +-> platform
        +-> compatible
                    vgem

--- Opening device node /dev/dri/card0 ---
--- Retrieving device info, for node /dev/dri/card0 ---
device[1]
+-> available_nodes 0x05
+-> nodes
|   +-> nodes[0] /dev/dri/card0
|   +-> nodes[2] /dev/dri/renderD128
+-> bustype 0002
|   +-> platform
|       +-> fullname    vgem
+-> deviceinfo
    +-> platform
        +-> compatible
                    vgem

--- Opening device node /dev/dri/renderD128 ---
--- Retrieving device info, for node /dev/dri/renderD128 ---
device[1]
+-> available_nodes 0x05
+-> nodes
|   +-> nodes[0] /dev/dri/card0
|   +-> nodes[2] /dev/dri/renderD128
+-> bustype 0002
|   +-> platform
|       +-> fullname    vgem
+-> deviceinfo
    +-> platform
        +-> compatible
                    vgem

@IvensaMDH
Copy link
Author

Indeed a driver issue... I downgraded from Mesa Gallium driver 23.1.0-devel for D3D12 to 22.2.5:

gst-launch-1.0 -v videotestsrc num-buffers=250 ! video/x-raw,width=1920,height=1200 ! vaapipostproc ! vaapih264enc ! filesink location=~/wsl_test.h264

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'vaapiencodeh264-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1", gst.vaapi.Display.GObject=(GstObject)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1";
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = video/x-raw(memory:VASurface), width=(int)1920, height=(int)1200, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, chroma-site=(string)mpeg2, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)constrained-baseline, level=(string)5, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)constrained-baseline, level=(string)5, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:02.333357656
Setting pipeline to NULL ...
Freeing pipeline ...

Still getting the weird KMS errors - but it seems to be "working" anyway - also in docker with 22.5.
Is there any way to disable the KMS error logging?

Thanks!

@SuperMitic
Copy link

I'm getting the same problem. I have RX 6600 AMD with latest 23.3.1 driver. Vainfo works, but then trying to encode and decode with gstreamer is not working.
"vainfo: Driver version: Mesa Gallium driver 23.1.0-devel for D3D12 (AMD Radeon RX 6600)"

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

1 similar comment
Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants