Giter Club home page Giter Club logo

Comments (13)

kvark avatar kvark commented on September 28, 2024 4

I had this issue on a laptop that has Nvidia dGPU. Problem and solution can be found here - https://dev.getsol.us/T6335
Basically, the workaround is to force NVidia Vulkan ICD and never try Intel iGPU.
(this isn't wgpu-specific issue, it's just a sad story of Vulkan on Linux/Nvidia)

from learn-wgpu.

kunalmohan avatar kunalmohan commented on September 28, 2024 3

Yeah, sure. I completely forgot about this. Thanks for the help!

from learn-wgpu.

kunalmohan avatar kunalmohan commented on September 28, 2024 1

I switched to intel integrated gpu and there is no lag with that. But it causes panic on resizing with the following output:

thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 32765', /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/slice/mod.rs:2717:10
stack backtrace:
   0:     0x564d6d8e4674 - backtrace::backtrace::libunwind::trace::hda41dbcdfba36aa0
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:     0x564d6d8e4674 - backtrace::backtrace::trace_unsynchronized::h1a8d6e1f8cb3f5d4
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:     0x564d6d8e4674 - std::sys_common::backtrace::_print_fmt::h610c4127487e10da
                               at src/libstd/sys_common/backtrace.rs:76
   3:     0x564d6d8e4674 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0722dc552e01bd1d
                               at src/libstd/sys_common/backtrace.rs:60
   4:     0x564d6d90629c - core::fmt::write::h01edf6dd68a42c9c
                               at src/libcore/fmt/mod.rs:1030
   5:     0x564d6d8e1b77 - std::io::Write::write_fmt::hf15985f193f03c04
                               at src/libstd/io/mod.rs:1412
   6:     0x564d6d8e6b85 - std::sys_common::backtrace::_print::hd8d5d08a1795e743
                               at src/libstd/sys_common/backtrace.rs:64
   7:     0x564d6d8e6b85 - std::sys_common::backtrace::print::hf89a79e3921a2366
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x564d6d8e6b85 - std::panicking::default_hook::{{closure}}::h3a8f42beb3bb8ae3
                               at src/libstd/panicking.rs:196
   9:     0x564d6d8e6876 - std::panicking::default_hook::h8f803b0bc31a5c37
                               at src/libstd/panicking.rs:210
  10:     0x564d6d8e7285 - std::panicking::rust_panic_with_hook::h825f041245da8739
                               at src/libstd/panicking.rs:473
  11:     0x564d6d8e6e22 - std::panicking::continue_panic_fmt::hbe0378e33481e81b
                               at src/libstd/panicking.rs:380
  12:     0x564d6d8e6d16 - rust_begin_unwind
                               at src/libstd/panicking.rs:307
  13:     0x564d6d90269a - core::panicking::panic_fmt::h527855ce0bc891f6
                               at src/libcore/panicking.rs:85
  14:     0x564d6d902655 - core::panicking::panic_bounds_check::h3efaadd5b995f90a
                               at src/libcore/panicking.rs:61
  15:     0x564d6d86d7c7 - <usize as core::slice::SliceIndex<[T]>>::index::h0a651238b970f556
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/slice/mod.rs:2717
  16:     0x564d6d859778 - core::slice::<impl core::ops::index::Index<I> for [T]>::index::h68cc7c62aecf755e
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/slice/mod.rs:2568
  17:     0x564d6d83bedb - <alloc::vec::Vec<T> as core::ops::index::Index<I>>::index::h46ebffe98dfea77c
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/liballoc/vec.rs:1796
  18:     0x564d6d85b7a1 - <gfx_backend_vulkan::window::Surface as gfx_hal::window::PresentationSurface<gfx_backend_vulkan::Backend>>::acquire_image::h715647c680fbfc34
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/gfx-backend-vulkan-0.4.1/src/window.rs:507
  19:     0x564d6d7ee6db - wgpu_native::swap_chain::swap_chain_get_next_texture::h22a88d95ef3ffe78
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/swap_chain.rs:155
  20:     0x564d6d7ef304 - wgpu_swap_chain_get_next_texture
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/swap_chain.rs:212
  21:     0x564d6d636866 - wgpu::SwapChain::get_next_texture::h42c0ffd1c79531d2
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.4.0/src/lib.rs:1355
  22:     0x564d6d2521e5 - try_wgpu::State::render::h02010c43d7c1d0e4
                               at src/main.rs:118
  23:     0x564d6d233c7d - try_wgpu::main::{{closure}}::h410ba203815f2849
                               at src/main.rs:48
  24:     0x564d6d27f78d - winit::platform_impl::platform::sticky_exit_callback::h04e92edfa5438707
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/mod.rs:697
  25:     0x564d6d27b7a8 - winit::platform_impl::platform::x11::EventLoop<T>::run_return::h09d5b07aee8bc6fe
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/x11/mod.rs:277
  26:     0x564d6d27ce0b - winit::platform_impl::platform::x11::EventLoop<T>::run::h3a8df3fe1aebdcb2
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/x11/mod.rs:386
  27:     0x564d6d27f57e - winit::platform_impl::platform::EventLoop<T>::run::h22021ac5f0e88e76
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/mod.rs:644
  28:     0x564d6d2492c4 - winit::event_loop::EventLoop<T>::run::he611cc003761aeb0
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/event_loop.rs:148
  29:     0x564d6d251d97 - try_wgpu::main::hf5dd9c0cb7449a73
                               at src/main.rs:12
  30:     0x564d6d286ec0 - std::rt::lang_start::{{closure}}::h9e5098d20c41fd21
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  31:     0x564d6d8e6cb3 - std::rt::lang_start_internal::{{closure}}::ha04574f12d97cbe2
                               at src/libstd/rt.rs:49
  32:     0x564d6d8e6cb3 - std::panicking::try::do_call::h7c2a8488f72db90c
                               at src/libstd/panicking.rs:292
  33:     0x564d6d8ea98a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  34:     0x564d6d8e777d - std::panicking::try::hc3a9b5da4250385d
                               at src/libstd/panicking.rs:271
  35:     0x564d6d8e777d - std::panic::catch_unwind::hf27600bf8c37809a
                               at src/libstd/panic.rs:394
  36:     0x564d6d8e777d - std::rt::lang_start_internal::h409d4f2fe51133b0
                               at src/libstd/rt.rs:48
  37:     0x564d6d286e99 - std::rt::lang_start::haf1cb75fea9702a9
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  38:     0x564d6d25245a - main
  39:     0x7f0b6ede6b6b - __libc_start_main
  40:     0x564d6d20d19a - _start
  41:                0x0 - <unknown>

from learn-wgpu.

sotrh avatar sotrh commented on September 28, 2024 1

As far as the slow down goes, it's likely because I'm rendering after every winit event. There are a lot of events at startup, so that means a lot of rendering. You can fix that with ControlFlow::WaitUntil(Instant). You could also call state.render() in Event::RedrawRequested.

from learn-wgpu.

kunalmohan avatar kunalmohan commented on September 28, 2024

@kvark I deleted the other icds as mentioned. main now panics with a different output:

thread 'main' panicked at 'Unable to query surface formats: ERROR_INITIALIZATION_FAILED', src/libcore/result.rs:1165:5
stack backtrace:
   0:     0x555a3aefb674 - backtrace::backtrace::libunwind::trace::hda41dbcdfba36aa0
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:     0x555a3aefb674 - backtrace::backtrace::trace_unsynchronized::h1a8d6e1f8cb3f5d4
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:     0x555a3aefb674 - std::sys_common::backtrace::_print_fmt::h610c4127487e10da
                               at src/libstd/sys_common/backtrace.rs:76
   3:     0x555a3aefb674 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0722dc552e01bd1d
                               at src/libstd/sys_common/backtrace.rs:60
   4:     0x555a3af1d29c - core::fmt::write::h01edf6dd68a42c9c
                               at src/libcore/fmt/mod.rs:1030
   5:     0x555a3aef8b77 - std::io::Write::write_fmt::hf15985f193f03c04
                               at src/libstd/io/mod.rs:1412
   6:     0x555a3aefdb85 - std::sys_common::backtrace::_print::hd8d5d08a1795e743
                               at src/libstd/sys_common/backtrace.rs:64
   7:     0x555a3aefdb85 - std::sys_common::backtrace::print::hf89a79e3921a2366
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x555a3aefdb85 - std::panicking::default_hook::{{closure}}::h3a8f42beb3bb8ae3
                               at src/libstd/panicking.rs:196
   9:     0x555a3aefd876 - std::panicking::default_hook::h8f803b0bc31a5c37
                               at src/libstd/panicking.rs:210
  10:     0x555a3aefe285 - std::panicking::rust_panic_with_hook::h825f041245da8739
                               at src/libstd/panicking.rs:473
  11:     0x555a3aefde22 - std::panicking::continue_panic_fmt::hbe0378e33481e81b
                               at src/libstd/panicking.rs:380
  12:     0x555a3aefdd16 - rust_begin_unwind
                               at src/libstd/panicking.rs:307
  13:     0x555a3af1969a - core::panicking::panic_fmt::h527855ce0bc891f6
                               at src/libcore/panicking.rs:85
  14:     0x555a3af19797 - core::result::unwrap_failed::ha8b77e6004f0ba38
                               at src/libcore/result.rs:1165
  15:     0x555a3ae7c242 - core::result::Result<T,E>::expect::h7a89e0deec0cb0cd
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/result.rs:960
  16:     0x555a3ae717dd - <gfx_backend_vulkan::window::Surface as gfx_hal::window::Surface<gfx_backend_vulkan::Backend>>::supported_formats::hfeb2ec794fcde002
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/gfx-backend-vulkan-0.4.1/src/window.rs:398
  17:     0x555a3ad93816 - wgpu_native::device::device_create_swap_chain::heaf604e13556c8dd
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/device.rs:2060
  18:     0x555a3ad94a33 - wgpu_device_create_swap_chain
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/device.rs:2125
  19:     0x555a3ac4d24e - wgpu::Device::create_swap_chain::ha1f54436fbd10d7b
                               at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.4.0/src/lib.rs:834
  20:     0x555a3a868fc4 - try_wgpu::State::new::h23674722c18ecf75
                               at src/main.rs:91
  21:     0x555a3a868c6b - try_wgpu::main::hf5dd9c0cb7449a73
                               at src/main.rs:10
  22:     0x555a3a89dec0 - std::rt::lang_start::{{closure}}::h9e5098d20c41fd21
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  23:     0x555a3aefdcb3 - std::rt::lang_start_internal::{{closure}}::ha04574f12d97cbe2
                               at src/libstd/rt.rs:49
  24:     0x555a3aefdcb3 - std::panicking::try::do_call::h7c2a8488f72db90c
                               at src/libstd/panicking.rs:292
  25:     0x555a3af0198a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  26:     0x555a3aefe77d - std::panicking::try::hc3a9b5da4250385d
                               at src/libstd/panicking.rs:271
  27:     0x555a3aefe77d - std::panic::catch_unwind::hf27600bf8c37809a
                               at src/libstd/panic.rs:394
  28:     0x555a3aefe77d - std::rt::lang_start_internal::h409d4f2fe51133b0
                               at src/libstd/rt.rs:48
  29:     0x555a3a89de99 - std::rt::lang_start::haf1cb75fea9702a9
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  30:     0x555a3a86945a - main
  31:     0x7fef3d063b6b - __libc_start_main
  32:     0x555a3a82419a - _start
  33:                0x0 - <unknown>

