-
Notifications
You must be signed in to change notification settings - Fork 187
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
x11 + GNOME/Wayland support #102
Conversation
I can confirm that it builds with newer deps There is a silent dependency on thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: Empty }', src/main.rs:210:49 Once you start it, it changes your cursor over X11 windows to a "cross" cursor, but when I click in the GI's window, it fails with: [2023-01-09T11:42:32Z INFO yas] left = 0, top = 0, width = 3840, height = 2160
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: failed to decode Protobuf message: invalid wire type value: 6', src/inference/inference.rs:33:52
stack backtrace:
0: 0x55bb9a5b8e73 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he3010f3ff51b55ac
1: 0x55bb9a5f53dc - core::fmt::write::hdfaf46c08a67cd92
2: 0x55bb9a5d2ad5 - std::io::Write::write_fmt::h0c8cb8452451d559
3: 0x55bb9a5d95d4 - std::panicking::default_hook::{{closure}}::h5f89d231703325b8
4: 0x55bb9a5d9214 - std::panicking::default_hook::h0daa4414d4591360
5: 0x55bb9a5d9bb3 - std::panicking::rust_panic_with_hook::hc7eecadc23f906e1
6: 0x55bb9a5b91d7 - std::panicking::begin_panic_handler::{{closure}}::h425c6c4810da3633
7: 0x55bb9a5b8fb4 - std::sys_common::backtrace::__rust_end_short_backtrace::h75a4c4b09ed50e09
8: 0x55bb9a5d98a2 - rust_begin_unwind
9: 0x55bb988baab3 - core::panicking::panic_fmt::hed5cc02befa9fbd6
10: 0x55bb988babe3 - core::result::unwrap_failed::he50d59caf960046c
11: 0x55bb9892859c - core::result::Result<T,E>::unwrap::h39a02265ef19c265
12: 0x55bb988f1955 - yas::inference::inference::CRNNModel::new::hb2bc588d872a6249
13: 0x55bb988ea7c8 - yas::scanner::yas_scanner::YasScanner::new::hec4916971100483b
14: 0x55bb988bed94 - yas::main::h5b2d9428909c513b
15: 0x55bb988baecb - core::ops::function::FnOnce::call_once::hab5d454436d5a6b5
16: 0x55bb988bb99e - std::sys_common::backtrace::__rust_begin_short_backtrace::h04929074ddc4d974
17: 0x55bb988c0841 - std::rt::lang_start::{{closure}}::hce1e3522327f47a0
18: 0x55bb9a5d1f08 - std::rt::lang_start_internal::h0b59928b60b7c3a2
19: 0x55bb988c081a - std::rt::lang_start::h357c7da2a3399e8f
20: 0x55bb988bf881 - main
21: 0x7f4c228fe24e - __libc_start_call_main
22: 0x7f4c228fe309 - __libc_start_main_alias_1
23: 0x55bb988badd5 - _start
24: 0x0 - <unknown> Could it have disliked the fact that I'm on XWayland? |
did you run let mut bytes = include_bytes!("../../models/model_acc100-epoch45.onnx");
// let mut bytes = include_bytes!("../../models/model_training.onnx");
let model = tract_onnx::onnx()
.model_for_read(&mut bytes.as_bytes()).unwrap()
.with_input_fact(0, InferenceFact::dt_shape(f32::datum_type(), tvec!(1, 1, 32, 384))).unwrap()
.into_optimized().unwrap()
.into_runnable().unwrap(); the model file should be fetched with Git LFS |
Sorry, that was indeed the issue.
Was I utilising the Wayland mode of it without realizing it? (with ╰─λ ./result/bin/yas --verbose --output-dir /tmp/yas/
[2023-01-09T14:55:04Z INFO yas] left = 0, top = 0, width = 3840, height = 2160
[2023-01-09T14:55:05Z INFO tract_linalg::x86_64_fma] mmm_f32, sigmoid_f32, tanh_f32: x86_64/fma activated
[2023-01-09T14:55:05Z INFO tract_linalg::x86_64_fma] mmm_i8_i8 and mmm_i8_i32: x86_64/avx2 activated
^C⏎ ╭─pedrohlc at desktop in ~/yas (linux-x11-support …2)
╰─λ la /tmp/yas/
total 0
╭─pedrohlc at desktop in ~/yas (linux-x11-support …2)
╰─λ env | grep DISPLAY
DISPLAY=:0 ╰─λ ./result/bin/yas --verbose --output-dir /tmp/yas/
[2023-01-09T14:57:01Z INFO yas] left = 0, top = 0, width = 3840, height = 2160
[2023-01-09T14:57:02Z INFO tract_linalg::x86_64_fma] mmm_f32, sigmoid_f32, tanh_f32: x86_64/fma activated
[2023-01-09T14:57:02Z INFO tract_linalg::x86_64_fma] mmm_i8_i8 and mmm_i8_i32: x86_64/avx2 activated
^C⏎ ╭─pedrohlc at desktop in ~/yas (linux-x11-support …2)
╰─λ la /tmp/yas/
total 0
╭─pedrohlc at desktop in ~/yas (linux-x11-support …2)
╰─λ env | grep DISPLAY
DISPLAY=:0
WAYLAND_DISPLAY=wayland-1 |
may you pls record repreduce steps for me?.. and sorry for my misinformation, screenshots-rs detects wayland session by both
|
It was not, but same result in both Chinese.
Ok, now I get the same crash as you. UPDATE: Also, the issue with XWayland seems to be time to capture+decode as you said. |
btw, it will call org.freedesktop.portal.ScreenShot Could you help me to implement a better pick_color for Wayland with PickColor method |
remove debug config in Cargo.toml update Cargo.lock
With or without ╰─λ RUST_BACKTRACE=full ./result/bin/yas --verbose --output-dir /tmp/
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: Empty }', src/main.rs:210:49
stack backtrace:
0: 0x559165737682 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0b60020a4713e5fb
1: 0x559165772d0c - core::fmt::write::hd2bbf674326f971d
2: 0x55916574b635 - std::io::Write::write_fmt::h9e09deb1651b82d4
3: 0x559165737441 - std::sys_common::backtrace::print::hb0f6f2fe5c4496c1
4: 0x559165758f1f - std::panicking::default_hook::{{closure}}::hf3d6d483953ab294
5: 0x559165758ba4 - std::panicking::default_hook::h7229a04a9f746202
6: 0x559165759559 - std::panicking::rust_panic_with_hook::h7c53bfc9ab300aca
7: 0x5591657379d7 - std::panicking::begin_panic_handler::{{closure}}::hc2a71b5a463ec201
8: 0x5591657377b4 - std::sys_common::backtrace::__rust_end_short_backtrace::he21bec3aa77e6ef6
9: 0x5591657590d2 - rust_begin_unwind
10: 0x559163a2a263 - core::panicking::panic_fmt::h136a2a3f69fc0251
11: 0x559163a2a623 - core::result::unwrap_failed::h656bdbcac2f79cc7
12: 0x559163a2f4b0 - core::result::Result<T,E>::unwrap::h06bff2424fe9a9de
13: 0x559163a2cf9a - yas::main::h09d2d47b704854de
14: 0x559163a2b3fb - core::ops::function::FnOnce::call_once::h2761a5f2a2c695da
15: 0x559163a2b22e - std::sys_common::backtrace::__rust_begin_short_backtrace::h7f004f0fc531b600
16: 0x559163a2b3b1 - std::rt::lang_start::{{closure}}::h51cb07d8dc8bc397
17: 0x55916574a484 - std::rt::lang_start_internal::h398023bd7970a80b
18: 0x559163a2b38a - std::rt::lang_start::h42181c3b39454930
19: 0x559163a2e70e - main
20: 0x7f11f36c124e - __libc_start_call_main
21: 0x7f11f36c1309 - __libc_start_main_alias_1
22: 0x559163a2a6f5 - _start
23: 0x0 - <unknown> (Sorry, I was traveling last weeks) |
well.. this error means you did not correctly click GI for xwininfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥要把version搞成env的形式,不从cargo.toml读取
此外为啥要用你fork的screenshot而不是原版 |
https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates 这样编译时可以直接拿到 |
原版的screenshots-rs在每个平台都把拿到的截图编码为png rgba8再给…… 然后你的screenshot这边我看了下是要一份bgra raw image? |
is_rmb_down
for linux/x11