-
Notifications
You must be signed in to change notification settings - Fork 437
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
Segmentation Fault using primusrun on Linux #2546
Comments
Do you get any validation errors if you enable the validation layer? |
Also see next comment. I think these are spurious. I turned on "VK_LAYER_KHRONOS_validation" I get (short version): vkGetPhysicalDeviceProperties2: pProperties->pNext chain includes a structure with unknown VkStructureType, with the following two VkStructureTypes: VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT (1000254002) Full messages: primusrun ./target/debug/triangle List of Vulkan debugging layers available to use: Stack trace: #0 0x00007fffefc0f004 in ?? () from /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0 |
I think those message may be spurious the the crash: If I turn on the layers: "VK_LAYER_KHRONOS_validation","VK_LAYER_PRIMUS_PrimusVK" primusrun ./target/debug/triangle gives the same messages, but then runs correctly. With those same layers, if I then run without the 'primusrun', it fails to find a rendering GPU: ./target/debug/triangle |
Machine also has: Intel(R) HD Graphics 4600 (HSW GT2) (type: IntegratedGpu)
To reproduce the error:
Checkout the master branch from github , build it with 'cargo build' and:
Output:
MESA-INTEL: warning: Haswell Vulkan support is incomplete
Using device: NVIDIA GeForce GT 730M (type: DiscreteGpu)
Segmentation fault
Stack trace:
#0 0x00007fffefc0f004 in ?? () from /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0
#1 0x00007fffee783b31 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.256.02
#2 0x00007fffee7823ea in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.256.02
#3 0x00007fffee7826c8 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.256.02
#4 0x00007fffee78411e in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.256.02
#5 0x00007fffee7789b5 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.256.02
#6 0x00007fffee783fff in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.256.02
#7 0x00007ffff72a189c in ?? () from /usr/lib/x86_64-linux-gnu/libvulkan.so.1
#8 0x000055555600716a in vulkano::swapchain::Swapchain::new_inner_unchecked (device=0x5555571c7880, surface=0x55555690d330, create_info=0x7fffffff80a0,
old_swapchain=...) at vulkano/src/swapchain/mod.rs:1117
#9 0x0000555555709f5f in vulkano::swapchain::Swapchain::new_unchecked (device=..., surface=..., create_info=...) at vulkano/src/swapchain/mod.rs:432
#10 0x000055555570a421 in vulkano::swapchain::Swapchain::new (device=..., surface=..., create_info=...) at vulkano/src/swapchain/mod.rs:421
#11 0x000055555578654b in triangle::main () at examples/triangle/main.rs:209
print create_info_vk
$1 = ash::vk::definitions::SwapchainCreateInfoKHR {s_type: ash::vk::enums::StructureType (1000001000), p_next: 0x0, flags: ash::vk::bitflags::SwapchainCreateFlagsKHR (0), surface: ash::vk::definitions::SurfaceKHR (93825018532320), min_image_count: 2, image_format: ash::vk::enums::Format (44), image_color_space: ash::vk::enums::ColorSpaceKHR (0), image_extent: ash::vk::definitions::Extent2D {width: 800, height: 600}, image_array_layers: 1, image_usage: ash::vk::bitflags::ImageUsageFlags (16), image_sharing_mode: ash::vk::enums::SharingMode (0), queue_family_index_count: 0, p_queue_family_indices: 0x0, pre_transform: ash::vk::bitflags::SurfaceTransformFlagsKHR (1), composite_alpha: ash::vk::bitflags::CompositeAlphaFlagsKHR (1), present_mode: ash::vk::enums::PresentModeKHR (2), clipped: 1, old_swapchain: ash::vk::definitions::SwapchainKHR (0), _marker: core::marker::PhantomData<&()>}
SurfaceKHR (93825018532320) is SurfaceKHR (0x555556e691e0)
For comparison, it does work correctly on the internal Intel(R) HD Graphics 4600 (HSW GT2). With break mod.rs:1117:
print create_info_vk
$1 = ash::vk::definitions::SwapchainCreateInfoKHR {s_type: ash::vk::enums::StructureType (1000001000), p_next: 0x0, flags: ash::vk::bitflags::SwapchainCreateFlagsKHR (0), surface: ash::vk::definitions::SurfaceKHR (93825014261712), min_image_count: 3, image_format: ash::vk::enums::Format (50), image_color_space: ash::vk::enums::ColorSpaceKHR (0), image_extent: ash::vk::definitions::Extent2D {width: 800, height: 600}, image_array_layers: 1, image_usage: ash::vk::bitflags::ImageUsageFlags (16), image_sharing_mode: ash::vk::enums::SharingMode (0), queue_family_index_count: 0, p_queue_family_indices: 0x0, pre_transform: ash::vk::bitflags::SurfaceTransformFlagsKHR (1), composite_alpha: ash::vk::bitflags::CompositeAlphaFlagsKHR (1), present_mode: ash::vk::enums::PresentModeKHR (2), clipped: 1, old_swapchain: ash::vk::definitions::SwapchainKHR (0), _marker: core::marker::PhantomData<&()>}
It also works correctly in a C++ implementation with primusrun (so it's not just an Nvidia driver issue):
print createInfo
{sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, pNext = 0x0, flags = 0, surface = 0x20000000002, minImageCount = 4,
imageFormat = VK_FORMAT_B8G8R8A8_SRGB, imageColorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, imageExtent = {width = 1200, height = 800}, imageArrayLayers = 1,
imageUsage = 16, imageSharingMode = VK_SHARING_MODE_EXCLUSIVE, queueFamilyIndexCount = 0, pQueueFamilyIndices = 0x0,
preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, presentMode = VK_PRESENT_MODE_FIFO_KHR,
clipped = 1, oldSwapchain = 0x0}
I can provide any more information that is requested.
I think it's odd that surface is a pointer into main memory in the vulkano version, and a special value in the C++ version - that was the only major difference that I could find (the different minImageCount doesn't matter).
The text was updated successfully, but these errors were encountered: