vkGetPhysicalDeviceSurfaceSupportKHR fails on wayland

When running in a wayland session, the standard tool for dumping vulkan information vulkaninfo fails to complete (among other programs). This was tested using the beta drivers 495.29.05 on a GTX 1070 (GP104).

Compiling the tool from head and executing meets an unexepected error in vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_INITIALIZATION_FAILED. But by default its not clear which windowing system caused the issue in this case. If you adjust the tool to avoid wayland surface extensions you will find that it executes successfully and provides information on the X11 surfaces.

It seems tools expect vkGetPhysicalDeviceSurfacePresentModesKHR to work on the wayland surfaces and id expect this to work. It also seems like this affects other PhysicalDevice related functions as the common video player mpv fails with VK_ERROR_INITIALIZATION_FAILED as well when querying GetPhysicalDeviceSurfaceSupportKHR on nvidia drivers. Programs which do not attempt to query physical device support appear to work correctly, such as the vkcube example program.

The spec does not appear to show this as an expected result vkGetPhysicalDeviceSurfacePresentModesKHR(3)

1 Like

I should update that vkcube only worked because it is hardcoded to use X11 surfaces. If you modify vkcube to choose wayland surfaces it will fail as well.