KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.33k stars 647 forks source link

ERROR_DEVICE_LOST running vulkan_samples batch (Linux X11) #1078

Closed demensdeum closed 1 month ago

demensdeum commented 4 months ago

Environment: Arch Linux Intel GPU + Nvidia GPU X11

Steps:

  1. cmake -G "Unix Makefiles" -Bbuild/linux -DCMAKE_BUILD_TYPE=Release
  2. cmake --build build/linux --config Release --target vulkan_samples -j$(nproc)
  3. ./build/linux/app/bin/Release/x86_64/vulkan_samples samples

Result: After some samples I got error: [error] Detected Vulkan error: ERROR_DEVICE_LOST Aborted (core dumped)

SaschaWillems commented 4 months ago

What sample does crash? And what does the log look like before the crash? And on what device did the crash occur?

demensdeum commented 4 months ago

@SaschaWillems Sample: descriptor_buffer_basic

GPU: Intel(R) UHD Graphics (CML GT2)

Exact command: ./build/linux/app/bin/Release/x86_64/vulkan_samples sample descriptor_buffer_basic

Log:

[info] Logger initialized [info] Initializing Vulkan sample [info] Vulkan debug utils enabled (VK_EXT_debug_utils) [info] Extension VK_KHR_get_physical_device_properties2 found, enabling it [info] Extension VK_EXT_debug_utils found, enabling it [info] Extension VK_KHR_xcb_surface found, enabling it [info] Enabled Validation Layers: [info] Found GPU: Intel(R) UHD Graphics (CML GT2) [warning] Couldn't find a discrete physical device, picking default GPU [info] Selected GPU: Intel(R) UHD Graphics (CML GT2) [info] Dedicated Allocation enabled [info] Device supports the following requested extensions: [info] VK_KHR_get_memory_requirements2 [info] VK_KHR_dedicated_allocation [info] VK_KHR_swapchain [info] VK_EXT_descriptor_buffer [info] VK_KHR_synchronization2 [info] VK_EXT_descriptor_indexing [info] VK_KHR_buffer_device_address [info] Surface supports the following surface formats: [info] B8G8R8A8Srgb, SrgbNonlinear [info] B8G8R8A8Unorm, SrgbNonlinear [info] Surface supports the following present modes: [info] Immediate [info] Mailbox [info] Fifo [info] FifoRelaxed [warning] (HPPSwapchain) Image extent (0, 0) not supported. Selecting (1280, 720). [warning] (HPPSwapchain) Surface format (Undefined, SrgbNonlinear) not supported. Selecting (B8G8R8A8Srgb, SrgbNonlinear). [info] (HPPSwapchain) Image usage flags: TransferSrc ColorAttachment [info] (HPPSwapchain) Present mode selected: Mailbox [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [error] Detected Vulkan error: ERROR_DEVICE_LOST Aborted (core dumped)

Can you explain what is log lock file? I will get it

SaschaWillems commented 4 months ago

Are you sure that Intel GPU supports descriptor buffers?

demensdeum commented 4 months ago

I am not sure, I just run samples in batch, and got error.

SaschaWillems commented 4 months ago

That GPU most probably does not support that extension, which is the reason for the crash. Can you run that sample standalone instead of the batch mode? That should do proper error checking and tell you if that extension is supported or not.

demensdeum commented 4 months ago

There must be compatibility checks, but got ERROR_DEVICE_LOST error instead. Command: ./build/linux/app/bin/Release/x86_64/vulkan_samples sample descriptor_buffer_basic

Then I see cubes for ~3 seconds: Screenshot_20240626_232749

After that get error ERROR_DEVICE_LOST:

[info] Logger initialized [info] Initializing Vulkan sample [info] Vulkan debug utils enabled (VK_EXT_debug_utils) [info] Extension VK_KHR_get_physical_device_properties2 found, enabling it [info] Extension VK_EXT_debug_utils found, enabling it [info] Extension VK_KHR_xcb_surface found, enabling it [info] Enabled Validation Layers: [info] Found GPU: Intel(R) UHD Graphics (CML GT2) [warning] Couldn't find a discrete physical device, picking default GPU [info] Selected GPU: Intel(R) UHD Graphics (CML GT2) [info] Dedicated Allocation enabled [info] Device supports the following requested extensions: [info] VK_KHR_get_memory_requirements2 [info] VK_KHR_dedicated_allocation [info] VK_KHR_swapchain [info] VK_EXT_descriptor_buffer [info] VK_KHR_synchronization2 [info] VK_EXT_descriptor_indexing [info] VK_KHR_buffer_device_address [info] Surface supports the following surface formats: [info] B8G8R8A8Srgb, SrgbNonlinear [info] B8G8R8A8Unorm, SrgbNonlinear [info] Surface supports the following present modes: [info] Immediate [info] Mailbox [info] Fifo [info] FifoRelaxed [warning] (HPPSwapchain) Image extent (0, 0) not supported. Selecting (1280, 720). [warning] (HPPSwapchain) Surface format (Undefined, SrgbNonlinear) not supported. Selecting (B8G8R8A8Srgb, SrgbNonlinear). [info] (HPPSwapchain) Image usage flags: TransferSrc ColorAttachment [info] (HPPSwapchain) Present mode selected: Mailbox [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [error] Detected Vulkan error: ERROR_DEVICE_LOST Aborted (core dumped)

demensdeum commented 4 months ago

In batch mode it crashes faster.

SaschaWillems commented 4 months ago

Looks like the GPU supports descriptor buffers. So either the sample is broken, or the driver. Do you get any validation errors when running with validation enabled?

demensdeum commented 4 months ago

Here is log/errors with validation enabled:

[info] Logger initialized [info] Initializing Vulkan sample [info] Vulkan debug utils enabled (VK_EXT_debug_utils) [info] Extension VK_EXT_debug_utils found, enabling it [info] VK_EXT_validation_features is available, enabling it [info] Extension VK_KHR_get_physical_device_properties2 found, enabling it [info] Extension VK_KHR_xcb_surface found, enabling it [info] Enabled Validation Layers: [info] VK_LAYER_KHRONOS_validation [warning] -2111305990 - UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-debugging: Validation Warning: [ UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-debugging ] | MessageID = 0x822806fa | vkCreateInstance(): Attempting to enable extension VK_EXT_debug_utils, but this extension is intended to support use by applications when debugging and it is strongly recommended that it be otherwise avoided. [warning] -1861097675 - UNASSIGNED-BestPractices-vkCreateInstance-deprecated-extension: Validation Warning: [ UNASSIGNED-BestPractices-vkCreateInstance-deprecated-extension ] | MessageID = 0x9111e735 | vkCreateInstance(): Attempting to enable deprecated extension VK_EXT_validation_features, but this extension has been deprecated by VK_EXT_layer_settings. [warning] -2111305990 - UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-debugging: Validation Warning: [ UNASSIGNED-BestPractices-vkCreateInstance-specialuse-extension-debugging ] | MessageID = 0x822806fa | vkCreateInstance(): Attempting to enable extension VK_EXT_validation_features, but this extension is intended to support use by applications when debugging and it is strongly recommended that it be otherwise avoided. [warning] -1861097675 - UNASSIGNED-BestPractices-vkCreateInstance-deprecated-extension: Validation Warning: [ UNASSIGNED-BestPractices-vkCreateInstance-deprecated-extension ] | MessageID = 0x9111e735 | vkCreateInstance(): Attempting to enable deprecated extension VK_KHR_get_physical_device_properties2, but this extension has been promoted to VK_VERSION_1_1. [info] Found GPU: Intel(R) UHD Graphics (CML GT2) [warning] Couldn't find a discrete physical device, picking default GPU [info] Selected GPU: Intel(R) UHD Graphics (CML GT2) [info] Dedicated Allocation enabled [info] Device supports the following requested extensions: [info] VK_KHR_get_memory_requirements2 [info] VK_KHR_dedicated_allocation [info] VK_KHR_swapchain [info] VK_EXT_descriptor_buffer [info] VK_KHR_synchronization2 [info] VK_EXT_descriptor_indexing [info] VK_KHR_buffer_device_address [warning] 181611958 - UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension: Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x562594ac2e30, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | vkCreateDevice(): Attempting to enable deprecated extension VK_KHR_get_memory_requirements2, but this extension has been promoted to VK_VERSION_1_1. [warning] 181611958 - UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension: Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x562594ac2e30, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | vkCreateDevice(): Attempting to enable deprecated extension VK_KHR_dedicated_allocation, but this extension has been promoted to VK_VERSION_1_1. [info] Surface supports the following surface formats: [info] B8G8R8A8Srgb, SrgbNonlinear [info] B8G8R8A8Unorm, SrgbNonlinear [info] Surface supports the following present modes: [info] Immediate [info] Mailbox [info] Fifo [info] FifoRelaxed [warning] (HPPSwapchain) Image extent (0, 0) not supported. Selecting (1280, 720). [warning] (HPPSwapchain) Surface format (Undefined, SrgbNonlinear) not supported. Selecting (B8G8R8A8Srgb, SrgbNonlinear). [info] (HPPSwapchain) Image usage flags: TransferSrc ColorAttachment [info] (HPPSwapchain) Present mode selected: Mailbox [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [info] Depth format selected: VK_FORMAT_D32_SFLOAT [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x56259688e9f0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x56259689bbd0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x5625968a8db0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x5625968b6030, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x56259688e9f0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x56259689bbd0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x5625968a8db0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [error] -132400417 - VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049: Validation Error: [ VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049 ] Object 0: handle = 0x5625968b6030, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xf81bbadf | vkCmdBindDescriptorBuffersEXT(): Number of resource buffers is 2. There must be no more than maxResourceDescriptorBufferBindings (1) descriptor buffers containing resource descriptor data bound. The Vulkan spec states: There must be no more than VkPhysicalDeviceDescriptorBufferPropertiesEXT::maxResourceDescriptorBufferBindings descriptor buffers containing resource descriptor data bound (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049) [warning] 1597479817 - UNASSIGNED-BestPractices-Error-Result: Validation Warning: [ UNASSIGNED-BestPractices-Error-Result ] Object 0: handle = 0x562594ac2e30, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x5f379b89 | vkQueueWaitIdle(): Returned error VK_ERROR_DEVICE_LOST. [error] Detected Vulkan error: ERROR_DEVICE_LOST Aborted (core dumped)

SaschaWillems commented 4 months ago

Thank you very much. So from the validation layer messages it looks like that Intel device only supports a single descriptor buffer binding, but the sample requires more.

Such a low limit makes me wonder why that device supports the extension after all.

But to sum it up: The sample in it's current state simply won't work on your Intel GPU.

demensdeum commented 4 months ago

Ok thank you

asuessenbach commented 4 months ago

We should add some startup-checks against maxResourceDescriptorBufferBindings to at least gracefully shutdown if there aren't enough.

SaschaWillems commented 4 months ago

I'll take care of that.