Vulkan-Samples icon indicating copy to clipboard operation
Vulkan-Samples copied to clipboard

Missing wayland extension error when running sample

Open planetmarshall opened this issue 7 months ago • 2 comments

Summary

Missing Wayland extension error when running hello_triangle sample

Steps to Reproduce

Reproduced with f95289c9

  1. Build samples as described in Linux build instructions
  2. Run
    ./vulkan_samples sample hello_triangle
    

The following error is reported -

[info] Logger initialized
[info] Initializing vulkan instance.
[info] Found GPU: NVIDIA GeForce RTX 2070 SUPER
[error] GLFW Error (code 65542): Wayland: Vulkan instance missing VK_KHR_wayland_surface extension
[error] Error Message: Failed to create window surface.
[error] Failed when running application Hello Triangle
[Vulkan Loader] ERROR:          vkDeviceWaitIdle: Invalid device [VUID-vkDeviceWaitIdle-device-parameter]
Aborted (core dumped)

System configuration

OS: Arch Linux x86_64 
Kernel: 6.15.2-arch1-1 
DE: GNOME 48.2 
WM: Mutter 
WM Theme: Adwaita 
CPU: Intel i9-9900KF (16) @ 5.000GHz 
GPU: NVIDIA GeForce RTX 2070 SUPER  (575.57.08)
Memory: 2668MiB / 64207MiB

planetmarshall avatar Jun 13 '25 18:06 planetmarshall

I have verified that the extension is present using a basic Vulkan application and dumping the available extensions. On the same system as above:

[2025-06-13 19:35:33.112] [info] Available Vulkan instance layers: VK_LAYER_NV_optimus (NVIDIA Optimus layer)
[2025-06-13 19:35:33.112] [info] Available Vulkan instance layers: VK_LAYER_NV_present (NVIDIA GR2608 layer)
[2025-06-13 19:35:33.112] [info] Available Vulkan instance layers: VK_LAYER_KHRONOS_validation (Khronos Validation Layer)
...
[2025-06-13 19:35:33.116] [info] Available Vulkan instance extensions: VK_KHR_wayland_surface
...
[2025-06-13 19:35:33.116] [info] Vulkan physical device: NVIDIA GeForce RTX 2070 SUPER
[2025-06-13 19:35:33.116] [info] Vulkan Maximum supported API version: 1.4

planetmarshall avatar Jun 13 '25 18:06 planetmarshall

After some investigation - I see VK_USE_PLATFORM_WAYLAND_KHR is not defined in hello_triangle.cpp, and VK_USE_PLATFORM_XCB_KHR is defined instead. Could you point me at where these preprocessor symbols get defined?

planetmarshall avatar Jun 13 '25 19:06 planetmarshall

Platformselection is done at CMake-Level via tha VKB_WSI_SELECTION setting. See https://github.com/KhronosGroup/Vulkan-Samples/blob/3944ae5426106a02546c46ae1be70b79133bdbfb/bldsys/cmake/global_options.cmake#L116

SaschaWillems avatar Jun 23 '25 19:06 SaschaWillems

Please add to the documentation https://github.com/KhronosGroup/Vulkan-Samples/blob/main/docs/build.adoc#build-with-cmake

"If you're running on Wayland (e.g. Ubuntu 23.10 or later), add -DVKB_WSI_SELECTION=WAYLAND"

JakubSkowron avatar Jul 28 '25 22:07 JakubSkowron