wgpu: Shader translation error for stage ShaderStages(VERTEX | FRAGMENT): new_render_pipeline_state: "Compiler encountered an internal error"
Summary
I encountered this error running a Bevy example cargo run --example mesh2d
:
2023-12-02T22:26:01.361664Z INFO bevy_render::renderer: AdapterInfo { name: "Intel Iris Pro Graphics", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2023-12-02T22:26:02.066572Z INFO bevy_winit::system: Creating new window "App" (0v0)
2023-12-02T22:26:02.200397Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 12.7 ", kernel: "21.6.0", cpu: "Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz", core_count: "4", memory: "16.0 GiB" }
2023-12-02T22:26:03.078599Z ERROR log: Shader translation error for stage ShaderStages(VERTEX | FRAGMENT): new_render_pipeline_state: "Compiler encountered an internal error"
2023-12-02T22:26:03.078644Z ERROR log: Please report it to https://github.com/gfx-rs/naga
2023-12-02T22:26:03.078697Z ERROR log: Handling wgpu errors as fatal by default
thread 'Compute Task Pool (2)' panicked at /Users/eric/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.17.2/src/backend/direct.rs:3056:5:
wgpu error: Validation Error
Caused by:
In Device::create_render_pipeline
note: label = `transparent_mesh2d_pipeline`
Internal error in ShaderStages(VERTEX | FRAGMENT) shader: new_render_pipeline_state: "Compiler encountered an internal error"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::render_resource::pipeline_cache::PipelineCache::process_pipeline_queue_system`!
thread 'Compute Task Pool (0)' panicked at crates/bevy_render/src/pipelined_rendering.rs:145:45:
called `Result::unwrap()` on an `Err` value: RecvError
Appreciating this may well be a Bevy error, I posted over there https://github.com/bevyengine/bevy/issues/10849. However, because the error message asks me to file here, I’m cross-posting.
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 1
- Comments: 17 (4 by maintainers)
I’m dealing with the same kind of problem 😕
Fwiw, I see this with macOS 12.7.3 and xcode 14.2. I am unable to upgrade past this because I’m using a 2015 MacBook pro that is not supported by newer macOS versions.
I don’t see anything wrong with the generated Metal shader. It compiles to Metal IR (tried via https://shader-playground.timjones.io/) just fine, this is probably a driver bug that happens later when compiling the Metal IR to GPU instructions.
Debugging with Xcode (see https://github.com/gfx-rs/wgpu/wiki/Debugging-with-Xcode) might tell us more.
Does upgrading OS and/or Xcode version help? Before you do, could you let us know the versions you are on right now? It would help if others run into this to know the broken versions.
Yeah on mac you’re not supposed to find the GL backend - that log is only at debug for that reason.
The shader compilation error is on metal - we need the dump of the shader that failed to compile.
The defaults of the logging plugin exclude wgpu and naga’s logs for severities lower than error/warn.
https://github.com/bevyengine/bevy/blob/12a11e2fd0f7f6c1b907daa2782898c6f3097d1e/crates/bevy_log/src/lib.rs#L105
You should disable it or change the defaults.