Coder Social home page Coder Social logo

Comments (13)

ngasull avatar ngasull commented on September 3, 2024 3

Hi šŸ‘‹ I ran into the same issue on my Ubuntu. Having a crappy Intel GPU, I eventually searched for Intel+Vulkan+Ubuntu issues and ended with a fix:

sudo apt install mesa-vulkan-drivers

Good to know however that our category of end-users won't support current implementation of wgpu out of the box. I'd naively expect 2D stuff especially to work out of the box, without installing dependencies, but it's gonna be the job of OS distributions I guess šŸ™‚

@joshtriplett as you seemed to have this exact issue. Does this added dependency solve it?

from pixels.

parasyte avatar parasyte commented on September 3, 2024 1

This should be fixed on master with wgpu = "0.5.0".

from pixels.

AnEnigmaticBug avatar AnEnigmaticBug commented on September 3, 2024 1

I searched a bit and got to know that Vulkan doesn't work properly in VirtualBox. The vkcube and vulkaninfo utilities also failed in my VM. So, the issue isn't related to pixels at all. Thanks for your suggestion about looking into Vulkan support itself.

from pixels.

caemor avatar caemor commented on September 3, 2024

same error for the wgpu-rs default example and the gfx-rs with vulkan, but gfx-rs with gl (opengl) works fine. So it seems the problem is that currently the wrong (vulkan) backend is chosen?

I need to go out now, I can add more backtraces later or check if I just need to install these deps from: https://github.com/gfx-rs/gfx/blob/master/info/getting_started.md#vulkan-dependencies

~/g/t/g/examples> cargo run --bin quad --features vulkan
    Finished dev [unoptimized + debuginfo] target(s) in 0.38s                                                                 
     Running `/home/caemor/git/tests/gfx/target/debug/quad`
[2019-11-05T16:52:38Z ERROR gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : setupLoaderTermPhysDevs:  Failed to detect any valid GPUs in the current config
object info: (type: INSTANCE, hndl: 94256011912432)

[2019-11-05T16:52:38Z ERROR gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : setupLoaderTrampPhysDevs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
object info: (type: INSTANCE, hndl: 94256011912432)

[2019-11-05T16:52:38Z ERROR gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : setupLoaderTermPhysDevs:  Failed to detect any valid GPUs in the current config
object info: (type: INSTANCE, hndl: 94256011912432)

[2019-11-05T16:52:38Z ERROR gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : setupLoaderTrampPhysDevs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
object info: (type: INSTANCE, hndl: 94256011912432)

[2019-11-05T16:52:38Z ERROR gfx_backend_vulkan] Could not enumerate physical devices! Initialization of a object has failed
thread 'main' panicked at 'assertion failed: index < len', src/liballoc/vec.rs:988:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

~/g/t/g/examples> cargo run --bin quad --features gl
    Finished dev [unoptimized + debuginfo] target(s) in 0.42s                                                                 
     Running `/home/caemor/git/tests/gfx/target/debug/quad`
AdapterInfo { name: "AMD PITCAIRN (DRM 2.50.0, 5.3.7-2-MANJARO, LLVM 9.0.0)", vendor: 0, device: 0, device_type: DiscreteGpu }
Memory types: [MemoryType { properties: CPU_VISIBLE | COHERENT | CPU_CACHED, heap_index: 1 }, MemoryType { properties: CPU_VISIBLE | COHERENT, heap_index: 1 }, MemoryType { properties: CPU_VISIBLE | CPU_CACHED, heap_index: 1 }, MemoryType { properties: DEVICE_LOCAL, heap_index: 0 }, MemoryType { properties: DEVICE_LOCAL, heap_index: 0 }]
formats: Some([Rgba8Srgb, Bgra8Srgb])
SwapchainConfig { present_mode: FIFO, composite_alpha_mode: OPAQUE, format: Rgba8Srgb, extent: Extent2D { width: 1024, height: 768 }, image_count: 2, image_layers: 1, image_usage: COLOR_ATTACHMENT }
resized to LogicalSize { width: 1024.0, height: 768.0 }
SwapchainConfig { present_mode: FIFO, composite_alpha_mode: OPAQUE, format: Rgba8Srgb, extent: Extent2D { width: 1024, height: 768 }, image_count: 2, image_layers: 1, image_usage: COLOR_ATTACHMENT }
^CāŽ                                                                                                                           
~/g/t/g/examples> 

~/g/t/wgpu-rs> env RUST_BACKTRACE=full cargo run --example cube
    Finished dev [unoptimized + debuginfo] target(s) in 0.28s                                                                 
     Running `target/debug/examples/cube`
[2019-11-05T16:50:20Z ERROR gfx_backend_vulkan] 
    GENERAL [Loader Message (0)] : setupLoaderTermPhysDevs:  Failed to detect any valid GPUs in the current config
    object info: (type: INSTANCE, hndl: 94167132465104)
    
[2019-11-05T16:50:20Z ERROR gfx_backend_vulkan] 
    GENERAL [Loader Message (0)] : setupLoaderTrampPhysDevs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
    object info: (type: INSTANCE, hndl: 94167132465104)
    
[2019-11-05T16:50:20Z ERROR gfx_backend_vulkan] 
    GENERAL [Loader Message (0)] : setupLoaderTermPhysDevs:  Failed to detect any valid GPUs in the current config
    object info: (type: INSTANCE, hndl: 94167132465104)
    
[2019-11-05T16:50:20Z ERROR gfx_backend_vulkan] 
    GENERAL [Loader Message (0)] : setupLoaderTrampPhysDevs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
    object info: (type: INSTANCE, hndl: 94167132465104)
    
[2019-11-05T16:50:20Z ERROR gfx_backend_vulkan] Could not enumerate physical devices! Initialization of a object has failed
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21
stack backtrace:
   0:     0x55a4fd71b9eb - backtrace::backtrace::libunwind::trace::h89fcc71e59e3bc5b
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/libunwind.rs:88
   1:     0x55a4fd71b9eb - backtrace::backtrace::trace_unsynchronized::h0bad9be1379e729a
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/mod.rs:66
   2:     0x55a4fd71b9eb - std::sys_common::backtrace::_print::hd3382a1f33c473da
                               at src/libstd/sys_common/backtrace.rs:47
   3:     0x55a4fd71b9eb - std::sys_common::backtrace::print::h0ec6f03cfb8e76a6
                               at src/libstd/sys_common/backtrace.rs:36
   4:     0x55a4fd71b9eb - std::panicking::default_hook::{{closure}}::h96cbf7b454e3f557
                               at src/libstd/panicking.rs:200
   5:     0x55a4fd71b6c6 - std::panicking::default_hook::h95a8f00337383d83
                               at src/libstd/panicking.rs:214
   6:     0x55a4fd71c15d - std::panicking::rust_panic_with_hook::h92f98b46e22f14ed
                               at src/libstd/panicking.rs:477
   7:     0x55a4fd71bce2 - std::panicking::continue_panic_fmt::h25abfbb4e5b7043a
                               at src/libstd/panicking.rs:384
   8:     0x55a4fd71bbc6 - rust_begin_unwind
                               at src/libstd/panicking.rs:311
   9:     0x55a4fd73bddd - core::panicking::panic_fmt::h7e9f94035af782b3
                               at src/libcore/panicking.rs:85
  10:     0x55a4fd73bd1c - core::panicking::panic::hda536e6f3accfb91
                               at src/libcore/panicking.rs:49
  11:     0x55a4fd0415e8 - core::option::Option<T>::unwrap::hb2ea246757546eef
                               at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/macros.rs:12
  12:     0x55a4fd15f1cd - wgpu_request_adapter
                               at /home/caemor/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.0/src/instance.rs:474
  13:     0x55a4fcf61ace - wgpu::Adapter::request::h4996314114b36e87
                               at src/lib.rs:545
  14:     0x55a4fccf4da8 - cube::framework::run::he9cacdce564445ff
                               at examples/cube/../framework.rs:97
  15:     0x55a4fcd0a7e5 - cube::main::hd44faa43e89bb2f0
                               at examples/cube/main.rs:357
  16:     0x55a4fccddc20 - std::rt::lang_start::{{closure}}::h3e1988d7e9300019
                               at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
  17:     0x55a4fd71bb63 - std::rt::lang_start_internal::{{closure}}::h4e93c1949c7a1955
                               at src/libstd/rt.rs:49
  18:     0x55a4fd71bb63 - std::panicking::try::do_call::h9440ccd4dc467eaa
                               at src/libstd/panicking.rs:296
  19:     0x55a4fd7243ba - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  20:     0x55a4fd71c66d - std::panicking::try::hc046e7ee42ee744f
                               at src/libstd/panicking.rs:275
  21:     0x55a4fd71c66d - std::panic::catch_unwind::h27dfc457c200aee0
                               at src/libstd/panic.rs:394
  22:     0x55a4fd71c66d - std::rt::lang_start_internal::hea1b49a567afe309
                               at src/libstd/rt.rs:48
  23:     0x55a4fccddbf9 - std::rt::lang_start::hfc3473c8e4738dc5
                               at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
  24:     0x55a4fcd0a81a - main
  25:     0x7f4322637153 - __libc_start_main
  26:     0x55a4fccad1ae - _start
  27:                0x0 - <unknown>

from pixels.

parasyte avatar parasyte commented on September 3, 2024

Sure, no worries. This is really helpful info, so far. If the problem does get resolved by installing Vulkan dependencies, that might be a reasonable workaround for now. But I'm considering to option of surfacing this to the wgpu maintainers.

They recently announced that wgpu automatically selects a backend. This might end up being a common case where users are capable of running OpenGL but not Vulkan? And wgpu always prefers Vulkan on supported platforms.

For now I'm going to label this as an upstream bug. When you get a chance, let me know how that testing goes.

from pixels.

kvark avatar kvark commented on September 3, 2024

We don't support GL at the moment. So if your Linux system can't initialize Vulkan, it's not supported yet. Do you expect a nicer error message/handling?

from pixels.

parasyte avatar parasyte commented on September 3, 2024

Leaving this here as a reminder for myself: If wgpu::Adapter::request() fails, we can try again with wgpu::RequestAdapterOptions { backends: wgpu::BackendBit::SECONDARY, .. } to check for OpenGL and DirectX11.

from pixels.

caemor avatar caemor commented on September 3, 2024

So I installed all the stuff from the gfx-getting started link and also from https://wiki.archlinux.org/index.php/Vulkan for my graphics card and I now get a slightly different error where it seems that my graphic card is too old. Rest of the error message is still the same šŸ¤”

Not sure what else I can try :-D

āÆ cargo run --bin quad --features vulkan
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `/home/caemor/git/tests/gfx/target/debug/quad`
amdgpu_device_initialize: DRM version is 2.50.0 but this driver is only compatible with 3.x.x.
amdgpu_device_initialize: DRM version is 2.50.0 but this driver is only compatible with 3.x.x.
[2019-11-08T10:42:47Z ERROR gfx_backend_vulkan] 
....


āÆ inxi -G
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Pitcairn XT [Radeon HD 7870 GHz Edition] driver: radeon v: kernel 
           Display: x11 server: X.org 1.20.5 driver: ati,radeon unloaded: modesetting resolution: <xdpyinfo missing> 
           OpenGL: renderer: AMD PITCAIRN (DRM 2.50.0 5.3.8-3-MANJARO LLVM 9.0.0) v: 4.5 Mesa 19.2.2 

from pixels.

bjorn3 avatar bjorn3 commented on September 3, 2024

DRM version is 2.50.0 but this driver is only compatible with 3.x.x

Maybe try updating libdrm.so? Maybe that will need a kernel update too.

from pixels.

parasyte avatar parasyte commented on September 3, 2024

This is all very much outside of my zone of familiarity. If your machine cannot do Vulkan, the best I can do on my end is request an adapter that supports OpenGL. We'll just have to see how OpenGL support improves in wgpu.

from pixels.

kvark avatar kvark commented on September 3, 2024

@caemor try some basic Vulkan demos, like vkcube. If it works, gfx-rs Vulkan backend would also work to some extent. Otherwise, you'll have to wait till wgpu-rs gets GL support.

from pixels.

AnEnigmaticBug avatar AnEnigmaticBug commented on September 3, 2024

@parasyte I also have a similar issue in a fresh Ubuntu 20.04 install (pixels 0.2.0). Here's the output from my program with RUST_LOG=trace:

[2021-01-01T15:18:13Z TRACE mio::poll] registering with poller
[2021-01-01T15:18:13Z TRACE mio::poll] registering with poller
[2021-01-01T15:18:13Z TRACE mio::poll] registering with poller
[2021-01-01T15:18:13Z TRACE mio::poll] registering with poller
[2021-01-01T15:18:13Z TRACE mio::poll] registering with poller
[2021-01-01T15:18:13Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
[2021-01-01T15:18:13Z DEBUG winit::platform_impl::platform::x11::window] Calculated physical dimensions: 640x480
[2021-01-01T15:18:13Z ERROR gfx_backend_vulkan] Could not enumerate physical devices! Initialization of a object has failed
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: AdapterNotFound', src/main.rs:37:56

The panic happens when I call Pixels::new.

The binary runs on my dev machine (also Ubuntu). But it didn't work on my friend's laptop. So, I executed the binary in VirtualBox for testing and saw this output. I suspect this maybe due to a missing shared library.

I tried sudo apt install libx11-dev as mentioned in #83. But the issue still persists. I have the mesa-vulkan-drivers package installed. Could you please recommend anything?

from pixels.

parasyte avatar parasyte commented on September 3, 2024

@AnEnigmaticBug It looks like you need to install a Vulkan driver for your GPU.

from pixels.

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.