Skip to content
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

App crashes at startup #7620

Closed
LiamGallagher737 opened this issue Feb 11, 2023 · 5 comments
Closed

App crashes at startup #7620

LiamGallagher737 opened this issue Feb 11, 2023 · 5 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Startup A crash that occurs when first attempting to run a Bevy app S-Blocked This cannot move forward until something else changes

Comments

@LiamGallagher737
Copy link
Member

Bevy version

main branch 9ef840e

Relevant system information

`AdapterInfo { name: "NVIDIA GeForce RTX 3060 Ti", vendor: 4318, device: 9353, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "522.06", backend: Vulkan }`
`SystemInfo { os: "Windows 10 Home", kernel: "19044", cpu: "AMD Ryzen 7 5800X 8-Core Processor", core_count: "8", memory: "31.9 GiB" }`

What you did

Created a new project with the following code

use bevy::prelude::*;
fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .run();
}

This is the Cargo.toml

bevy = { git = "https://github.com/bevyengine/bevy", rev = "9ef840e" }

What went wrong

The app crashed right after the window opened with the following error

thread 'main' panicked at 'called glDebugMessageCallback but it was not loaded.', E:\rust\.cargo\registry\src\github.com-1ecc6299db9ec823\glow-0.12.0\src\gl46.rs:4234:5

Additional information

A workaround is to add the following when setting up DefaultPlugins

.set(RenderPlugin {
    wgpu_settings: WgpuSettings {
        backends: Some(Backends::PRIMARY),
        ..Default::default()
    },
    ..default()
}),

Here are two relevant discord threads
https://discord.com/channels/691052431525675048/1073274796697198622
https://discord.com/channels/691052431525675048/1073786235996352632

@LiamGallagher737 LiamGallagher737 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 11, 2023
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Feb 11, 2023
@alice-i-cecile
Copy link
Member

We should investigate changing the default WgpuSettings to the workaround.

@superdump
Copy link
Contributor

We just moved to enabling all backends. What I find odd is that it claims to be using the Vulkan backend but hits this panic about GL. I wonder why. Perhaps some probing is done. That has the potential to panic? @cwfitzgerald?

@cwfitzgerald
Copy link

This is gfx-rs/wgpu#2540

@james7132 james7132 added S-Blocked This cannot move forward until something else changes C-Startup A crash that occurs when first attempting to run a Bevy app labels Feb 12, 2023
@Elabajaba
Copy link
Contributor

Summarizing discussions on this from discord:

This appears to be because it tries to load libEGL.dll and libGLESv2.dll, which means that if it can't find them locally, it also tries searching in your PATH for them, and because Angle is common there's a chance that those are somewhere in your PATH. (https://github.com/google/angle)

The problem is that it's finding old versions of those dlls (because people package Angle once and don't bother updating it...) and trying to use them (and they're so outdated they don't support glDebugMessageCallback, they only support glDebugMessageCallbackKHR) which seems to be the root cause of this crash.

@LiamGallagher737
Copy link
Member Author

This is now fixed after an update for glow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Startup A crash that occurs when first attempting to run a Bevy app S-Blocked This cannot move forward until something else changes
Projects
None yet
Development

No branches or pull requests

6 participants