Bug 101183 - Crash in getPhysicalDeviceFeatures/Properties2KHR
Summary: Crash in getPhysicalDeviceFeatures/Properties2KHR
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-25 10:04 UTC by SaschaWillems
Modified: 2017-05-27 14:31 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
relevant part of strace dump before the sigsev (12.34 KB, text/plain)
2017-05-26 19:38 UTC, SaschaWillems
Details

Description SaschaWillems 2017-05-25 10:04:22 UTC
I'm preparing a new release of my Vulkan Hardware Capability viewer that uses vkGetPhysicalDeviceFeatures/Properties2KHR to read out additional features and properties for new extensions (when available) and on my Intel Haswell with a recent MESA version (os is Ubuntu 16.04) calling one of these functions always crashes. 

The function pointers are valid, and running these on other devices/operating systems works fine so this may be a driver related problem.

To support the new feature and property functions I do the following:
- Enable "VK_KHR_get_physical_device_properties2" at instance level
- Get function pointers for both functions:

	pfnGetPhysicalDeviceFeatures2KHR = reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures2KHR>(vkGetInstanceProcAddr(vkInstance, "vkGetPhysicalDeviceFeatures2KHR"));
	pfnGetPhysicalDeviceProperties2KHR = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties2KHR>(vkGetInstanceProcAddr(vkInstance, "vkGetPhysicalDeviceProperties2KHR"));

- Both function pointers are valid
- Read out an extension specific feature/property like this:

	if (extensionSupported(VK_KHX_MULTIVIEW_EXTENSION_NAME)) {
		VkPhysicalDeviceFeatures2KHR deviceFeatures2{};
		VkPhysicalDeviceMultiviewFeaturesKHX multiViewFeatures{};
		multiViewFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX;
		deviceFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
		deviceFeatures2.pNext = &multiViewFeatures;
		pfnGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2);
		features2.push_back(Feature2("multiview", multiViewFeatures.multiview, VK_KHX_MULTIVIEW_EXTENSION_NAME));
		features2.push_back(Feature2("multiviewGeometryShader", multiViewFeatures.multiviewGeometryShader, VK_KHX_MULTIVIEW_EXTENSION_NAME));
		features2.push_back(Feature2("multiviewTessellationShader", multiViewFeatures.multiviewTessellationShader, VK_KHX_MULTIVIEW_EXTENSION_NAME));
	}

This will always crash at pfnGetPhysicalDeviceFeatures2KHR, same for pfnGetPhysicalDeviceProperties2KHR.
Comment 1 SaschaWillems 2017-05-26 19:38:31 UTC
Created attachment 131528 [details]
relevant part of strace dump before the sigsev

I have attached a trace of the sigsev. I'll post-pone the next version of the Vulkan Hardware Capability viewer as I'm not able to catch this and don't just want to disable this on all Intel GPUs for Linux.
Comment 2 Jason Ekstrand 2017-05-27 05:13:23 UTC
A backtrace from GDB would be more useful than strace.

I tried to build it so that I could reproduce but I got this:

vulkanDeviceInfo.hpp:47:35: fatal error: sys/system_properties.h: No such file or directory

Any suggestions?
Comment 3 SaschaWillems 2017-05-27 07:42:33 UTC
That unit should only be included on Android. I've fixed the define, so the application should compile file on Linux now.

Please note that you need to get the "develop" (https://github.com/SaschaWillems/VulkanCapsViewer/tree/develop) branch as I haven't merged this functionality into master yet.

Thanks for looking into this. I've tried everything available and I'm still not 100% sure if this not an application bug.
Comment 4 SaschaWillems 2017-05-27 07:48:47 UTC
I'm using this PPA: https://launchpad.net/~paulo-miguel-dias/+archive/ubuntu/mesa which is build from git

Version is 17.2.0-devel
Platform is Intel Ivybrdige, not Haswell (as I wrote in my initial post)
Comment 5 SaschaWillems 2017-05-27 09:40:16 UTC
Sorry, looks like this was my fault. Recent LunarG SDKs no longer copy binaries to the system locations and as such I still had a very old libvulkan.so that seemed to cause the crash. Manually installing a recent libvulkan.so got it working.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.