wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Can not run bevy project

Open devlaq opened this issue 3 years ago • 9 comments

Description When I run a bevy program, window opened and program crashed wgpu errors.

Repro steps Run any bevy example projects with bevy 0.6.0 and program crashed with error

Expected vs observed behavior Expected: run project and show a window. Observed: run project and show a window and program crashed with wgpu errors.

Extra materials image Code: `use bevy::prelude::*;

fn main(){ App::new().add_plugins(DefaultPlugins).run(); }(bevy 0.6.0) Error: devlaq@devlaq-15U560-RN70L:~/IdeaProjects/Bevy/bevy_chess$ cargo run Finished dev [unoptimized + debuginfo] target(s) in 0.13s Runningtarget/debug/bevy_chess` 2022-01-28T16:43:42.134246Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

2022-01-28T16:43:42.224825Z ERROR wgpu_hal::vulkan::adapter: get_physical_device_surface_present_modes: Initialization of a object has failed
2022-01-28T16:43:42.224905Z ERROR wgpu_hal::vulkan::adapter: get_physical_device_surface_formats: Initialization of a object has failed
2022-01-28T16:43:42.235137Z INFO bevy_render::renderer: AdapterInfo { name: "GeForce 940M", vendor: 4318, device: 4935, device_type: DiscreteGpu, backend: Vulkan } 2022-01-28T16:43:42.524355Z ERROR wgpu_hal::vulkan::adapter: get_physical_device_surface_present_modes: Initialization of a object has failed
2022-01-28T16:43:42.524917Z ERROR wgpu_hal::vulkan::adapter: get_physical_device_surface_formats: Initialization of a object has failed
thread 'main' panicked at 'Error in Surface::configure: requested format Bgra8UnormSrgb is not in list of supported formats: []', /home/devlaq/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:214:9 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Platform Ubuntu 21.10, wgpu 0.12.0, GeForce 940M, Vulkan.

devlaq avatar Jan 28 '22 16:01 devlaq

Could you please run wgpu's examples with RUST_LOG=wgpu_hal=debug environment?

kvark avatar Jan 28 '22 17:01 kvark

Could you please run wgpu's examples with RUST_LOG=wgpu_hal=debug environment? wgpu_log.txt

devlaq avatar Jan 28 '22 17:01 devlaq

Could you please install Vulkan Validation Layers and try again, providing the log? It should tell us more. For example, on NixOS the package is vulkan-validation-layers

kvark avatar Feb 02 '22 00:02 kvark

Having the exact same issue, also in Bevy. Here's my log with the aforementioned env: log.txt

nia-e avatar Feb 03 '22 12:02 nia-e

@a-b-c-1-2-3 what exactly are you seeing? I'm not seeing any errors in your log.

kvark avatar Feb 04 '22 20:02 kvark

The error given was thread 'main' panicked at 'Error in Surface::configure: requested format Bgra8UnormSrgb is not in list of supported formats: [Bgra8Unorm]'. Seems similar to the OP, odd that it didn't show up in logs.

nia-e avatar Feb 06 '22 19:02 nia-e

This is a totally separate issue.

kvark avatar Feb 07 '22 19:02 kvark

Hm. Okay, I'll open a separate issue. Sorry for the inconvenience.

nia-e avatar Feb 08 '22 06:02 nia-e

I am also having the same issue with the Bevy examples, and although the same error shows up in the wgpu examples, it does not crash. output.txt

BitRanger avatar Sep 19 '22 04:09 BitRanger

Experiencing the same issue with bevy 0.8.1. Wasm builds do not work, though 0.6.0 worked just fine

wasm.js:394 panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 1, Gl)>`
    In a pass parameter
      note: command buffer = `<CommandBuffer-(0, 1, Gl)>`
    resource source format (Rgba8UnormSrgb) must match the resolve destination format (Bgra8UnormSrgb)

', C:\Users\ssuro\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.13.1\src\backend\direct.rs:2391:5

Stack:

Error
    at imports.wbg.__wbg_new_abda76e883ba8a5f (http://127.0.0.1:1334/api/wasm.js:382:13)
    at console_error_panic_hook::hook::ha66bb5105f2c7601 (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[8134]:0xb943b4)
    at core::ops::function::Fn::call::h5b7230d47971d189 (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[37911]:0x103c5a4)
    at std::panicking::rust_panic_with_hook::h9f76ee6d1722663d (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[17181]:0xeabd69)
    at std::panicking::begin_panic_handler::{{closure}}::hed4460a7be219727 (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[20446]:0xf4656e)
    at std::sys_common::backtrace::__rust_end_short_backtrace::h04d0c00de7636769 (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[28165]:0x1009ac8)
    at rust_begin_unwind (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[24870]:0xfd177b)
    at core::panicking::panic_fmt::h4363ce3786d4363f (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[26819]:0xff765e)
    at core::ops::function::Fn::call::hd341e55b08f08165 (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[18193]:0xee0b9e)
    at wgpu::backend::direct::ErrorSinkRaw::handle_error::he9e33f61b564fe9a (http://127.0.0.1:1334/api/wasm.wasm:wasm-function[11849]:0xd310c6)

stillonearth avatar Nov 01 '22 11:11 stillonearth

@stillonearth that looks like a bevy bug, they are just mixing formats up

cwfitzgerald avatar Nov 01 '22 15:11 cwfitzgerald

Confirming an issue with bevy, though PR fixing this is merged. Correct way of initializing a TextureDescriptor format is

TextureDescriptor {
    label: None,
    size,
    dimension: TextureDimension::D2,
    format: TextureFormat::bevy_default(),
    mip_level_count: 1,
    sample_count: 1,
    usage: TextureUsages::TEXTURE_BINDING
        | TextureUsages::COPY_DST
        | TextureUsages::RENDER_ATTACHMENT,
}

stillonearth avatar Nov 01 '22 15:11 stillonearth

I'm actually going to close this issue as this looks like a driver problem, if the original issue is still a problem, please re-file on the latest version.

cwfitzgerald avatar Nov 01 '22 20:11 cwfitzgerald