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 764545 - Crash when trying to use vulkan sink
Crash when trying to use vulkan sink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.8.0
Other Linux
: Normal normal
: 1.8.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-03 14:43 UTC by Armin K.
Modified: 2016-04-09 10:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Installed files (20.16 KB, text/plain)
2016-04-04 11:33 UTC, Armin K.
Details

Description Armin K. 2016-04-03 14:43:09 UTC
While trying to use vulkan sink from gstreamer 1.8.0 with vulkan 1.0.8 + vulkan intel from git (about a hour ago), I get the following:

$ gst-launch-1.0 videotestsrc ! vulkanupload ! vulkansink
Setting pipeline to PAUSED ...

** (gst-launch-1.0:25006): ERROR **: vkEnumerateInstanceLayerProperties failed to find required validation layer.

Please look at the Getting Started guide for additional information.
vkCreateInstance Failure
Trace/breakpoint trap (core dumped)

Is this a bug in gstreamer code or the vulkan loader itself?
Comment 1 Matthew Waters (ystreet00) 2016-04-03 23:39:56 UTC
Do you have the validation layers installed?

Currently, the sink will not work without them.
Comment 2 Armin K. 2016-04-04 11:33:39 UTC
Created attachment 325322 [details]
Installed files

Well, this is self-built vulkan runtime. I have attached the contents of my package installation directory.

I see there are multiple libVkLayer libraries for both 32 and 64 bit build. I did also notice when running gst-launch with strace, that files from /usr/share/vulkan/explicit_layer.d were picked up, but the gst-launch failed after all the files were opened.
Comment 3 Matthew Waters (ystreet00) 2016-04-04 11:56:54 UTC
From a quick look at that and comparing to https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/vulkan/vkinstance.c#n32 it seems the "VK_LAYER_LUNARG_mem_tracker" validate layer is missing and in it's place is unique_objects.  Of course that list in gstreamer could now be outdated.
Comment 4 Armin K. 2016-04-04 12:39:16 UTC
VkLayer_core_validation.json:        "name": "VK_LAYER_LUNARG_core_validation",
VkLayer_device_limits.json:        "name": "VK_LAYER_LUNARG_device_limits",
VkLayer_image.json:        "name": "VK_LAYER_LUNARG_image",
VkLayer_object_tracker.json:        "name": "VK_LAYER_LUNARG_object_tracker",
VkLayer_parameter_validation.json:        "name": "VK_LAYER_LUNARG_parameter_validation",
VkLayer_swapchain.json:        "name": "VK_LAYER_LUNARG_swapchain",
VkLayer_threading.json:        "name": "VK_LAYER_GOOGLE_threading",
VkLayer_unique_objects.json:        "name": "VK_LAYER_GOOGLE_unique_objects",

These are the layers installed on my system. They were installed from Khronos directly:

https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers
Comment 5 Matthew Waters (ystreet00) 2016-04-08 07:59:13 UTC
commit b3e46052c99dc5833b56a1f55211b61a050bd5a5
Author: Matthew Waters <matthew@centricular.com>
Date:   Fri Apr 8 17:41:07 2016 +1000

    vulkan: don't g_error when failing to find validation layers
    
    Aborting the application is never a good thing to do for recoverable errors.
    
    Just warn and error out instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764545

commit 761171b6d2652cdd0b5b1de43899a224268124f8
Author: Matthew Waters <matthew@centricular.com>
Date:   Fri Apr 8 17:56:50 2016 +1000

    vulkan: only warn on not found layers
    
    don't error out completely
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764545

and 1.8 e3b598aee4b8471039a2a163310d4b5894c994f7
and 1.8 ade60314f6d903fb27235088c24e9258646d1612
Comment 6 Armin K. 2016-04-08 09:36:20 UTC
Even if this may fix the crash by explicitly telling it not to crash, it doesn't fix the entire problem. It won't magically make the plugin work.

Ideally, it should be ported to use validation layers from official Khronos packages instead of something else (I'm guessing LunarG SDK, shipping older validation layers).
Comment 7 Matthew Waters (ystreet00) 2016-04-08 11:48:08 UTC
The validation layers shouldn't affect the actual running of the program.

Regardless, this has also been fixed by https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=cecbcd704b1e93d5a609b6d01b04903198b4e7f8
Comment 8 Armin K. 2016-04-09 09:22:29 UTC
Hmm, the problem could be in something else then.

When testing the plugin with the same command from the original post, on gstreamer-1.8.0 + 2 vulkan patches referenced in Comment 5, I get the following:

$ gst-launch-1.0 videotestsrc ! vulkanupload ! vulkansink
Setting pipeline to PAUSED ...
anv_device.c:425: FINISHME: Get correct values for VkPhysicalDeviceLimits
anv_device.c:425: FINISHME: Get correct values for VkPhysicalDeviceLimits
anv_device.c:425: FINISHME: Get correct values for VkPhysicalDeviceLimits
anv_device.c:425: FINISHME: Get correct values for VkPhysicalDeviceLimits
Pipeline is PREROLLING ...
Got context from element 'vulkansink0': gst.vulkan.instance=context, gst.vulkan.instance=(GstVulkanInstance)"\(GstVulkanInstance\)\ vulkaninstance0";
Got context from element 'vulkansink0': gst.vulkan.display=context, gst.vulkan.display=(GstVulkanDisplay)"\(GstVulkanDisplayXCB\)\ vulkandisplayxcb0";
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): void gst_base_src_loop(GstPad *) (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 9 Matthew Waters (ystreet00) 2016-04-09 09:59:15 UTC
If this is on intel, you need https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=e4377e5c8fd1906bed45b1fe113d5c01a5be1d94 as well.
Comment 10 Armin K. 2016-04-09 10:15:07 UTC
It works now, thanks.