egl-wayland icon indicating copy to clipboard operation
egl-wayland copied to clipboard

vkPhysicalDeviceSurfaceFormatsKHR reports VK_ERROR_SURFACE_LOST_KHR (dual gpu setup)

Open tim-rex opened this issue 7 months ago • 15 comments

Running an arch linux setup with dual GPU's

Arch Linux Kernel 6.6.2-arch1-1 GNOME Version 45.1 nVidia Driver version 545.29.6

personal project When targeting the GTX 970.. vkCreateWaylandSurfaceKHR succeds

Using that surface, I can succesfully query the surface capabilities vkGetPhysicalDeviceSurfaceCapabilitiesKHR(device, surface, &details.capabilities);

Though the returned capabilities show slightly excessive values for the currentExtent, all other values appear sane.

I then query for surface formats vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &formatCount, nullptr);

which fails with VK_ERROR_SURFACE_LOST_KHR

vkcube-wayland

This behaviour seems to be mirrored by vkcube-wayland, glxgears, vkmark

Curiously, vulkaninfo only reports the following presentable surfaces:

       Surface types: count = 2
                VK_KHR_xcb_surface
                VK_KHR_xlib_surface

Seems odd that VK_KHR_wayland_surface does not make an appearance (though I don't see it for the amd card either).

Running vkcube-wayland for the GTX 970 seg faults

[~]$ vkcube-wayland --gpu_number 0
Selected GPU 0: NVIDIA GeForce GTX 970, type: DiscreteGpu
Can't find our preferred formats... Falling back to first exposed format. Rendering may be incorrect.
Segmentation fault (core dumped)

[~]$ vkcube-wayland --gpu_number 1
Selected GPU 1: AMD Radeon RX 580 Series (RADV POLARIS10), type: DiscreteGpu
<runs fine>

Running with --validate-checks-disabled

[timk@archon ~]$ vkcube-wayland --gpu_number 0 --validate-checks-disabled
Selected GPU 0: NVIDIA GeForce GTX 970, type: DiscreteGpu
Can't find our preferred formats... Falling back to first exposed format. Rendering may be incorrect.
ERROR : VALIDATION - Message Id Number: -1926448293 | Message Id Name: INTERNAL-ERROR-vkGetPhysicalDeviceSurfaceFormatsKHR
	Validation Error: [ INTERNAL-ERROR-vkGetPhysicalDeviceSurfaceFormatsKHR ] Object 0: handle = 0x55d0ac10cad0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; Object 1: handle = 0xfab64d0000000002, type = VK_OBJECT_TYPE_SURFACE_KHR; | MessageID = 0x8d2cbb5b | In /vulkan-sdk/1.3.268.0/source/Vulkan-ValidationLayers/layers/state_tracker/image_state.cpp:748: vkGetPhysicalDeviceSurfaceFormatsKHR() was called in the Validation Layer state tracking and failed with result = VK_ERROR_SURFACE_LOST_KHR.

	Objects - 2
		Object[0] - VK_OBJECT_TYPE_PHYSICAL_DEVICE, Handle 0x55d0ac10cad0
		Object[1] - VK_OBJECT_TYPE_SURFACE_KHR, Handle Oxfab64d0000000002

ERROR : VALIDATION - Message Id Number: -1661406165 | Message Id Name: VUID-VkSwapchainCreateInfoKHR-imageFormat-01273
	Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01273 ] | MessageID = 0x9cf8f42b | vkCreateSwapchainKHR(): pCreateInfo->imageFormat is VK_FORMAT_UNDEFINED. The Vulkan spec states: imageFormat and imageColorSpace must match the format and colorSpace members, respectively, of one of the VkSurfaceFormatKHR structures returned by vkGetPhysicalDeviceSurfaceFormatsKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01273)

ERROR : VALIDATION - Message Id Number: -1661406165 | Message Id Name: VUID-VkSwapchainCreateInfoKHR-imageFormat-01273
	Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01273 ] | MessageID = 0x9cf8f42b | vkCreateSwapchainKHR(): pCreateInfo->imageColorSpace is VK_COLOR_SPACE_SRGB_NONLINEAR_KHR. The Vulkan spec states: imageFormat and imageColorSpace must match the format and colorSpace members, respectively, of one of the VkSurfaceFormatKHR structures returned by vkGetPhysicalDeviceSurfaceFormatsKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01273)

