; cargo run --bin quad --features=vulkan # 141
Compiling hal-examples v0.1.0 (/home/cloudhead/src/gfx-rs/gfx/examples)
Finished dev [unoptimized + debuginfo] target(s) in 5.42s
Running `/home/cloudhead/src/gfx-rs/gfx/target/debug/quad`
AdapterInfo { name: "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)", vendor: 32902, device: 16032, device_type: IntegratedGpu }
zsh: segmentation fault (core dumped) cargo run --bin quad --features=vulkan
mesa driver or kernel.vulkaninfo.--release actually works, so this only seems to affect debug builds(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007fc395afc94e in ?? () from /usr/lib/libVkLayer_khronos_validation.so
#2 0x00007fc395a042f2 in ?? () from /usr/lib/libVkLayer_khronos_validation.so
#3 0x00007fc39d9ec2d1 in ?? () from /usr/lib/libvulkan.so.1
#4 0x00007fc39d9ecf6a in ?? () from /usr/lib/libvulkan.so.1
#5 0x00007fc39d9f06f1 in vkCreateDevice () from /usr/lib/libvulkan.so.1
#6 0x000055779dadf59a in ash::vk::InstanceFnV1_0::create_device (
self=0x55779f6ce678, physical_device=..., p_create_info=0x7ffc909bba68,
p_allocator=0x0, p_device=0x7ffc909baea0)
at /home/cloudhead/.cargo/registry/src/github.com-1ecc6299db9ec823/ash-0.29.0/src/vk.rs:984
#7 0x000055779daf80e6 in <ash::instance::Instance as ash::instance::InstanceV1_0>::create_device (self=0x55779f6ce670, physical_device=..., create_info=0x7ffc909bba68,
allocation_callbacks=...)
at /home/cloudhead/.cargo/registry/src/github.com-1ecc6299db9ec823/ash-0.29.0/src/instance.rs:44
#8 0x000055779d73a6c6 in <gfx_backend_vulkan::PhysicalDevice as gfx_hal::adapter::PhysicalDevice<gfx_backend_vulkan::Backend>>::open (self=0x7ffc909bf300, families=...,
requested_features=...) at src/backend/vulkan/src/lib.rs:571
#9 0x000055779d2ae1d6 in gfx_hal::adapter::Adapter<B>::open_with (
self=0x7ffc909bf2d0, count=1, selector=...)
at /home/cloudhead/src/gfx-rs/gfx/src/hal/src/adapter.rs:202
#10 0x000055779d1cf048 in quad::main () at examples/quad/main.rs:145
I see this same issue on very similar configuration (Intel GPU + Arch Linux + started after recent kernel + mesa update).
vkCreateDevice is segfaulting. Enabling API dump layer (from vkconfig) does not print output for that function call before segfault.
I assume this is a Mesa / vulkan-intel bug, arising from a certain combination of parameters used by gfx-backend-vulkan.
Just tested the latest on NV + X11. There are validation errors but it otherwise works:
VALIDATION [VUID-VkWriteDescriptorSet-descriptorType-01403 (0)] : vkUpdateDescriptorSets() failed write update validation for Descriptor Set 0x6 with error: Write update to VkDescriptorSet 0x6 allocated with VkDescriptorSetLayout 0x4 binding #0 failed with error message: Attempted write update to image descriptor failed due to: Descriptor update with descriptorType VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE is being updated with invalid imageLayout VK_IMAGE_LAYOUT_UNDEFINED. Allowed layouts are: VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL. The Vulkan spec states: If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the imageLayout member of each element of pImageInfo must be a member of the list given in Sampled Image or Combined Image Sampler, corresponding to its type (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-01403)
object info: (type: DESCRIPTOR_SET, hndl: 6)
[2019-07-10T13:56:25Z ERROR gfx_backend_vulkan]
VALIDATION [VUID-VkWriteDescriptorSet-descriptorType-01403 (0)] : vkUpdateDescriptorSets() failed write update validation for Descriptor Set 0x6 with error: Write update to VkDescriptorSet 0x6 allocated with VkDescriptorSetLayout 0x4 binding #0 failed with error message: Attempted write update to image descriptor failed due to: Descriptor update with descriptorType VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE is being updated with invalid imageLayout VK_IMAGE_LAYOUT_UNDEFINED. Allowed layouts are: VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL. The Vulkan spec states: If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the imageLayout member of each element of pImageInfo must be a member of the list given in Sampled Image or Combined Image Sampler, corresponding to its type (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-01403)
object info: (type: DESCRIPTOR_SET, hndl: 6)
We should definitely fix those.
This is a bug in vulkan-validation-layers (arch package name), in version 1.1.112-2. Workaround: downgrade vulkan-validation-layers-1.1.107-1.
sudo pacman -U /var/cache/pacman/pkg/vulkan-validation-layers-1.1.107-1-x86_64.pkg.tar.xz
This is not a gfx-rs bug, feel free to close.
I found the upstream bug, has been fixed in master branch of Vulkan validation layers.
https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/1024
Awesome, thank you for investigation, @rikusalminen !
Indeed - I thought it had something to do with gfx-rs, given that other vulkan libraries worked. I've downgraded for now, and it works fine :+1:
Most helpful comment
This is a bug in vulkan-validation-layers (arch package name), in version 1.1.112-2. Workaround: downgrade vulkan-validation-layers-1.1.107-1.
sudo pacman -U /var/cache/pacman/pkg/vulkan-validation-layers-1.1.107-1-x86_64.pkg.tar.xzThis is not a gfx-rs bug, feel free to close.