GNOME Bugzilla – Bug 764545
Crash when trying to use vulkan sink
Last modified: 2016-04-09 10:15:07 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?
Do you have the validation layers installed? Currently, the sink will not work without them.
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.
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.
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
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
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).
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
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 ...
If this is on intel, you need https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=e4377e5c8fd1906bed45b1fe113d5c01a5be1d94 as well.
It works now, thanks.