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

Assert failed in Dx12 backend during queue_write_buffer #1319

Closed
Imberflur opened this issue Apr 10, 2021 · 12 comments · Fixed by #4709
Closed

Assert failed in Dx12 backend during queue_write_buffer #1319

Imberflur opened this issue Apr 10, 2021 · 12 comments · Fixed by #4709
Labels
api: dx12 Issues with DX12 or DXGI external: driver-bug A driver is causing the bug, though we may still want to work around it

Comments

@Imberflur
Copy link
Contributor

Description
I received a report that an assert failed during this call.

Repro steps
checkout imbris/wgpu-master-rebased from https://gitlab.com/veloren/veloren and run in Dx12 backend (WGPU_BACKEND=Dx12) (I have not reproduced this myself. I suspect it is specific to the GPU/driver)

Expected vs observed behavior
no panic vs panic

Extra materials

  • Panic:
PanicInfo: panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `-2005270523`', C:\Users\D\.cargo\git\checkouts\gfx-e86e7f3ebdbc4218\2a93d52\src\backend\dx12\src\device.rs:2438:9

I think this corresponds to 0x887A0005 or DXGI_ERROR_DEVICE_REMOVED
the call to CreatePlacedResource appears to fail: https://github.com/gfx-rs/gfx/blob/2a93d52661aafcbd6441ea83e739c8ced906cd21/src/backend/dx12/src/device.rs#L2440

  • Backtrace:
  12: core::panicking::assert_failed_inner
             at /rustc/f82664191d0e8764b7435b9d72eb0e366b8b1464\/library\core\src\panicking.rs:160
  13: core::panicking::assert_failed<i32,i32>
             at C:\Users\D\.rustup\toolchains\nightly-2021-03-22-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panicking.rs:117
  14: gfx_backend_dx12::device::{{impl}}::bind_buffer_memory
             at C:\Users\D\.cargo\git\checkouts\gfx-e86e7f3ebdbc4218\2a93d52\src\backend\dx12\src\device.rs:2438
  15: wgpu_core::device::alloc::MemoryBlock<gfx_backend_dx12::Backend>::bind_buffer
             at C:\Users\D\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\e430cf4\wgpu-core\src\device\alloc.rs:98
  16: wgpu_core::device::Device<gfx_backend_dx12::Backend>::prepare_stage<gfx_backend_dx12::Backend>
             at C:\Users\D\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\e430cf4\wgpu-core\src\device\queue.rs:135
  17: wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>::queue_write_buffer<wgpu_core::hub::IdentityManagerFactory,gfx_backend_dx12::Backend>  
             at C:\Users\D\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\e430cf4\wgpu-core\src\device\queue.rs:223
  18: wgpu::backend::direct::{{impl}}::queue_write_buffer
             at C:\Users\D\.cargo\git\checkouts\wgpu-rs-40ea39809c03c5d8\1de388a\src\backend\direct.rs:1831
  19: wgpu::Queue::write_buffer
             at C:\Users\D\.cargo\git\checkouts\wgpu-rs-40ea39809c03c5d8\1de388a\src\lib.rs:2839
  20: veloren_voxygen::render::buffer::DynamicBuffer<veloren_voxygen::render::pipelines::ui::Vertex>::update
             at voxygen\src\render\buffer.rs:49
  21: veloren_voxygen::render::model::DynamicModel<veloren_voxygen::render::pipelines::ui::Vertex>::update
             at voxygen\src\render\model.rs:71
  22: veloren_voxygen::render::renderer::Renderer::update_model
             at voxygen\src\render\renderer.rs:1083

Platform
Windows 10, gfx-hal: 2a93d52, wgpu-rs: 1de388a
GPU and feature warning:

INFO wgpu_core::instance: Adapter Dx12 AdapterInfo { name: "Intel(R) HD Graphics 4600", vendor: 32902, device: 1042, device_type: IntegratedGpu }
Apr 10 13:45:24.591  WARN wgpu_core::instance: Missing internal features: INDEPENDENT_BLENDING | VERTEX_STORES_AND_ATOMICS | FRAGMENT_STORES_AND_ATOMICS
@kvark kvark added the type: bug Something isn't working label Apr 10, 2021
@kvark
Copy link
Member

kvark commented Apr 10, 2021

Thank you for filing! Please provide an API trace.

@Imberflur
Copy link
Contributor Author

error in visual studio

D3D12: Removing Device.
D3D12 ERROR: ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #232: DEVICE_REMOVAL_PROCESS_AT_FAULT]
Exception thrown at 0x00007FFB19F4D759 in veloren-voxygen.exe: Microsoft C++ exception: _com_error at memory location 0x0000009AF977D3B0.
Exception thrown at 0x00007FFB19F4D759 in veloren-voxygen.exe: Microsoft C++ exception: _com_error at memory location 0x0000009AF977D728.
Exception thrown at 0x00007FFB19F4D759 in veloren-voxygen.exe: Microsoft C++ exception: _com_error at memory location 0x0000009AF977E510.
Exception thrown at 0x00007FFB19F4D759 in veloren-voxygen.exe: Microsoft C++ exception: _com_error at memory location 0x0000009AF977E990.

(api trace may be available soon)

@kvark
Copy link
Member

kvark commented Apr 10, 2021

Another way you could help is running this from Visual Studio and seeing what the validation layer thinks about this error.
Edit: ah, ok, nothing interesting by the validation then

@Imberflur
Copy link
Contributor Author

wgpu-trace.zip

@Imberflur
Copy link
Contributor Author

image

@Imberflur
Copy link
Contributor Author

Edit: ah, ok, nothing interesting by the validation then

So this error message from VS doesn't really give us any useful information?

@kvark
Copy link
Member

kvark commented Apr 11, 2021

That's an unfortunate thing. The error basically means a GPU crash, the conditions for which weren't caught by DX runtime validation. Note that this is DX11.1 class hardware, and it's always been a little tricky. We fully intent to ship on it though, so we want this solved.
I'll try to see if we can submit a bug somewhere for Intel or Microsoft to have a look.

(fwiw, the trace works fine on a modern GPU)

@kvark
Copy link
Member

kvark commented Apr 11, 2021

Could you please use the helper tool to get information about the system/driver versions? I'm going to submit a bug there, unless you want to.
Note: we'd want to provide a repro case based on the API trace, not the whole veloren.

@Imberflur
Copy link
Contributor Author

unknown2
@kvark

@kvark
Copy link
Member

kvark commented Apr 12, 2021

Thank you! Filed as IGCIT/Intel-GPU-Community-Issue-Tracker-IGCIT#44

@kvark kvark added the external: driver-bug A driver is causing the bug, though we may still want to work around it label Apr 12, 2021
@kvark kvark added this to the WebGPU MVP milestone May 21, 2021
@cwfitzgerald
Copy link
Member

Closing as stale due to hal rewrite, please refile if it's still an issue.

@cwfitzgerald cwfitzgerald closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2022
@Imberflur
Copy link
Contributor Author

👍 Whenever we update we will see if any users still report this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dx12 Issues with DX12 or DXGI external: driver-bug A driver is causing the bug, though we may still want to work around it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants