Open Bug 1952670 Opened 1 year ago Updated 11 days ago

[AMD] dom.webgpu.allow-present-without-readback crash

Categories

(Core :: Graphics: WebGPU, defect)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: prasol258, Assigned: jimb, NeedInfo)

References

(Blocks 2 open bugs, Regression, )

Details

(Keywords: regression)

Attachments

(1 file)

79.93 KB, application/json
Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0

Steps to reproduce:

Enabling dom.webgpu.allow-present-without-readback (on by default) causes a regression on Radeon 7xxM series integrated graphics on Linux

Actual results:

WebGPU never ends up rendering anything/does not present, with no visible errors in logs (until dom.webgpu.allow-present-without-readback is set to false)

Expected results:

(it should work)

I assume the GPU should just be added to a blocklist (does allow-present-without-readback have one?)

Summary: dom.webgpu.allow-present-without-readback - Regression on Linux (nightly) → dom.webgpu.allow-present-without-readback - broken on Linux (nightly); regression

The default value changed fairly recently:

https://phabricator.services.mozilla.com/D233984

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebGPU' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebGPU
Product: Firefox → Core
Version: other → unspecified
Severity: -- → S3

:sotaro, since you are the author of the regressor, bug 1927839, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(sotaro.ikeda.g)

Hi prasol258, thank you for reporting! Can you attach about:support after the problem happens.?

Flags: needinfo?(prasol258)
Attached file support.txt
Flags: needinfo?(prasol258)

(In reply to Sotaro Ikeda [:sotaro] from comment #5)

Hi prasol258, thank you for reporting! Can you attach about:support after the problem happens.?

I attached the support information

See Also: → 1966566

I see crashes on radeonsi driver stack on AMD 6600 while Intel works fine with readback. Will try to report/diagnose it.

Flags: needinfo?(sotaro.ikeda.g) → needinfo?(stransky)
Summary: dom.webgpu.allow-present-without-readback - broken on Linux (nightly); regression → [AMD] dom.webgpu.allow-present-without-readback - broken on Linux (nightly); regression
Flags: needinfo?(stransky)
Summary: [AMD] dom.webgpu.allow-present-without-readback - broken on Linux (nightly); regression → [AMD] dom.webgpu.allow-present-without-readback crash
Flags: needinfo?(stransky)

Running with Vulkan validation it throws this error:

Validation Error: [ VUID-StandaloneSpirv-None-10684 ] | MessageID = 0xb210f7c2
vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
Invalid explicit layout decorations on type for operand '28[%28]'
  %27 = OpVariable %_ptr_Function__arr_v2float_uint_3 Function %26
The Vulkan spec states: All variables must have valid explicit layout decorations as described in Shader Interfaces (https://docs.vulkan.org/spec/latest/appendices/spirvenv.html#VUID-StandaloneSpirv-None-10684)
Flags: needinfo?(stransky) → needinfo?(jimb)

Was marked as Firefox bug:

Validation Error: [ VUID-StandaloneSpirv-None-10684 ] | MessageID = 0xb210f7c2
vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
Invalid explicit layout decorations on type for operand '36[%36]'
  %35 = OpVariable %_ptr_Function__struct_8 Function %37

Command to reproduce:
        spirv-val <input.spv> --relax-block-layout --target-env vulkan1.3

The Vulkan spec states: All variables must have valid explicit layout decorations as described in Shader Interfaces (https://docs.vulkan.org/spec/latest/appendices/spirvenv.html#VUID-StandaloneSpirv-None-10684)

Validation Error: [ VUID-VkImageViewCreateInfo-image-01762 ] | MessageID = 0x6516b437
vkCreateImageView(): pCreateInfo->format VK_FORMAT_B8G8R8A8_UNORM is different from VkImage 0x190000000019 format (VK_FORMAT_R8G8B8A8_UNORM). Formats MUST be IDENTICAL unless VK_IMAGE_CREATE_MUTABLE_FORMAT BIT was set on image creation.
The Vulkan spec states: If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, or if the format of the image is a multi-planar format and if subresourceRange.aspectMask is VK_IMAGE_ASPECT_COLOR_BIT, format must be identical to the format used to create image (https://docs.vulkan.org/spec/latest/chapters/resources.html#VUID-VkImageViewCreateInfo-image-01762)
Objects: 1
    [0] VkImage 0x190000000019
Flags: needinfo?(jimb)
Assignee: nobody → jimb

vkCreateImageView(): pCreateInfo->format VK_FORMAT_B8G8R8A8_UNORM is different from VkImage 0x190000000019 format (VK_FORMAT_R8G8B8A8_UNORM). Formats MUST be IDENTICAL unless VK_IMAGE_CREATE_MUTABLE_FORMAT BIT was set on image creation.

Erich points out that this looks related to bug 1971671.

Tested again latest nightly and it's still broken:

VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ./firefox
Validation Error: [ VUID-StandaloneSpirv-None-10684 ] | MessageID = 0xb210f7c2
vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
Invalid explicit layout decorations on type for operand '28[%28]'
  %27 = OpVariable %_ptr_Function__arr_v2float_uint_3 Function %26

Command to reproduce:
	spirv-val <input.spv> --relax-block-layout --target-env vulkan1.3

The Vulkan spec states: All variables must have valid explicit layout decorations as described in Shader Interfaces (https://docs.vulkan.org/spec/latest/appendices/spirvenv.html#VUID-StandaloneSpirv-None-10684)

prasol258, can you check if the problem happens with latest nightly?

Flags: needinfo?(prasol258)

:stransky, can you also check if the problem happens?

Flags: needinfo?(stransky)

Tested latest nightly & Fedora 44 & AMD and got this crash (after switching some examples at https://webgpu.github.io/webgpu-samples/

#8  RustMozCrash
    (aFilename=0x7fcaefffade4 "/raid/src/third_party/rust/wgpu-core/src/storage.rs", aLine=146, aReason=0x7fcaefffabe0 "assertion `left == right` failed: Cannot get QueueId(4,1), found other resource QueueId(4,2)\n  left: 1\n right: 2") at wrappers.cpp:17
[...]
#18 0x00007fcb25a1f589 in core::panicking::assert_failed<u32, u32> (kind=(unknown: 0xe4), left=0x7fcaefffb28c, right=0x7fcaefffb288, args=...)
    at /rustc/254b59607d4417e9dffbc307138ae5c86280fe4c/library/core/src/panicking.rs:394
#19 0x00007fcb25943315 in wgpu_core::storage::Storage<alloc::sync::Arc<wgpu_core::device::queue::Queue, alloc::alloc::Global>>::get<alloc::sync::Arc<wgpu_core::device::queue::Queue, alloc::alloc::Global>> (self=0x7fcad07876d8, id=...) at src/storage.rs:146
#20 wgpu_core::registry::Registry<alloc::sync::Arc<wgpu_core::device::queue::Queue, alloc::alloc::Global>>::get<alloc::sync::Arc<wgpu_core::device::queue::Queue, alloc::alloc::Global>>
    (self=0x7fcad07876c8, id=...) at src/registry.rs:133
#21 0x00007fcb258584e9 in wgpu_core::global::Global::queue_as_hal<wgpu_hal::vulkan::Api> (self=0x7fcad0787600, id=...) at third_party/rust/wgpu-core/src/as_hal.rs:428
#22 wgpu_bindings::server::wgpu_vksemaphore_destroy (global=0x7fcad0787600, device_id=..., handle=0x7fcaefffabe0) at gfx/wgpu_bindings/src/server.rs:3310
#23 0x00007fcb20c262c9 in mozilla::webgpu::VkSemaphoreHandle::~VkSemaphoreHandle (this=0x7fcabf671d00) at ./../../../dom/webgpu/ipc/WebGPUParent.cpp:1982
#24 0x00007fcb20c15114 in std::default_delete<mozilla::webgpu::VkSemaphoreHandle>::operator() (this=0x7fcad73a4498, __ptr=0x7fcabf671d00)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unique_ptr.h:85
#25 std::unique_ptr<mozilla::webgpu::VkSemaphoreHandle, std::default_delete<mozilla::webgpu::VkSemaphoreHandle> >::~unique_ptr (this=0x7fcad73a4498)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unique_ptr.h:361
#26 nsTArrayElementTraits<std::unique_ptr<mozilla::webgpu::VkSemaphoreHandle, std::default_delete<mozilla::webgpu::VkSemaphoreHandle> > >::Destruct (aE=0x7fcad73a4498)
    at /raid/src/objdir-opt/dist/include/nsTArray.h:568
#27 nsTArray_Impl<std::unique_ptr<mozilla::webgpu::VkSemaphoreHandle, std::default_delete<mozilla::webgpu::VkSemaphoreHandle> >, nsTArrayInfallibleAllocator>::DestructRange
    (this=0x7fcad65f8f68, aStart=0, aCount=<optimized out>) at /raid/src/objdir-opt/dist/include/nsTArray.h:2327
#28 nsTArray_Impl<std::unique_ptr<mozilla::webgpu::VkSemaphoreHandle, std::default_delete<mozilla::webgpu::VkSemaphoreHandle> >, nsTArrayInfallibleAllocator>::ClearAndRetainStorage
    (this=0x7fcad65f8f68) at /raid/src/objdir-opt/dist/include/nsTArray.h:1350
#29 nsTArray_Impl<std::unique_ptr<mozilla::webgpu::VkSemaphoreHandle, std::default_delete<mozilla::webgpu::VkSemaphoreHandle> >, nsTArrayInfallibleAllocator>::~nsTArray_Impl
    (this=0x7fcad65f8f68) at /raid/src/objdir-opt/dist/include/nsTArray.h:895
#30 mozilla::webgpu::SharedTextureDMABuf::~SharedTextureDMABuf (this=0x7fcad65f8f20) at ./../../../dom/webgpu/SharedTextureDMABuf.cpp:97
#31 0x00007fcb20c151be in mozilla::webgpu::SharedTextureDMABuf::~SharedTextureDMABuf (this=0x7fcaefffade4) at ./../../../dom/webgpu/SharedTextureDMABuf.cpp:97
#32 0x00007fcb1f2efaee in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x7fcac5a66be0)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:158
#33 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7fcae66f1890)
--Type <RET> for more, q to quit, c to continue without paging--
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:736
#34 std::__shared_ptr<mozilla::webgpu::SharedTexture, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7fcae66f1888)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:1188
#35 mozilla::layers::SharedResourceWrapper::~SharedResourceWrapper (this=0x7fcae66f1870) at /raid/src/objdir-opt/dist/include/mozilla/layers/RemoteTextureMap.h:79
#36 std::default_delete<mozilla::layers::SharedResourceWrapper>::operator() (this=<optimized out>, __ptr=0x7fcae66f1870)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unique_ptr.h:85
#37 0x00007fcb1f2f0039 in std::unique_ptr<mozilla::layers::SharedResourceWrapper, std::default_delete<mozilla::layers::SharedResourceWrapper> >::~unique_ptr (this=0x7fcaefffade4)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unique_ptr.h:361
#38 mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder::~RecycledTextureHolder (this=0x7fcae66f3bf0) at /raid/src/objdir-opt/dist/include/mozilla/layers/RemoteTextureMap.h:139
#39 std::destroy_at<mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder> (__location=0x7fcae66f3bf0)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_construct.h:88
#40 std::allocator_traits<std::allocator<std::_List_node<mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder> > >::destroy<mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder> (__a=..., __p=0x7fcae66f3bf0) at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:533
#41 std::__cxx11::_List_base<mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder, std::allocator<mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder> >::_M_clear
    (this=0x7fcadc597e90) at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/list.tcc:77
#42 std::__cxx11::_List_base<mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder, std::allocator<mozilla::layers::RemoteTextureRecycleBin::RecycledTextureHolder> >::~_List_base
    (this=0x7fcadc597e90) at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_list.h:499
#43 mozilla::layers::RemoteTextureRecycleBin::~RemoteTextureRecycleBin (this=0x7fcadc597e80) at ./../../../gfx/layers/RemoteTextureMap.cpp:32
#44 mozilla::layers::RemoteTextureRecycleBin::Release (this=0x7fcadc597e80) at /raid/src/objdir-opt/dist/include/mozilla/layers/RemoteTextureMap.h:130
#45 mozilla::RefPtrTraits<mozilla::layers::RemoteTextureRecycleBin>::Release (aPtr=0x7fcadc597e80) at /raid/src/objdir-opt/dist/include/mozilla/RefPtr.h:48
#46 RefPtr<mozilla::layers::RemoteTextureRecycleBin>::ConstRemovingRefPtrTraits<mozilla::layers::RemoteTextureRecycleBin>::Release (aPtr=0x7fcadc597e80)
    at /raid/src/objdir-opt/dist/include/mozilla/RefPtr.h:408
#47 RefPtr<mozilla::layers::RemoteTextureRecycleBin>::~RefPtr (this=0x7fcad7338250) at /raid/src/objdir-opt/dist/include/mozilla/RefPtr.h:79
#48 mozilla::layers::RemoteTextureMap::TextureOwner::~TextureOwner (this=0x7fcad7338090) at /raid/src/objdir-opt/dist/include/mozilla/layers/RemoteTextureMap.h:402
#49 0x00007fcb1f2e4b0d in std::default_delete<mozilla::layers::RemoteTextureMap::TextureOwner>::operator() (__ptr=0x7fcad7338090, this=<optimized out>)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unique_ptr.h:85
#50 std::unique_ptr<mozilla::layers::RemoteTextureMap::TextureOwner, std::default_delete<mozilla::layers::RemoteTextureMap::TextureOwner> >::~unique_ptr (this=<optimized out>)
    at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unique_ptr.h:361
#51 mozilla::layers::RemoteTextureMap::UnregisterTextureOwner (this=<optimized out>, aOwnerId=..., aForPid=<optimized out>) at ./../../../gfx/layers/RemoteTextureMap.cpp:731
#52 0x00007fcb20c21795 in mozilla::webgpu::WebGPUParent::SwapChainDrop (this=0x7fcae8aee300, aOwnerId=..., aTxnType=<optimized out>, aTxnId=<optimized out>)
    at ./../../../dom/webgpu/ipc/WebGPUParent.cpp:1636
#53 0x00007fcb20c215e2 in wgpu_parent_swap_chain_drop (aParent=0x7fcaefffade4, aRemoteTextureOwnerId=<optimized out>, aTxnType=4026510304, aTxnId=0)
    at ./../../../dom/webgpu/ipc/WebGPUParent.cpp:325
#54 0x00007fcb25811505 in wgpu_bindings::server::process_message (global=0x7fcad0787600, data_buffers=..., shmem_mappings=..., message=...) at gfx/wgpu_bindings/src/server.rs:3062
#55 0x00007fcb257fbfe4 in wgpu_bindings::server::wgpu_server_messages (global=0x7fcad0787600, nr_of_messages=675, serialized_messages=<optimized out>, data_buffers=..., shmem_mappings=...)
    at gfx/wgpu_bindings/src/server.rs:2674
#56 0x00007fcb20c25d41 in mozilla::webgpu::WebGPUParent::RecvMessages
    (this=this@entry=0x7fcae8aee300, nrOfMessages=nrOfMessages@entry=675, aSerializedMessages=..., aDataBuffers=..., aShmems=...) at ./../../../dom/webgpu/ipc/WebGPUParent.cpp:1700
#57 0x00007fcb20c26eee in mozilla::webgpu::PWebGPUParent::OnMessageReceived (this=0x7fcae8aee300, msg__=<optimized out>) at ./../../ipc/ipdl/PWebGPUParent.cpp:322
#58 0x00007fcb1f74e75c in mozilla::gfx::PCanvasManagerParent::OnMessageReceived (this=<optimized out>, msg__=...) at ./../../ipc/ipdl/PCanvasManagerParent.cpp:273
#59 0x00007fcb1edeef56 in mozilla::ipc::MessageChannel::DispatchAsyncMessage (this=this@entry=0x7fcaec47e000, aProxy=aProxy@entry=0x7fcad5bbf580, aMsg=...)
    at ./../../../ipc/glue/MessageChannel.cpp:1797
#60 0x00007fcb1edee215 in mozilla::ipc::MessageChannel::DispatchMessage (this=this@entry=0x7fcaec47e000, aProxy=aProxy@entry=0x7fcad5bbf580, aMsg=std::unique_ptr<IPC::Message> = {...})
    at ./../../../ipc/glue/MessageChannel.cpp:1723
#61 0x00007fcb1edee5be in mozilla::ipc::MessageChannel::RunMessage (this=0x7fcaec47e000, aProxy=0x7fcad5bbf580, aTask=...) at ./../../../ipc/glue/MessageChannel.cpp:1512
#62 0x00007fcb1edeeab4 in mozilla::ipc::MessageChannel::MessageTask::Run (this=0x7fcaceaafe80) at ./../../../ipc/glue/MessageChannel.cpp:1614

running as VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ./firefox there are various errors like:

Validation Error: [ VUID-vkDestroyDevice-device-05137 ] | MessageID = 0x4872eaa0
vkDestroyDevice(): Object Tracking - For VkDevice 0x7f9875643000, VkSemaphore 0xa480000000a48 has not been destroyed.
The Vulkan spec states: All child objects created on device that can be destroyed or freed must have been destroyed or freed prior to destroying device (https://docs.vulkan.org/spec/latest/chapters/devsandqueues.html#VUID-vkDestroyDevice-device-05137)
Objects: 2
    [0] VkDevice 0x7f9875643000
    [1] VkSemaphore 0xa480000000a48

Validation Error: [ VUID-vkDestroyDevice-device-05137 ] | MessageID = 0x4872eaa0
(Warning - This VUID has now been reported 10 times, which is the duplicate_message_limit value, this will be the last time reporting it).
vkDestroyDevice(): Object Tracking - For VkDevice 0x7f9875643000, VkSemaphore 0xa610000000a61 has not been destroyed.
The Vulkan spec states: All child objects created on device that can be destroyed or freed must have been destroyed or freed prior to destroying device (https://docs.vulkan.org/spec/latest/chapters/devsandqueues.html#VUID-vkDestroyDevice-device-05137)
Objects: 2
    [0] VkDevice 0x7f9875643000
    [1] VkSemaphore 0xa610000000a61
Flags: needinfo?(stransky)

Thank you for the checking! The crash seemed to Bug 2037013.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: