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

Device is lost on everything #4224

Closed
louis-le-cam opened this issue Oct 10, 2023 · 11 comments · Fixed by #4709
Closed

Device is lost on everything #4224

louis-le-cam opened this issue Oct 10, 2023 · 11 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

@louis-le-cam
Copy link

louis-le-cam commented Oct 10, 2023

Description
Device is lost error on pretty much everything

Some example don't crash with device is lost but are just freezed windows (I can move them with a second of latency) (examples: hello-windows, cube)

I come from bevy and I saw wgpu validation messages saying "Device is lost" on a default app

Repro steps
Run any example (for example shadow)

Expected vs observed behavior
I expect application to render something and not crash

Extra materials
The problem is certainly related to my hardware

cargo run --bin shadow
   Compiling wgpu-shadow-example v0.17.1 (C:\Users\Louis Le Cam\Downloads\wgpu-0.17\examples\shadow)
    Finished dev [unoptimized + debuginfo] target(s) in 20.28s
     Running `target\debug\shadow.exe`
Using Intel(R) HD Graphics 4600 (Dx12)
[2023-10-10T05:32:58Z ERROR wgpu_hal::auxil::dxgi::result] Buffer creation failed: 0x887A0005
[2023-10-10T05:32:58Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Queue::write_buffer
    Parent device is lost

', wgpu\src\backend\direct.rs:3056:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\shadow.exe` (exit code: 101)

Platform
wgpu 0.17
Window 10.0.19045 Pro
HP ProBook 650 G1
Intel(R) Core(TM) i5-4310M CPU @ 2.70GHz 2.70 GHz

@cwfitzgerald
Copy link
Member

I suspect you need to update your drivers. Intel doesn't support DX12 on haswell (4xxx) for a while now. This, unfortunately puts you in the users who have to use ANGLE as neither dx12 or vulkan is supported

@teoxoy
Copy link
Member

teoxoy commented Oct 10, 2023

I feel like intel messed up and downgraded the feature level from 12 to 11 but are still advertising support for the D3D12 API. This isn't the first issue where we get an adapter/device that fails if you do anything with it.
#4007 (comment)

Are they supposed to still support D3D12 but on FL11_1? If not, we should blacklist those devices ourselves.

@louis-le-cam
Copy link
Author

I tried upgrading my graphics drivers but it still doesn't work

@cwfitzgerald
Copy link
Member

Try wgpu trunk's examples not with WGPU_BACKEND=gl

@louis-le-cam
Copy link
Author

WGPU_BACKEND=gl lead to a panic No suitable GPU adapters found on the system at examples\common\src\framework.rs:188:10

My temporary solution is to use google/swiftshader but it's extremly slow

@cwfitzgerald
Copy link
Member

That's surprising - could you run again with both WGPU_BACKEND=gl and RUST_LOG=trace

@louis-le-cam
Copy link
Author

Here is the log:

[2023-10-25T11:38:15Z TRACE wgpu_core::instance] Instance::new: backend Vulkan not requested
[2023-10-25T11:38:15Z TRACE wgpu_core::instance] Instance::new: backend Dx12 not requested
[2023-10-25T11:38:15Z TRACE wgpu_core::instance] Instance::new: backend Dx11 not requested
[2023-10-25T11:38:15Z DEBUG wgpu_core::instance] Instance::new: failed to create Gl backend: InstanceError { message: "unable to open libEGL", source: Some(Library(LoadLibraryExW { source: Os { code: 126, kind: Uncategorized, message: "The specified module could not be found." } })) }
[2023-10-25T11:38:15Z TRACE wgpu_core::instance] Instance::pick_adapter
thread 'main' panicked at 'No suitable GPU adapters found on the system!', wgpu-trunk\examples\common\src\framework.rs:188:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2023-10-25T11:38:15Z INFO  wgpu_core::global] Dropping Global
error: process didn't exit successfully: `target\debug\cube.exe` (exit code: 101)```

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Oct 25, 2023

Ah I see

Make sure you're on the latest trunk - it's still searching for egl, which means you're behind WGL support merging.

This is just normal native windows you're building for?

@louis-le-cam
Copy link
Author

Using the latest trunk + WGPU_BACKEND=gl worked, thank you.

However, it still selects dx12 by default. Maybe this could be fixed.

@cwfitzgerald
Copy link
Member

Yeah we probably should bail out of dx12 on haswell/broadwell

@teoxoy teoxoy added external: driver-bug A driver is causing the bug, though we may still want to work around it api: dx12 Issues with DX12 or DXGI labels Nov 17, 2023
@teoxoy
Copy link
Member

teoxoy commented Nov 17, 2023

@cwfitzgerald I think the intel drivers for broadwell should still work.

https://www.intel.com/content/www/us/en/support/articles/000057520/graphics.html only lists haswell.

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.

3 participants