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

Command encoder released without endEncoding - Validation error in wgpu on Win10, macOS 10.15, Debian 11 #24

Closed
simonsan opened this issue Oct 3, 2021 · 24 comments

Comments

@simonsan
Copy link
Contributor

simonsan commented Oct 3, 2021

[2021-10-03T21:36:28Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `pixels_command_encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters

', C:\Users\<user>\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.10.2\src\backend\direct.rs:2160:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Anything I can help with to diagnose the problem?

@rhysd
Copy link

rhysd commented Oct 4, 2021

This also occurs on macOS 10.15.

Here is the full backtrace:

[2021-10-04T07:42:51Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
In a RenderPass
note: encoder = pixels_command_encoder
In a set_scissor_rect command
Invalid ScissorRect parameters

', /Users/rhysd/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.10.2/src/backend/direct.rs:2160:5
stack backtrace:
0: 0x101404ec4 - std::backtrace_rs::backtrace::libunwind::trace::hd9b9204470182ffc
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
1: 0x101404ec4 - std::backtrace_rs::backtrace::trace_unsynchronized::hdc48b9180be04761
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x101404ec4 - std::sys_common::backtrace::_print_fmt::h8824de041faf4112
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:67:5
3: 0x101404ec4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d168763f08a78b9
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:46:22
4: 0x1014226ec - core::fmt::write::h0fa46d4891ed63f1
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/fmt/mod.rs:1115:17
5: 0x1014026fa - std::io::Write::write_fmt::hacbf9e10e17149ce
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/io/mod.rs:1665:15
6: 0x101406aff - std::sys_common::backtrace::_print::h26213154a400cfbe
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:49:5
7: 0x101406aff - std::sys_common::backtrace::print::h0f4ab60f53d1f93b
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:36:9
8: 0x101406aff - std::panicking::default_hook::{{closure}}::hee7cf38dedfa76fc
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:208:50
9: 0x1014065fd - std::panicking::default_hook::hd12252412832a45f
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:225:9
10: 0x101407200 - std::panicking::rust_panic_with_hook::h521fd09e07057893
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:622:17
11: 0x101406ca5 - std::panicking::begin_panic_handler::{{closure}}::h3588a5a9cca9e8e5
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:519:13
12: 0x101405368 - std::sys_common::backtrace::__rust_end_short_backtrace::h86522c151a195ff9
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18
13: 0x101406c0a - rust_begin_unwind
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
14: 0x10144726b - std::panicking::begin_panic_fmt::hf4ebaa1b90291b0b
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:457:5
15: 0x1013194ea - wgpu::backend::direct::default_error_handler::h08482503387f1c2b
16: 0x101311dd0 - core::ops::function::Fn::call::h220f0700d3201d9c
17: 0x101318e5d - <wgpu::backend::direct::Context as wgpu::Context>::command_encoder_end_render_pass::h36c07df2e4f51019
18: 0x10120ac1a - egui_wgpu_backend::RenderPass::execute::h287c71719488f6c5
19: 0x101134aac - binocle::gui::Gui::render::h9856efccf79f8e5e
20: 0x10112f0c9 - pixels::Pixels::render_with::he327fc2f8585b841
21: 0x10112c1ba - binocle::event_loop::run::{{closure}}::hc8ed2fffdf86aef8
22: 0x10112d147 - <winit::platform_impl::platform::app_state::EventLoopHandler as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::he574fa2556b453a2
23: 0x1012a6bc1 - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::h4e84ce779f567612
24: 0x1012a8c95 - winit::platform_impl::platform::app_state::AppState::cleared::h6028c81bcc2db529
25: 0x1012ab4e7 - winit::platform_impl::platform::observer::control_flow_end_handler::h7a06aff7e3095726
26: 0x7fff306b8e15 - ___CFRunLoopDoBlocks
27: 0x7fff306b8d47 - ___CFRunLoopDoBlocks
28: 0x7fff306b840c - ___CFRunLoopRun
29: 0x7fff306b791e - ___CFRunLoopModeIsEmpty
30: 0x7fff2f2e3abd - _RunCurrentEventLoopInMode
31: 0x7fff2f2e37d5 - _ReceiveNextEventCommon
32: 0x7fff2f2e3579 - __BlockUntilNextEventMatchingListInModeWithFilter
33: 0x7fff2d92a039 - __DPSNextEvent
34: 0x7fff2d928880 - -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
35: 0x7fff2d91a58e - -[NSApplication run]
36: 0x1011287aa - winit::platform_impl::platform::event_loop::EventLoop::run::hba1aaae693440197
37: 0x101161573 - winit::event_loop::EventLoop::run::hbdac6e9748eaa26c
38: 0x10116334c - binocle::event_loop::run::h1f98f2568edf9566
39: 0x101165519 - binocle::main::hdb07d61fbb325595
40: 0x101134cfa - std::sys_common::backtrace::__rust_begin_short_backtrace::h20a7982cfa28de2d
41: 0x10115e991 - std::rt::lang_start::{{closure}}::h55274b420cef70fe
42: 0x101407729 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h5adc1669b25f044b
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:259:13
43: 0x101407729 - std::panicking::try::do_call::h405f88a3fec16587
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
44: 0x101407729 - std::panicking::try::h86d9af92fb3c6022
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
45: 0x101407729 - std::panic::catch_unwind::h67150880d2b87901
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
46: 0x101407729 - std::rt::lang_start_internal::{{closure}}::h548e43d03023c928
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:48
47: 0x101407729 - std::panicking::try::do_call::h1383affbfec23244
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
48: 0x101407729 - std::panicking::try::hf51149bda74e8587
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
49: 0x101407729 - std::panic::catch_unwind::h8280208a4f5e7cf4
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
50: 0x101407729 - std::rt::lang_start_internal::h5f9b030f0a63c040
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:20
51: 0x101165639 - _main
-[_MTLCommandEncoder dealloc]:70: failed assertion `Command encoder released without endEncoding'
[1] 90145 abort RUST_BACKTRACE=full binocle target/debug/fixred


I also tried the head of branch db70c42 and confirmed the same error building in both release and debug mode.

@simonsan simonsan changed the title Validation error in wgpu on Win10 Validation error in wgpu on Win10 and macOS 10.15 Oct 4, 2021
@simonsan simonsan changed the title Validation error in wgpu on Win10 and macOS 10.15 Command encoder released without endEncoding - Validation error in wgpu on Win10 and macOS 10.15 Oct 4, 2021
@quackduck
Copy link

Also occurs on macOS 11.6, 2017 Intel Macbook Air:

[2021-10-04T17:58:15Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `pixels_command_encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters

', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.10.2/src/backend/direct.rs:2160:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-[_MTLCommandEncoder dealloc]:131: failed assertion `Command encoder released without endEncoding'

@sharkdp
Copy link
Owner

sharkdp commented Oct 4, 2021

Thank you for reporting this. I don't have a (native) Windows or MacOS system to test. I kind of just hoped that the binaries would work.

Any help would be very much appreciated.

The error seems to originate from wgpu (https://github.com/gfx-rs/wgpu/blob/76bcd9c494a4359853bc2caec8eebbaa990a34e3/wgpu-core/src/command/draw.rs#L92-L93, https://github.com/gfx-rs/wgpu/blob/76bcd9c494a4359853bc2caec8eebbaa990a34e3/wgpu-core/src/command/render.rs#L1221-L1227). There are a few (possibly) related issues on GitHub (e.g. iced-rs/iced#816).

It might have to do with the absolute WIDTH/HEIGHT parameters (and the actual screen size?) that are set for binocle here:

pub const WIDTH: u32 = 1366;
pub const HEIGHT: u32 = 1024;

Maybe someone could test setting them to other (lower?) values like 800x600?

@simonsan
Copy link
Contributor Author

simonsan commented Oct 5, 2021

Maybe someone could test setting them to other (lower?) values like 800x600?

I tried it, but still get the same error.

@rhysd
Copy link

rhysd commented Oct 5, 2021

set_scissor_rect is only called here in egui_wgpu_backend crate.

https://github.com/hasenbanck/egui_wgpu_backend/blob/74f63a071ff6578688f18d8091bf549d417b2c8f/src/lib.rs#L335

@simonsan simonsan changed the title Command encoder released without endEncoding - Validation error in wgpu on Win10 and macOS 10.15 Command encoder released without endEncoding - Validation error in wgpu on Win10, macOS 10.15, Debian 11 Oct 5, 2021
@simonsan
Copy link
Contributor Author

simonsan commented Oct 5, 2021

I checked it on my Debian 11 system and it throws the same error.

@tan-wei
Copy link

tan-wei commented Oct 6, 2021

Met the same issue on MacOS and Windows.

@JiLiZART
Copy link

JiLiZART commented Oct 7, 2021

Same problem

You can see FULL backtrace below

env RUST_BACKTRACE=full binocle test.jsc
[2021-10-07T07:40:30Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `pixels_command_encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters

', /Users/jilizart/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.10.2/src/backend/direct.rs:2160:5
stack backtrace:
   0:        0x10298cbd4 - std::backtrace_rs::backtrace::libunwind::trace::hd9b9204470182ffc
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:        0x10298cbd4 - std::backtrace_rs::backtrace::trace_unsynchronized::hdc48b9180be04761
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x10298cbd4 - std::sys_common::backtrace::_print_fmt::h8824de041faf4112
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:67:5
   3:        0x10298cbd4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d168763f08a78b9
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:46:22
   4:        0x1029aa3fc - core::fmt::write::h0fa46d4891ed63f1
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/fmt/mod.rs:1115:17
   5:        0x10298a40a - std::io::Write::write_fmt::hacbf9e10e17149ce
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/io/mod.rs:1665:15
   6:        0x10298e80f - std::sys_common::backtrace::_print::h26213154a400cfbe
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:49:5
   7:        0x10298e80f - std::sys_common::backtrace::print::h0f4ab60f53d1f93b
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:36:9
   8:        0x10298e80f - std::panicking::default_hook::{{closure}}::hee7cf38dedfa76fc
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:208:50
   9:        0x10298e30d - std::panicking::default_hook::hd12252412832a45f
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:225:9
  10:        0x10298ef10 - std::panicking::rust_panic_with_hook::h521fd09e07057893
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:622:17
  11:        0x10298e9b5 - std::panicking::begin_panic_handler::{{closure}}::h3588a5a9cca9e8e5
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:519:13
  12:        0x10298d078 - std::sys_common::backtrace::__rust_end_short_backtrace::h86522c151a195ff9
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18
  13:        0x10298e91a - rust_begin_unwind
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
  14:        0x1029cef7b - std::panicking::begin_panic_fmt::hf4ebaa1b90291b0b
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:457:5
  15:        0x1028a11fa - wgpu::backend::direct::default_error_handler::h6d7a2ce79deec755
  16:        0x102899ae0 - core::ops::function::Fn::call::hf7dbc75eeffb9340
  17:        0x1028a0b6d - <wgpu::backend::direct::Context as wgpu::Context>::command_encoder_end_render_pass::hfd5ba570bf76c3b6
  18:        0x10279292a - egui_wgpu_backend::RenderPass::execute::hcff90a062f822137
  19:        0x1026bc63c - binocle::gui::Gui::render::ha9e59e84680cb6ff
  20:        0x1026b6c59 - pixels::Pixels::render_with::hdb22eb48c60820be
  21:        0x1026b3d4a - binocle::event_loop::run::{{closure}}::hadc2a99b6c85b4c9
  22:        0x1026b4cd7 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::he369832bac4dc772
  23:        0x10282e8d1 - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::h4e84ce779f567612
  24:        0x1028309a5 - winit::platform_impl::platform::app_state::AppState::cleared::h6028c81bcc2db529
  25:        0x1028331f7 - winit::platform_impl::platform::observer::control_flow_end_handler::h7a06aff7e3095726
  26:     0x7fff20454d01 - <unknown>
  27:     0x7fff20454b95 - <unknown>
  28:     0x7fff20454166 - <unknown>
  29:     0x7fff2045361c - <unknown>
  30:     0x7fff28699a83 - <unknown>
  31:     0x7fff286997e5 - <unknown>
  32:     0x7fff28699583 - <unknown>
  33:     0x7fff22c5b172 - <unknown>
  34:     0x7fff22c59945 - <unknown>
  35:     0x7fff22c4bc69 - <unknown>
  36:        0x1026b033a - winit::platform_impl::platform::event_loop::EventLoop<T>::run::h5bc5452d0bb554b0
  37:        0x1026e9283 - winit::event_loop::EventLoop<T>::run::h5e8cb8089d1588c7
  38:        0x1026eb05c - binocle::event_loop::run::h303925b133e506be
  39:        0x1026ed229 - binocle::main::h67e417241ee8838d
  40:        0x1026bc88a - std::sys_common::backtrace::__rust_begin_short_backtrace::hb4e5ebb094580cbd
  41:        0x1026e66a1 - std::rt::lang_start::{{closure}}::hd64f067cbe88cad4
  42:        0x10298f439 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h5adc1669b25f044b
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:259:13
  43:        0x10298f439 - std::panicking::try::do_call::h405f88a3fec16587
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
  44:        0x10298f439 - std::panicking::try::h86d9af92fb3c6022
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
  45:        0x10298f439 - std::panic::catch_unwind::h67150880d2b87901
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
  46:        0x10298f439 - std::rt::lang_start_internal::{{closure}}::h548e43d03023c928
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:48
  47:        0x10298f439 - std::panicking::try::do_call::h1383affbfec23244
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
  48:        0x10298f439 - std::panicking::try::hf51149bda74e8587
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
  49:        0x10298f439 - std::panic::catch_unwind::h8280208a4f5e7cf4
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
  50:        0x10298f439 - std::rt::lang_start_internal::h5f9b030f0a63c040
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:20
  51:        0x1026ed349 - _main
-[_MTLCommandEncoder dealloc]:131: failed assertion `Command encoder released without endEncoding'
fish: 'env RUST_BACKTRACE=full binocle…' terminated by signal SIGABRT (Abort)

@akatsuki105
Copy link

Same problem occurred on M1 MacOS.

Environment

Model Name: MacBook Air
Model Identifier: MacBookAir10,1
Chip: Apple M1
Memory: 16 GB
OS: macOS Big Sur 11.4

# use cargo for install
cargo 1.55.0 (32da73ab1 2021-08-23)

Log

❯ env RUST_BACKTRACE=full binocle PM_PRISM.gbc
[2021-10-07T19:36:02Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `pixels_command_encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters

', /Users/akatsuki/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.10.2/src/backend/direct.rs:2160:5
stack backtrace:
   0:        0x10487c904 - std::backtrace_rs::backtrace::libunwind::trace::h5bc01f52da331a76
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:        0x10487c904 - std::backtrace_rs::backtrace::trace_unsynchronized::hed9f5f7d35868621
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x10487c904 - std::sys_common::backtrace::_print_fmt::hbabfbab394a5b2a4
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:67:5
   3:        0x10487c904 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he94cf96d727dca88
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:46:22
   4:        0x104897d5c - core::fmt::write::hba755d202326a972
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/fmt/mod.rs:1115:17
   5:        0x10487a45c - std::io::Write::write_fmt::h2e794551090dcd0d
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/io/mod.rs:1665:15
   6:        0x10487e390 - std::sys_common::backtrace::_print::hb13f9bf532a85f20
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:49:5
   7:        0x10487e390 - std::sys_common::backtrace::print::h8bcbb8e054752f0b
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:36:9
   8:        0x10487e390 - std::panicking::default_hook::{{closure}}::ha49ee092c99defdc
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:208:50
   9:        0x10487dec4 - std::panicking::default_hook::h878922f48a642f60
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:225:9
  10:        0x10487e9d8 - std::panicking::rust_panic_with_hook::h1daadfa06b290a08
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:622:17
  11:        0x10487e520 - std::panicking::begin_panic_handler::{{closure}}::h34f1299f5ae837e5
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:519:13
  12:        0x10487cd94 - std::sys_common::backtrace::__rust_end_short_backtrace::hcec1a6222a82e10c
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18
  13:        0x10487e484 - rust_begin_unwind
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
  14:        0x1048b7bd4 - std::panicking::begin_panic_fmt::he2b82579df33f7af
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:457:5
  15:        0x1047b8fac - wgpu::backend::direct::default_error_handler::hc7e3e0a37009e08a
  16:        0x1047b2a84 - core::ops::function::Fn::call::h1d2c8c7dcf7edc4e
  17:        0x1047b89b0 - <wgpu::backend::direct::Context as wgpu::Context>::command_encoder_end_render_pass::hf68437ce966ff6b5
  18:        0x1046cf97c - egui_wgpu_backend::RenderPass::execute::hb4df5759194e7835
  19:        0x1046209b4 - binocle::gui::Gui::render::h892d5ec1ba3a8a9a
  20:        0x10461c0a0 - pixels::Pixels::render_with::h093666ade3a4adce
  21:        0x104619680 - binocle::event_loop::run::{{closure}}::h554a59b3d1bbeaa0
  22:        0x10461a4e4 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::hc276eb29c2a0ea9c
  23:        0x10474fb58 - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::h768e976a33efe7ed
  24:        0x1047517cc - winit::platform_impl::platform::app_state::AppState::cleared::hc8bfbb698ade83e3
  25:        0x104753b3c - winit::platform_impl::platform::observer::control_flow_end_handler::h8943515001931390
  26:        0x18069dcc8 - <unknown>
  27:        0x18069db14 - <unknown>
  28:        0x18069d17c - <unknown>
  29:        0x18069c5e8 - <unknown>
  30:        0x1885b72a0 - <unknown>
  31:        0x1885b7014 - <unknown>
  32:        0x1885b6dd4 - <unknown>
  33:        0x182e8b480 - <unknown>
  34:        0x182e89e20 - <unknown>
  35:        0x182e7bcac - <unknown>
  36:        0x1046162a4 - winit::platform_impl::platform::event_loop::EventLoop<T>::run::h7a09a9112611bdb8
  37:        0x10464aca0 - winit::event_loop::EventLoop<T>::run::h7d2cfc3630d5dfc4
  38:        0x10464c590 - binocle::event_loop::run::h2215f87075e3354e
  39:        0x10464e498 - binocle::main::h40910ed9e9268e67
  40:        0x104620bd0 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha08954ce2f1ff040
  41:        0x10462358c - std::rt::lang_start::{{closure}}::h63f9deb1c3f1f84d
  42:        0x10487eeb0 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::he38288968a08ce30
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:259:13
  43:        0x10487eeb0 - std::panicking::try::do_call::hc5ee1d2a64b67a7c
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
  44:        0x10487eeb0 - std::panicking::try::h6456708f12a6b661
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
  45:        0x10487eeb0 - std::panic::catch_unwind::h0912a030777d678b
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
  46:        0x10487eeb0 - std::rt::lang_start_internal::{{closure}}::hd9cb206594099c49
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:48
  47:        0x10487eeb0 - std::panicking::try::do_call::h75969ed557adb08d
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
  48:        0x10487eeb0 - std::panicking::try::hd457662d949840e3
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
  49:        0x10487eeb0 - std::panic::catch_unwind::he3438363c58e9600
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
  50:        0x10487eeb0 - std::rt::lang_start_internal::h103433e957e14c30
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:20
  51:        0x10464e5a8 - _main
-[_MTLCommandEncoder dealloc]:131: failed assertion `Command encoder released without endEncoding'
zsh: abort      env RUST_BACKTRACE=full binocle PM_PRISM.gbc

@simonsan
Copy link
Contributor Author

Any updates on this? Which operating system and general setup is it being tested on and successfully working? @sharkdp

@sharkdp
Copy link
Owner

sharkdp commented Oct 15, 2021

No updates from me. As I said, I would need help from someone with MacOS/Windows and preferably some knowledge of wgpu.

It's working fine for me on (Arch) Linux, x86.

@simonsan
Copy link
Contributor Author

No updates from me. As I said, I would need help from someone with MacOS/Windows and preferably some knowledge of wgpu.

It's working fine for me on (Arch) Linux, x86.

Hmm ok, as far as I'm concerned it's not working on Debian Linux x86_64 , though :/ I haven't found a system it's working on tbh. :(

@sharkdp
Copy link
Owner

sharkdp commented Oct 16, 2021

Hmm ok, as far as I'm concerned it's not working on Debian Linux x86_64 , though :/ I haven't found a system it's working on tbh. :(

Oh :-/. It's working on Ubuntu 20.04 for me as well.

Could someone please try to run this minimal example here: https://github.com/parasyte/pixels/tree/master/examples/egui-winit? This is what binocle is based on. This should allow us to see if I did something wrong in this project. Or if it's a more fundamental issue.

@simonsan
Copy link
Contributor Author

Could someone please try to run this minimal example here: https://github.com/parasyte/pixels/tree/master/examples/egui-winit? This is what binocle is based on. This should allow us to see if I did something wrong in this project. Or if it's a more fundamental issue.

It works for me. (Tested on Win10 19043)

@sharkdp
Copy link
Owner

sharkdp commented Oct 17, 2021

I updated the dependencies for binocle. Could someone please build from master and try again? If that doesn't work, I can also provide binaries.

@simonsan
Copy link
Contributor Author

I updated the dependencies for binocle. Could someone please build from master and try again? If that doesn't work, I can also provide binaries.

Compiled from master, same error.

@sharkdp
Copy link
Owner

sharkdp commented Oct 17, 2021

Thank you.

I tried to run binocle in a Debian docker container and it worked fine after installing vulkan graphics libraries. Before that, it didn't work at all (No suitable wgpu::Adapter found), but I could not reproduce the error.

To further debug this, it might be helpful to set a few environment variables:

export RUST_BACKTRACE=1
export RUST_LOG=trace

Could you try to run it with these variables set?

It might also help to request another GPU (if you have an integrated GPU and a dedicated graphics card, for example):

WGPU_POWER_PREF=high

@sharkdp
Copy link
Owner

sharkdp commented Oct 17, 2021

I also found another weird thing which I just fixed on master. It might be worth to update to the latest commit and try again.

@sharkdp
Copy link
Owner

sharkdp commented Oct 17, 2021

I released a new version if someone else wants to give this a try: https://github.com/sharkdp/binocle/releases/tag/v0.1.2

@simonsan
Copy link
Contributor Author

simonsan commented Oct 17, 2021

I released a new version if someone else wants to give this a try: https://github.com/sharkdp/binocle/releases/tag/v0.1.2

Tried it with an uploaded binary from the releases on Windows (x68_64) and now it works.

Could you publish on crates.io please, as well?

@sharkdp
Copy link
Owner

sharkdp commented Oct 17, 2021

Tried it with an uploaded binary from the releases on Windows (x68_64) and now it works.

awesome. thank you!

Could someone on MacOS verify if this fixes the problem as well?

Could you publish on crates.io please, as well?

Done

@quackduck
Copy link

Works on macOS! 🚀

@sharkdp
Copy link
Owner

sharkdp commented Oct 17, 2021

Thank you! I'm going to close this for now.

@sharkdp sharkdp closed this as completed Oct 17, 2021
@simonsan
Copy link
Contributor Author

@sharkdp Thank you :)

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

No branches or pull requests

7 participants