Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texture-arrays vscode debugging crash using WGPU_ADAPTER_NAME #2613

Closed
SetheenDev opened this issue Apr 19, 2022 · 0 comments · Fixed by #2618
Closed

texture-arrays vscode debugging crash using WGPU_ADAPTER_NAME #2613

SetheenDev opened this issue Apr 19, 2022 · 0 comments · Fixed by #2618

Comments

@SetheenDev
Copy link

Description
The texture-arrays example project results in a Vulkan crash when using vscode to compile/run and when WGPU_ADAPTER_NAME is set to real physical hardware. Running via command line works but many Vulkan errors are emitted.

Repro steps
I ran 4 use-cases and documented below. The concern is with use-case 3.

Expected vs observed behavior
Expected debug capability as other projects are capable. Observed crash.

Use-case 1 - Building/debugging from vscode

  • WGPU_ADAPTER_NAME = Not set
  • Result - It runs but throws these errors each frame

Debug Output:

Running `cargo build --example=texture-arrays --package=wgpu --features=spirv --message-format=json`...
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Raw artifacts:
{
  fileName: 'c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe',
  name: 'texture-arrays',
  kind: 'example'
}
Filtered artifacts: 
{
  fileName: 'c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe',
  name: 'texture-arrays',
  kind: 'example'
}
configuration: {
  type: 'lldb',
  request: 'launch',
  name: "Debug example 'texture-arrays'",
  args: [],
  cwd: '${workspaceFolder}',
  __configurationTarget: 5,
  relativePathBase: 'c:\\temp\\rust\\wgpu',
  program: 'c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe',
  sourceLanguages: [ 'rust' ]
}
[adapter\src\terminal.rs:104] FreeConsole() = 1
[adapter\src\terminal.rs:105] AttachConsole(pid) = 1
[adapter\src\terminal.rs:109] FreeConsole() = 1
Debug adapter exit code=0, signal=null.

Terminal Output:

Using Intel(R) UHD Graphics (Vulkan)
[2022-04-19T11:32:23Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (0x7cd0911d)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x1b2b1505208, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1904,984), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (800,600), minImageExtent = (800,600), maxImageExtent = (800,600). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
[2022-04-19T11:32:23Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DEVICE, hndl: 0x1b2b1505208, name: ?)
[2022-04-19T11:32:23Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdDrawIndexed-None-02699 (0xa44449d4)]
        Validation Error: [ VUID-vkCmdDrawIndexed-None-02699 ] Object 0: handle = 0x908683000000001d, name = bind group, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0xa44449d4 | Descriptor set VkDescriptorSet 0x908683000000001d[bind group] encountered the following validation error at vkCmdDrawIndexed time: Descriptor in binding #1 index 1 is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call. The Vulkan spec states: Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-02699)
[2022-04-19T11:32:23Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DESCRIPTOR_SET, hndl: 0x908683000000001d, name: bind group)
[2022-04-19T11:32:23Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdDrawIndexed-None-02699 (0xa44449d4)]
...

launch.json config:

{
            "type": "lldb",
            "request": "launch",
            "name": "Debug example 'texture-arrays'",
            "cargo": {
                "args": [
                    "build",
                    "--example=texture-arrays",
                    "--package=wgpu",
                    "--features=spirv"
                ],
                "filter": {
                    "name": "texture-arrays",
                    "kind": "example"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },

Use-case 2 - Running vscode debug-compiled output via command line

  • WGPU_ADAPTER_NAME = Not set
  • Result - It runs but throws these errors each frame

Terminal Output:

C:\temp\rust\wgpu>c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe
Using Intel(R) UHD Graphics (Vulkan)
[2022-04-19T11:36:16Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (0x7cd0911d)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x1d4e35f9a08, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1904,984), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (800,600), minImageExtent = (800,600), maxImageExtent = (800,600). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
[2022-04-19T11:36:16Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DEVICE, hndl: 0x1d4e35f9a08, name: ?)
[2022-04-19T11:36:16Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdDrawIndexed-None-02699 (0xa44449d4)]
        Validation Error: [ VUID-vkCmdDrawIndexed-None-02699 ] Object 0: handle = 0x908683000000001d, name = bind group, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0xa44449d4 | Descriptor set VkDescriptorSet 0x908683000000001d[bind group] encountered the following validation error at vkCmdDrawIndexed time: Descriptor in binding #1 index 1 is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call. The Vulkan spec states: Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-02699)
[2022-04-19T11:36:16Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DESCRIPTOR_SET, hndl: 0x908683000000001d, name: bind group)
...

Use-case 3 - Building/debugging from vscode

  • WGPU_ADAPTER_NAME = NVIDIA GeForce RTX 3080 Laptop GPU
  • Result - It crashes when drawing the first frame

Debug Output:

Debug Output:
Running `cargo build --example=texture-arrays --package=wgpu --features=spirv --message-format=json`...
   Compiling wgpu-core v0.12.0 (C:\temp\rust\wgpu\wgpu-core)
   Compiling naga v0.8.0 (https://github.com/gfx-rs/naga?rev=85056524#85056524)
   Compiling wgpu-hal v0.12.0 (C:\temp\rust\wgpu\wgpu-hal)
   Compiling wgpu v0.12.0 (C:\temp\rust\wgpu\wgpu)
    Finished dev [unoptimized + debuginfo] target(s) in 20.36s
Raw artifacts:
{
  fileName: 'c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe',
  name: 'texture-arrays',
  kind: 'example'
}
Filtered artifacts: 
{
  fileName: 'c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe',
  name: 'texture-arrays',
  kind: 'example'
}
configuration: {
  type: 'lldb',
  request: 'launch',
  name: "Debug example 'texture-arrays'",
  args: [],
  cwd: '${workspaceFolder}',
  __configurationTarget: 5,
  relativePathBase: 'c:\\temp\\rust\\wgpu',
  program: 'c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe',
  sourceLanguages: [ 'rust' ]
}
[adapter\src\terminal.rs:104] FreeConsole() = 1
[adapter\src\terminal.rs:105] AttachConsole(pid) = 1
[adapter\src\terminal.rs:109] FreeConsole() = 1
error: texture-arrays.exe :: Class 'enum$<naga::Statement>::Block' has a member '__0' of type 'naga::block::Block' which does not have a complete definition.
error: texture-arrays.exe :: Class 'alloc::collections::btree::node::InternalNode<naga::ResourceBinding,naga::back::hlsl::BindTarget>' has a member 'data' of type 'alloc::collections::btree::node::LeafNode<naga::ResourceBinding,naga::back::hlsl::BindTarget>' which does not have a complete definition.
error: texture-arrays.exe :: Class 'core::mem::manually_drop::ManuallyDrop<core::ptr::non_null::NonNull<alloc::collections::btree::node::LeafNode<naga::ResourceBinding,naga::back::hlsl::BindTarget> > >' has a member 'value' of type 'core::ptr::non_null::NonNull<alloc::collections::btree::node::LeafNode<naga::ResourceBinding,naga::back::hlsl::BindTarget> >' which does not have a complete definition.
error: texture-arrays.exe :: Class 'concurrent_queue::unbounded::Block<async_task::runnable::Runnable>' has a member 'next' of type 'core::sync::atomic::AtomicPtr<concurrent_queue::unbounded::Block<async_task::runnable::Runnable> >' which does not have a complete definition.
error: texture-arrays.exe :: Class 'std::sync::mpsc::Receiver<tuple$<> >' has a member 'inner' of type 'core::cell::UnsafeCell<enum$<std::sync::mpsc::Flavor<tuple$<> > > >' which does not have a complete definition.
error: texture-arrays.exe :: Class 'core::sync::atomic::AtomicPtr<std::sync::mpsc::spsc_queue::Node<enum$<std::sync::mpsc::stream::Message<tuple$<> >, 0, 3, GoUp> > >' has a member 'p' of type 'core::cell::UnsafeCell<ptr_mut$<std::sync::mpsc::spsc_queue::Node<enum$<std::sync::mpsc::stream::Message<tuple$<> >, 0, 3, GoUp> > > >' which does not have a complete definition.
error: texture-arrays.exe :: Class 'std::sync::mpsc::mpsc_queue::Node<tuple$<> >' has a member 'next' of type 'core::sync::atomic::AtomicPtr<std::sync::mpsc::mpsc_queue::Node<tuple$<> > >' which does not have a complete definition.
[2022-04-19T11:13:03.334Z ERROR codelldb::handles] Parent/key combination is not unique (None/[1,0])
Debug adapter exit code=0, signal=null.

Terminal Output:

Using NVIDIA GeForce RTX 3080 Laptop GPU (Vulkan)
[2022-04-19T11:12:56Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (0x7cd0911d)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x1f26d14dc78, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1904,984), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (800,600), minImageExtent = (800,600), maxImageExtent = (800,600). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
[2022-04-19T11:12:56Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DEVICE, hndl: 0x1f26d14dc78, name: ?)
[2022-04-19T11:12:56Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdDrawIndexed-None-02699 (0xa44449d4)]
        Validation Error: [ VUID-vkCmdDrawIndexed-None-02699 ] Object 0: handle = 0x908683000000001d, name = bind group, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0xa44449d4 | Descriptor set VkDescriptorSet 0x908683000000001d[bind group] encountered the following validation error at vkCmdDrawIndexed time: Descriptor in binding #1 index 1 is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call. The Vulkan spec states: Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-02699)
[2022-04-19T11:12:56Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DESCRIPTOR_SET, hndl: 0x908683000000001d, name: bind group)
[2022-04-19T11:12:56Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdDrawIndexed-None-02699 (0xa44449d4)]
        Validation Error: [ VUID-vkCmdDrawIndexed-None-02699 ] Object 0: handle = 0x908683000000001d, name = bind group, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0xa44449d4 | Descriptor set VkDescriptorSet 0x908683000000001d[bind group] encountered the following validation error at vkCmdDrawIndexed time: Descriptor in binding #1 index 1 is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call. The Vulkan spec states: Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-02699)
[2022-04-19T11:12:56Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DESCRIPTOR_SET, hndl: 0x908683000000001d, name: bind group)
thread 'main' panicked at 'Error in Queue::submit: parent device is lost', wgpu\src\backend\direct.rs:231:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2022-04-19T11:13:02Z ERROR wgpu_core::device] failed to wait for the device: Lost

launch.json config:

{
            "type": "lldb",
            "request": "launch",
            "name": "Debug example 'texture-arrays'",
            "cargo": {
                "args": [
                    "build",
                    "--example=texture-arrays",
                    "--package=wgpu",
                    "--features=spirv"
                ],
                "filter": {
                    "name": "texture-arrays",
                    "kind": "example"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },

Use-case 4 - Running vscode debug-compiled output via command line

  • WGPU_ADAPTER_NAME = NVIDIA GeForce RTX 3080 Laptop GPU
  • Result - It runs but throws these errors each frame

Terminal Output:

C:\temp\rust\wgpu>c:\\temp\\rust\\wgpu\\target\\debug\\examples\\texture-arrays.exe
Using NVIDIA GeForce RTX 3080 Laptop GPU (Vulkan)
[2022-04-19T11:16:49Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (0x7cd0911d)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x25d54217c28, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1904,984), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (800,600), minImageExtent = (800,600), maxImageExtent = (800,600). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
[2022-04-19T11:16:49Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DEVICE, hndl: 0x25d54217c28, name: ?)
[2022-04-19T11:16:49Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdDrawIndexed-None-02699 (0xa44449d4)]
        Validation Error: [ VUID-vkCmdDrawIndexed-None-02699 ] Object 0: handle = 0x908683000000001d, name = bind group, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0xa44449d4 | Descriptor set VkDescriptorSet 0x908683000000001d[bind group] encountered the following validation error at vkCmdDrawIndexed time: Descriptor in binding #1 index 1 is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call. The Vulkan spec states: Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-02699)
[2022-04-19T11:16:49Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DESCRIPTOR_SET, hndl: 0x908683000000001d, name: bind group)
[2022-04-19T11:16:49Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdDrawIndexed-None-02699 (0xa44449d4)]
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant