Every Vulkan application, including LunarG SDK 1.0.61.1 demos, crash on swapchain creation in Ubuntu 17.10 (Wayland and X.org). Callstack from cube demo:
#0 0x00007ffff629f924 in ?? () from /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so
#1 0x00007ffff62ac695 in ?? () from /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so
#2 0x00007ffff629fceb in ?? () from /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so
#3 0x00007ffff798c1ea in terminator_CreateSwapchainKHR () from /home/glaze/Downloads/VulkanSDK/1.0.61.1/x86_64/lib/libvulkan.so.1
#4 0x000055555555a48b in demo_prepare_buffers ()
#5 0x000055555555d51b in demo_prepare ()
#6 0x0000555555560fa0 in main ()
My GPU is AMD R9 Nano. vulkaninfo doesn't give errors and finds the validation layers and instance and device extensions:
Instance Extensions count = 9
VK_KHR_surface : extension revision 25
VK_KHR_xcb_surface : extension revision 6
VK_KHR_xlib_surface : extension revision 6
VK_KHR_wayland_surface : extension revision 6
VK_KHR_get_physical_device_properties2: extension revision 1
VK_KHR_external_memory_capabilities : extension revision 1
VK_KHR_external_semaphore_capabilities: extension revision 1
VK_KHR_get_surface_capabilities2 : extension revision 1
VK_EXT_debug_report : extension revision 8
Device Extensions count = 16
VK_KHR_descriptor_update_template : extension revision 1
VK_KHR_incremental_present : extension revision 1
VK_KHR_maintenance1 : extension revision 1
VK_KHR_push_descriptor : extension revision 1
VK_KHR_sampler_mirror_clamp_to_edge : extension revision 1
VK_KHR_swapchain : extension revision 68
VK_AMD_draw_indirect_count : extension revision 1
VK_KHR_shader_draw_parameters : extension revision 1
VK_KHR_get_memory_requirements2 : extension revision 1
VK_KHR_dedicated_allocation : extension revision 1
VK_KHR_external_memory : extension revision 1
VK_KHR_external_memory_fd : extension revision 1
VK_KHR_storage_buffer_storage_class : extension revision 1
VK_KHR_variable_pointers : extension revision 1
VK_KHR_external_semaphore : extension revision 1
VK_KHR_external_semaphore_fd : extension revision 1
Here's my environment variables:
export VULKAN_SDK=~/Downloads/VulkanSDK/1.0.61.1/x86_64
export PATH=$VULKAN_SDK/bin:$PATH
export LD_LIBRARY_PATH=$VULKAN_SDK/lib:$LD_LIBRARY_PATH
export VK_LAYER_PATH=$VULKAN_SDK/etc/explicit_layer.d
Are my Vulkan libraries configured wrongly or does this look like a RADV bug?
edit (2017-11-08): According to Phoronix this could be caused by Ubuntu's Mir patches:
If you have been trying to use the RADV Radeon Vulkan driver that's packaged for Ubuntu but find it not working, chances are it's caused by Canonical's patches for Mir support.
I haven't been able to try the workaround (installing drivers from a PPA: sudo apt-add-repository ppa:paulo-miguel-dias/mesa && sudo apt update && sudo apt dist-upgrade
) but will update this question or post an answer after I do unless someone else could verify that it works.
I got it working by using drivers from a PPA:
According to Phoronix Ubuntu's own repository's driver is broken because of their Mir patches:
David Airlie (RADV developer) also blogged about this breakage.
The Ubuntu team also pushed an Nvidia driver update today that fixes some Vulkan related bugs. So just try to simply update to those latest drivers Ubuntu pushed might already work.