Windows 11 Unable to find a GPU (with workaround using DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1)
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
0.13.1
## \[Optional\] Relevant system information
cargo 1.79.0-nightly (d438c80c4 2024-03-19)
OS: Windows 11 Version 10.0.22631 Build 22631
CPU: AMD Ryzen 5 4600H
GPU: GTX 1660 Ti
Device: 2021 Omen 15 gaming laptop (15-en0016ax)
## What you did
`cargo run`
## What went wrong
```
2024-03-26T19:56:30.314723Z INFO bevy_winit::system: Creating new window "App" (0v1)
2024-03-26T19:56:32.594139Z ERROR log: enumerate_adapters: A return array was too small for the result
thread 'main' panicked at C:\Users\clonk\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_render-0.13.1\src\renderer\mod.rs:141:10:
Unable to find a GPU! Make sure you have installed required drivers!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace`
```
## Additional information
I previously had this same issue with Godot 4.0 (because they switched to a Vulkan renderer). Eventually I found somewhere that doing `set DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1` before running Godot made it work. I have no idea what that variable does or why it works. On a whim I decided to try it with Bevy as well and lo and behold it works also. So I guess it must be a Vulkan variable then? Very strange.
I believe I got my drivers up-to-date when I had this issue with Godot, but I'll check after I get home from work today.
The problem no longer occurs for me with newer versions of Godot. It seems maybe they're just [setting that environment variable](https://github.com/godotengine/godot/pull/73450) automatically on Windows. One of their graphics programmers [said](https://github.com/godotengine/godot/pull/73450#issuecomment-1560152235) that flag simply causes the GPUs to present separately instead of combined into one switchable one.
Contributor guide
Assessment
This issue has not been assessed yet.