ERROR : VALIDATION - Message Id Number: -1070202321 | Message Id Name: VUID-VkSwapchainCreateInfoKHR-imageFormat-01778
	Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f | vkCreateSwapchainKHR(): pCreateInfo->imageFormat VK_FORMAT_UNDEFINED with tiling VK_IMAGE_TILING_OPTIMAL has no supported format features on this physical device. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

ERROR : VALIDATION - Message Id Number: -1070202321 | Message Id Name: VUID-VkSwapchainCreateInfoKHR-imageFormat-01778
	Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f | vkCreateSwapchainKHR(): pCreateInfo vkGetPhysicalDeviceImageFormatProperties() unexpectedly failed, with following params: format: VK_FORMAT_UNDEFINED, imageType: VK_IMAGE_TYPE_2D, tiling: VK_IMAGE_TILING_OPTIMAL, usage: VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, flags: VkImageCreateFlags(0). The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

ERROR : VALIDATION - Message Id Number: -1070202321 | Message Id Name: VUID-VkSwapchainCreateInfoKHR-imageFormat-01778
	Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f | vkCreateSwapchainKHR(): pCreateInfo->imageArrayLayers 1, but Maximum value returned by vkGetPhysicalDeviceImageFormatProperties() is 0 for imageFormat VK_FORMAT_UNDEFINED with tiling VK_IMAGE_TILING_OPTIMAL. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

ERROR : VALIDATION - Message Id Number: -1070202321 | Message Id Name: VUID-VkSwapchainCreateInfoKHR-imageFormat-01778
	Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 ] | MessageID = 0xc036022f | vkCreateSwapchainKHR(): pCreateInfo->imageExtent (500,500), which is bigger than max extent (0,0)returned by vkGetPhysicalDeviceImageFormatProperties(): for imageFormat VK_FORMAT_UNDEFINED with tiling VK_IMAGE_TILING_OPTIMAL. The Vulkan spec states: The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageFormat-01778)

vkgears vkgears also seg faults, with no way to specifiy GPU.

vkmark vkmark seg faults when specifying the GTX 970.. Runs fine with the RX 580

vulkaninfo

vulkaninfo --summary

[~]$ vulkaninfo --summary
ERROR while creating surface for extension VK_KHR_wayland_surface : /vulkan-sdk/1.3.268.0/source/Vulkan-Tools/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfaceFormats2KHR failed with ERROR_SURFACE_LOST_KHR
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.268


Instance Extensions: count = 23
-------------------------------
VK_EXT_acquire_drm_display             : extension revision 1
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 10
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_EXT_surface_maintenance1            : extension revision 1
VK_EXT_swapchain_colorspace            : extension revision 4
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_portability_enumeration         : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6
VK_LUNARG_direct_driver_loading        : extension revision 1

Instance Layers: count = 9
--------------------------
VK_LAYER_KHRONOS_profiles         Khronos Profiles layer                     1.3.268  version 1
VK_LAYER_KHRONOS_shader_object    Khronos Shader object layer                1.3.268  version 1
VK_LAYER_KHRONOS_synchronization2 Khronos Synchronization2 layer             1.3.268  version 1
VK_LAYER_KHRONOS_validation       Khronos Validation Layer                   1.3.268  version 1
VK_LAYER_LUNARG_api_dump          LunarG API dump layer                      1.3.268  version 2
VK_LAYER_LUNARG_gfxreconstruct    GFXReconstruct Capture Layer Version 1.0.1 1.3.268  version 4194305
VK_LAYER_LUNARG_monitor           Execution Monitoring Layer                 1.3.268  version 1
VK_LAYER_LUNARG_screenshot        LunarG image capture layer                 1.3.268  version 1
VK_LAYER_NV_optimus               NVIDIA Optimus layer                       1.3.260  version 1

Devices:
========
GPU0:
	apiVersion         = 1.3.260
	driverVersion      = 545.29.6.0
	vendorID           = 0x10de
	deviceID           = 0x13c2
	deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
	deviceName         = NVIDIA GeForce GTX 970
	driverID           = DRIVER_ID_NVIDIA_PROPRIETARY
	driverName         = NVIDIA
	driverInfo         = 545.29.06
	conformanceVersion = 1.3.6.0
	deviceUUID         = 0f820b91-4b52-39da-79f9-31a36d336ebb
	driverUUID         = 468717c2-5245-5d6d-9401-72b8a4ff98e5
GPU1:
	apiVersion         = 1.3.255
	driverVersion      = 23.2.1
	vendorID           = 0x1002
	deviceID           = 0x67df
	deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
	deviceName         = AMD Radeon RX 580 Series (RADV POLARIS10)
	driverID           = DRIVER_ID_MESA_RADV
	driverName         = radv
	driverInfo         = Mesa 23.2.1-arch1.2
	conformanceVersion = 1.2.7.1
	deviceUUID         = 00000000-0200-0000-0000-000000000000
	driverUUID         = 414d442d-4d45-5341-2d44-525600000000

eglinfo -B

[~]$ eglinfo -B
GBM platform:
amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
amdgpu: amdgpu_device_initialize failed.
amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
amdgpu: amdgpu_device_initialize failed.
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 16.0.6, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 23.2.1-arch1.2
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 16.0.6, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 23.2.1-arch1.2
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 16.0.6, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 23.2.1-arch1.2
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Wayland platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL core profile version: 4.6 (Core Profile) Mesa 23.2.1-arch1.2
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 23.2.1-arch1.2
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 23.2.1-arch1.2
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

X11 platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL core profile version: 4.6 (Core Profile) Mesa 23.2.1-arch1.2
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 23.2.1-arch1.2
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 23.2.1-arch1.2
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Surfaceless platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 970/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 545.29.06
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 970/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 545.29.06
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 970/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 545.29.06
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device platform:
Device #0:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 970/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 545.29.06
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 970/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 545.29.06
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 970/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 545.29.06
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #1:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL core profile version: 4.6 (Core Profile) Mesa 23.2.1-arch1.2
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 23.2.1-arch1.2
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Radeon RX 580 Series (polaris10, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 23.2.1-arch1.2
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #2:

Platform Device platform:
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
eglinfo: eglInitialize failed

Device #3:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 16.0.6, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 23.2.1-arch1.2
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 16.0.6, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 23.2.1-arch1.2
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 16.0.6, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 23.2.1-arch1.2
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

inxi

System:
  Kernel: 6.6.2-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    Desktop: GNOME v: 45.1 Distro: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: STRIX Z270G GAMING v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 1501
    date: 07/13/2021
Battery:
  Device-1: hidpp_battery_0 model: Logitech MX Master 3S charge: 55%
    status: discharging
CPU:
  Info: quad core model: Intel Core i7-7700K bits: 64 type: MT MCP
    arch: Kaby Lake rev: 9 cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 2750 high: 4400 min/max: 800/4500 cores: 1: 4400 2: 800
    3: 832 4: 1968 5: 4400 6: 4400 7: 800 8: 4400 bogomips: 67224
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
  Device-1: NVIDIA GM204 [GeForce GTX 970] vendor: ASUSTeK driver: nvidia
    v: 545.29.06 arch: Maxwell bus-ID: 01:00.0
  Device-2: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
    vendor: Sapphire Nitro+ driver: amdgpu v: kernel arch: GCN-4 bus-ID: 02:00.0
    temp: 50.0 C
  Display: wayland server: X.org v: 1.21.1.9 with: Xwayland v: 23.2.2
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia dri: radeonsi
    gpu: amdgpu,nvidia,nvidia-nvswitch resolution: no compositor data
    resolution: 1: 3840x2160 2: 2560x1440 3: 2560x1440
  API: EGL v: 1.5 drivers: kms_swrast,nvidia,radeonsi,swrast platforms:
    active: gbm,wayland,x11,surfaceless,device inactive: device-2
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: amd mesa v: 23.2.1-arch1.2
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 580 Series (polaris10
    LLVM 16.0.6 DRM 3.54 6.6.2-arch1-1)
  API: Vulkan v: 1.3.268 drivers: nvidia,radv surfaces: xcb,xlib,wayland
    devices: 2

tim-rex avatar Nov 25 '23 04:11 tim-rex