-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Crash with AMD GPU #27
Comments
Hi, |
Sorry, seems like my display has no serial number 😆 Display 1 And using some other identifier like |
Ok, |
Yes, I use sway.
|
Ok thank you, we will back too you asap 👍🏻 |
To be sure, can you rollback your config to the one attach in the beginning of the issue and give us the few first lines of |
Thanks for reporting @xenrox, and thanks to both of you for helping investigate the problem! There seems to be two issues at hand, one about matching to a proper ddcutil when capturer is none (capturer should not really affect this, so the cause might be actually somewhere else), another about vulkan crash. We'll try to get to the bottom of both issues, starting from us providing a dev build with extra debugging info, which should help us narrow down the problem. We'll ping you soon 🙂 Vulkan issue can be tough to fix without having a way to locally reproduce, so just wanted to ask if you would in theory feel adventurous and willing to try helping us fix it? 🙂 I'm almost sure that the issue is due to the fact that I'm using Vulkan API incorrectly, I must have hardcoded some assumptions, and it happens to work on all of our laptops simply because integrated GPU shares memory with CPU and/or RAM, so even "improper" params still allow code to work, while on your desktop you have a real independent GPU, which complains on allocating things that were not supposed to be allocated. Will do my best to help guiding you if you want to help with this, although I'm clearly no Vulkan expert myself, I just hack it until it works 😁 The only temporary alternative would be using capturer "none" on your desktop until this is properly solved, where wluma would simply use ALS (hour in your case), but not the actual screen contents. |
|
@maximbaz I have applied #28 and here is the new output if that helps: config
Edit: This is with capturer none. |
Made some progress: wluma/src/brightness/ddcutil.rs Line 60 in 4538b69
After fixing that (substituted serial_number with model_id) it can actually match my display (no more warning) but still fails at getting the intial brightness
|
Which in turn gets fixed by increasing
|
Very interesting, thanks for sharing! Will make the necessary adjustment tomorrow for the serial number, you are right we indeed didn't anticipate that it might be None in a valid scenario. And as for timeout, interesting..... Could also be (at least partially) a debug build to blame, but still, never happened to us so far... Out of curiosity you can try to experiment by adding some logging in ddcutil.rs in get() method to see how long it executes - just to get an idea if your guess was correct. |
Yes on a non debug build it works with default settings, on a debug build it takes slightly less than 4 seconds.
|
With 4044541 the missing serial number should be fixed, together with having more debug logging to identify why displays are not being matched. Untested by hopefully will work 😛 DDC/I2C errors like the above is something @cyrinux experienced as well (I dont use external monitors so we've been testing on his setup), we concluded that it's just transient errors that we can't do anything about - although for him the errors only happened if he was messing with screen using To clarify, as long as the errors are transient, the app should just work, we log and ignore those errors. Let me summarize to see if I remember it all correctly, the state with the latest
Everything correct? |
Yeah matching works fine now, thanks a lot!
I was using ddcutil in parallel to train wluma. Thanks for the explanation.
Correct! (Just had to slightly increase |
Can you tell me by how much are you increasing |
Yes 5 is enough, it only failed one or two times with 4. |
As long a you can use it to train wluma, yes just disregard the errors - maybe they should have been warnings really, but I wanted to see if someone experiences those issues in other scenarios. We want to add CLI to wluma, so that it will be possible to train it natively, without any potential conflicts between different tools who all want exclusive access to the same resource. But until that happens, if ddcutil works for the purpose, just use it 🙂 I increased the timeout, of course just let me know if you still manage to see issues with It seems there is just one outstanding issue left, proper support for independent GPU for If you want to make a head start, here's what you can do:
This is an extremely helpful tool, it will log all wrongdoings related to Vulkan. On my machine it produces no issues, but I'm willing to bet that on your desktop we will get some nice errors to fix. |
Yes, I am on Arch.
|
Perfect, at least we will not be walking in the dark, but we have precise description of what to fix, with helpful links 😁 Will share some hints in case you want to try to play around, if not - no big deal, we will get to this eventually 😉 It crashes on mapping the memory here: wluma/src/frame/processor/vulkan.rs Line 66 in a57c4f7
It tried to map the memory to the following allocated buffer: wluma/src/frame/processor/vulkan.rs Line 165 in a57c4f7
Which was allocated in some memory that fits these requirements: wluma/src/frame/processor/vulkan.rs Line 159 in a57c4f7
Specifically, I'm nearly positive that the bug is here: wluma/src/frame/processor/vulkan.rs Line 161 in a57c4f7
Instead of picking the index of the right memory, we just pass The fix could be as simple as trying to hardcode there If you do look into it, please keep us posted how it goes! |
Guys, I reproduce the same bug and can confirm that putting 1 doesnt crash. |
Thanks to you too 🙂 |
Hey,
I wanted to try wluma with ddcutil support on my desktop but it crashes immediately (I tried both amdvlk and vulkan-radeon since it seems to be a vulkan issue).
On my notebook with an integrated Intel GPU it runs fine, unless I connect my external display, then it fails here:
wluma/src/predictor/controller.rs
Line 69 in 4538b69
ddcutil by itself works completely fine as the same user that runs wluma:
I appended my config and the backtrace.
config
backtrace
Continue adjusting brightness and wluma will learn your preference over time.
thread 'predictor-LG HDR 4K' panicked at 'Unable to compute luma percent: ERROR_MEMORY_MAP_FAILED', src/frame/capturer/wlroots.rs:124:26
stack backtrace:
0: rust_begin_unwind
at /rustc/1.58.0/library/std/src/panicking.rs:498:5
1: core::panicking::panic_fmt
at /rustc/1.58.0/library/core/src/panicking.rs:107:14
2: core::result::unwrap_failed
at /rustc/1.58.0/library/core/src/result.rs:1613:5
3: core::result::Result<T,E>::expect
at /rustc/1.58.0/library/core/src/result.rs:1255:23
4: wluma::frame::capturer::wlroots::Capturer::capture_frame::{{closure}}
at ./src/frame/capturer/wlroots.rs:121:32
5: wayland_client::proxy::Main::quick_assign::{{closure}}
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-client-0.29.4/src/proxy.rs:273:64
6: wayland_commons::filter::Filter::send
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-commons-0.29.4/src/filter.rs:100:13
7: wayland_client::imp::make_dispatcher::{{closure}}
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-client-0.29.4/src/rust_imp/mod.rs:194:49
8: <wayland_client::imp::ImplDispatcher<I,F> as wayland_client::imp::Dispatcher>::dispatch
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-client-0.29.4/src/rust_imp/mod.rs:179:9
9: wayland_client::imp::queues::EventQueueInner::dispatch_buffer
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-client-0.29.4/src/rust_imp/queues.rs:163:23
10: wayland_client::imp::queues::EventQueueInner::dispatch_pending
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-client-0.29.4/src/rust_imp/queues.rs:198:31
11: wayland_client::imp::queues::EventQueueInner::dispatch
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-client-0.29.4/src/rust_imp/queues.rs:102:28
12: wayland_client::event_queue::EventQueue::dispatch
at /home/xenrox/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/wayland-client-0.29.4/src/event_queue.rs:152:9
13: <wluma::frame::capturer::wlroots::Capturer as wluma::frame::capturer::Capturer>::run
at ./src/frame/capturer/wlroots.rs:60:13
14: wluma::main::{{closure}}::{{closure}}
at ./src/main.rs:99:21
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.The text was updated successfully, but these errors were encountered: