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

3D causes wgpu error spam in console when using GLES #13115

Open
inodentry opened this issue Apr 27, 2024 · 7 comments
Open

3D causes wgpu error spam in console when using GLES #13115

inodentry opened this issue Apr 27, 2024 · 7 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system O-OpenGL Specific to the OpenGL render API

Comments

@inodentry
Copy link
Contributor

inodentry commented Apr 27, 2024

Bevy version

0.13.2; main (9d59e52)

Relevant system information

SystemInfo { os: "Linux 39 Fedora Linux Asahi Remix", kernel: "6.8.7-402.asahi.fc39.aarch64+16k", cpu: "Icestorm-M1-Pro", core_count: "10", memory: "30.9 GiB" }

AdapterInfo { name: "Apple M1 Pro (G13S C0)", vendor: 65541, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }

What you did

Run any Bevy app that does 3D rendering with StandardMaterial. As an easy reproduction, you can try the pbr example, or the 3d_scene example.

WGPU_BACKEND=gl cargo run --features wayland --example pbr

What went wrong

The console/log is filled with messages like:

2024-04-27T09:02:59.687567Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
2024-04-27T09:02:59.687599Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`

The app runs fine, rendering is working, everything looks correct. But these messages are very annoying. They are output every frame and drown out everything else in the console. I have to set custom log filters to hide them.

Additional information

On Asahi Linux, Bevy seems to default to CPU Vulkan rendering, which, besides being very slow, does not produce the messages above (which come from wgpu's GLES backend). To actually use the GPU, you have to set WGPU_BACKEND=gl. Asahi does not yet have a GPU Vulkan driver.

(this behavior may be related to #13113 ; for some reason Bevy seems to be choosing CPU Vulkan on systems with a perfectly usable GPU GL driver)

Further, when you set the backend to GLES, Bevy does not want to run in XWayland. It fails to initialize the window. That's a separate bug. So to get Bevy to run, you need to enable --features wayland to run natively under Wayland, which works.

@inodentry inodentry added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen O-Linux Specific to the Linux desktop operating system O-OpenGL Specific to the OpenGL render API labels Apr 27, 2024
@valaphee
Copy link
Contributor

valaphee commented May 1, 2024

Probably solved by #13132 not because of #13113 but more over the fact that 0.20.0 also prefers OpenGL instead of OpenGL ES

@ByteNybbler
Copy link

ByteNybbler commented Jun 27, 2024

Probably solved by #13132 not because of #13113 but more over the fact that 0.20.0 also prefers OpenGL instead of OpenGL ES

I tried running the 2D shapes example on v0.14.0-rc.3 which includes wgpu 0.20, but I'm getting the same error spam, so the issue hasn't been fixed yet:

$ cargo run --example 2d_shapes
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.64s
     Running `target\debug\examples\2d_shapes.exe`
2024-06-27T02:26:26.290667Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 10 Home", kernel: "19045", cpu: "Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz", core_count: "4", memory: "15.9 GiB" }
2024-06-27T02:26:26.813769Z  INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) HD Graphics 4600", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "OpenGL", driver_info: "4.3.0 - Build 20.19.15.4531", backend: Gl }
2024-06-27T02:26:27.932760Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-06-27T02:26:27.934359Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-06-27T02:26:28.619440Z ERROR log: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
2024-06-27T02:26:28.619515Z ERROR log: wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`

As you can see, I'm running Windows, so this issue actually isn't specific to Linux.

I will test this again after #12849 is merged.

@Wuketuke
Copy link
Contributor

Wuketuke commented Aug 1, 2024

i also have a similar issue on my machine
first messages when starting the program:

2024-08-01T07:25:41.816946Z ERROR wgpu_hal::vulkan::instance: GENERAL [../src/amd/vulkan/radv_device.c:741 (0x0)]
	Device '/dev/dri/renderD128' is not using the AMDGPU kernel driver: Invalid argument (VK_ERROR_INCOMPATIBLE_DRIVER)    
2024-08-01T07:25:41.816987Z ERROR wgpu_hal::vulkan::instance: 	objects: (type: INSTANCE, hndl: 0x5590ec4d11d0, name: ?)    
2024-08-01T07:25:41.823856Z  INFO bevy_render::renderer: AdapterInfo { name: "KAVERI (, LLVM 15.0.6, DRM 2.50, 6.1.0-23-amd64)", vendor: 4098, device: 0, device_type: Other, driver: "OpenGL", driver_info: "4.5 (Compatibility Profile) Mesa 22.3.6", backend: Gl }
2024-08-01T07:25:41.959318Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-08-01T07:25:41.959709Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-08-01T07:25:41.960020Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 1.1999918619791667

the error spam:

2024-08-01T07:25:42.123364Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`    

literally my whole code:

use bevy::prelude::*;

pub fn tower_defense_main() {
    App::new()
        .insert_resource(ClearColor(Color::srgb(0.2, 0.2, 0.2)))
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, spawn_camera)
        .run();
}

fn spawn_camera(mut commands: Commands) {
    commands.spawn(Camera3dBundle {
        transform: Transform::from_xyz(-2.0, 2.5, 5.0) // fmt
            .looking_at(Vec3::ZERO, Vec3::Y),
        ..default()
    });
}

bevy version = 0.14.0 (taken from Cargo.lock)

@Kofoten
Copy link

Kofoten commented Aug 9, 2024

Does anyone have a solution for this or know what is causing them? I am getting the same kind of errors and it seems to happen no matter if rendering 3D or 2D. The errors are also present in the examples.

2024-08-09T18:59:21.685636Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`    
2024-08-09T18:59:21.685661Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`    

@ByteNybbler
Copy link

ByteNybbler commented Aug 9, 2024

Does anyone have a solution for this or know what is causing them?

It seems to be an error specific to using old OpenGL backends that are missing specific features. If your GPU has support for a different backend, you can switch backends by setting the WGPU_BACKEND environment variable to a different value before running the app. Alternatively, you could probably filter out errors from wgpu_hal::gles by setting RUST_LOG.

My belief is that this issue might get fixed by #12849 but I'm not certain about that.

@Ashe
Copy link

Ashe commented Aug 11, 2024

If it helps, I'm running bevy on a steamdeck so maybe in my case its a specific unsupported GPU or something? GPU: AMD ATI AMD Custom GPU 0405

@tliron
Copy link

tliron commented Aug 22, 2024

I'm seeing similar errors with 2D and OpenGL:

2024-08-22T20:15:34.715525Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 6500 XT (radeonsi, navi24, LLVM 17.0.6, DRM 3.57, 6.10.5-100.fc39.x86_64)", vendor: 4098, device: 0, device_type: Other, driver: "OpenGL", driver_info: "4.6 (Compatibility Profile) Mesa 23.3.6", backend: Gl }
2024-08-22T20:15:34.840799Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-08-22T20:15:34.911203Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`    
2024-08-22T20:15:34.911263Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.

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 O-Linux Specific to the Linux desktop operating system O-OpenGL Specific to the OpenGL render API
Projects
None yet
Development

No branches or pull requests

7 participants