from learn-wgpu.

kunalmohan avatar kunalmohan commented on September 28, 2024

@kvark I was able to solve the issue by running sudo vulkaninfo as mentioned in doitsujin/dxvk#758 (comment). But my system seems to lag a lot while my winit window is open. Is there a particular reason for that?

from learn-wgpu.

kvark avatar kvark commented on September 28, 2024

That's not expected, and I'm not seeing this on my Linux machines. Would be great to collect some system-wide profiling info from your runs.

from learn-wgpu.

kunalmohan avatar kunalmohan commented on September 28, 2024

@kvark can you suggest the right tool and steps for profiling. I have never done this before. I have nvidia GeForce MX150 in my system. I searched for the same and found nvidia nsight graphics but it seems that it doesn't support the graphics card in my system.

from learn-wgpu.

kvark avatar kvark commented on September 28, 2024

It's been a while since I did that too... something like http://www.sysprof.com/ would be a good start.

from learn-wgpu.

kunalmohan avatar kunalmohan commented on September 28, 2024

Ok, so I ran the profiler and have the output (its a .syscap file). https://drive.google.com/file/d/1cwyeT90QGiNOyupW-bZQuihAwEoGmEDt/view?usp=sharing
the [try-wgpu] under the functions column is the program name.

from learn-wgpu.

kunalmohan avatar kunalmohan commented on September 28, 2024

I ran the examples in wgpu-rs and noticed that the system lags only when I try to resize or move my window around (screen freezes for 5-10sec). The rendering is fine. The skybox example also runs smoothly unless I perform either of the above operations.

from learn-wgpu.

kvark avatar kvark commented on September 28, 2024

Looks like gfx-rs/gfx#3141

from learn-wgpu.

sotrh avatar sotrh commented on September 28, 2024

Also it seems like gfx-rs/gfx#3143 resolved your issue. Do you mind closing this issue?

from learn-wgpu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.