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

ID3D12CommandQueue errors cause blank screen and error spam #14936

Open
redstonerti opened this issue Aug 27, 2024 · 10 comments
Open

ID3D12CommandQueue errors cause blank screen and error spam #14936

redstonerti opened this issue Aug 27, 2024 · 10 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Machine-Specific This bug is isolated to specific hardware or driver configurations O-Windows Specific to the Windows desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@redstonerti
Copy link

redstonerti commented Aug 27, 2024

Bevy version: 0.14.1

Relevant system information: Windows 11 Laptop with Ryzen 7 7840HS CPU, 780M intergrated graphics and 7700S GPU

If you cannot get Bevy to build or run on your machine, please include:

cargo 1.80.1 (376290515 2024-07-16)
OS Name: Microsoft Windows 11 Pro
Version: 10.0.22631 Build 22631 (23H2)
If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

AdapterInfo { name: "AMD Radeon(TM) RX 7700S", vendor: 4098, device: 29824, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "23.40.18.02 (LLPC)", backend: Vulkan }

Here is the code:

use bevy::prelude::*;
struct Graph3DPlugin;
#[derive(Resource)]
struct Frames(u32);
impl Plugin for Graph3DPlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource(Frames(0))
            .add_systems(Update, exit_system);
    }
}
fn main() {
    App::new()
        .add_plugins((DefaultPlugins, Graph3DPlugin))
        .run();
}
fn exit_system(
    mut app_exit_events: ResMut<Events<bevy::app::AppExit>>,
    mut frames: ResMut<Frames>,
) {
    frames.0 += 1;
    if frames.0 == 3 {
        app_exit_events.send(AppExit::Success);
    }
}

And here is the error:
https://pastebin.com/bxT4nCTH

P.S. The reason it exits after 3 frames is because otherwise the error spam would fill the console up so much that I couldn't copy the adapter info.

I also tried a bunch of wgpu examples including halmark and they worked just fine: https://github.com/gfx-rs/wgpu/tree/trunk/wgpu-hal

What went wrong

I wanted to learn how to make a 3D graph, so I started out with the 3D Shapes WebGL example and removed all objects except the cube. It worked fine on my PC, but when I moved the project to my laptop everything started to break. I got a blank screen with a bunch of errors spammed in the console and it would close after a few frames. I then removed everything except the boilerplate code for a new bevy project and it stopped closing on its own but continued spamming errors.

Bevy is unusable for me right now, and I would really like to do some coding so any help would be appreciated!

@redstonerti redstonerti added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Aug 27, 2024
@redstonerti redstonerti changed the title WGPU Errors on Laptop WGPU Errors on Laptop [CRITICAL] Aug 27, 2024
@alice-i-cecile
Copy link
Member

For ease of searching, here are the errors:

ERROR wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using ClearRenderTargetView on Command List (0x00000209A96D5D80:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0x11DF8960: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x00000209A96950F0:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a render target. Expected State Bits (all): 0x11DF8940: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0x11DF8920: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
2024-08-27T06:51:28.653611Z

ERROR present_frames: wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::Present: Resource state (0x130F2E70: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x00000209A96950F0:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a INITIAL|PRESENT. Expected State Bits (all): 0x130F2E50: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Actual State: 0x130F2E30: D3D12_RESOURCE_STATE_RENDER_TARGET, Missing State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Machine-Specific This bug is isolated to specific hardware or driver configurations and removed S-Needs-Triage This issue needs to be labelled labels Aug 27, 2024
@alice-i-cecile alice-i-cecile changed the title WGPU Errors on Laptop [CRITICAL] ID3D12CommandQueue errors Aug 27, 2024
@alice-i-cecile alice-i-cecile added the S-Needs-Investigation This issue requires detective work to figure out what's going wrong label Aug 27, 2024
@alice-i-cecile alice-i-cecile changed the title ID3D12CommandQueue errors ID3D12CommandQueue errors cause blank screen and error spam Aug 27, 2024
@redstonerti
Copy link
Author

redstonerti commented Aug 27, 2024

UPDATE: Tested on bevy 0.13.2 and all I got was a bunch of errors, on bevy 0.14.1, it also crashes.
https://streamable.com/f8fe93

@alice-i-cecile
Copy link
Member

Are your graphics drivers up to date? This sort of issue is often a driver bug.

@redstonerti
Copy link
Author

redstonerti commented Aug 29, 2024

Are your graphics drivers up to date? This sort of issue is often a driver bug.

Thanks for the tip! I upgraded to the latest graphics drivers and it no longer crashes, and when running in release mode, I also get no errors. Unfortunately, for some reason, when I run in debug mode I still get error spam:

https://pastebin.com/KrCPnvLu

@alice-i-cecile
Copy link
Member

Okay, that's good to hear! I'm not personally able to debug much further, but I appreciate your investigations so far.

@redstonerti
Copy link
Author

redstonerti commented Sep 22, 2024

It's been almost a month and this issue still persists. I tried running the async_compute example in both release mode and debug mode and I get the errors only in debug mode.

I also removed all drivers and did a factory reset before reinstalling them.

2024-09-22.15-20-35.mp4
2024-09-22T12:22:24.635838Z ERROR wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using ClearRenderTargetView on Command List (0x00000247903D4E60:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0xA96F9320: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x00000247903C8E40:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a render target.  Expected State Bits (all): 0xA96F9300: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0xA96F92E0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]   

2024-09-22T12:22:24.644697Z ERROR wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using IDXGISwapChain::Present on Command List (0x0000024790350B20:'Internal DXGI CommandList'): Resource state (0xAE33E9B0: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x00000247903C8E40:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a PRESENT_SOURCE.  Expected State Bits (all): 0xAE33E990: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Actual State: 0xAE33E970: D3D12_RESOURCE_STATE_RENDER_TARGET, Missing State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]

@alice-i-cecile alice-i-cecile added the O-Windows Specific to the Windows desktop operating system label Sep 22, 2024
@NoFr1ends
Copy link

Having the same issue with the latest amd driver:

2024-10-29T19:17:43.397067Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Education", kernel: "22631", cpu: "AMD Ryzen 9 5900X 12-Core Processor", core_count: "12", memory: "63.9 GiB" }
2024-10-29T19:17:43.579929Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 7900 GRE", vendor: 4098, device: 29772, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "24.10.1 (LLPC)", backend: Vulkan }

getting the following messages:

2024-10-29T19:18:17.057828Z ERROR wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using ClearRenderTargetView on Command List (0x0000027A5B660360:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0x630FE960: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x0000027A
5B5DC930:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a render target.  Expected State Bits (all): 0x630FE940: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0x630FE920: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
2024-10-29T19:18:17.059024Z ERROR wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using IDXGISwapChain::Present on Command List (0x0000027A5B55A470:'Internal DXGI CommandList'): Resource state (0x630FE960: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x0000027A5B5DC930:'Unname
d ID3D12Resource Object') (subresource: 0) is invalid for use as a PRESENT_SOURCE.  Expected State Bits (all): 0x630FE940: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Actual State: 0x630FE920: D3D12_RESOURCE_STATE_RENDER_TARGET, Missing State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]

Sample is working fine tho, its just unusable with that console spam

@alice-i-cecile
Copy link
Member

Can you try to reproduce this on wgpu alone and file an issue there? This is largely an upstream bug, although it's not clear if its wgpu's responsibility or a faulty graphics driver.

@NoFr1ends
Copy link

NoFr1ends commented Oct 29, 2024

found this one in wgpu: gfx-rs/wgpu#4247

@foxzool
Copy link
Contributor

foxzool commented Nov 30, 2024

found this one in wgpu: gfx-rs/wgpu#4247

WGPU_BACKEND=vulkan works, the wgpu error disappeared

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-Machine-Specific This bug is isolated to specific hardware or driver configurations O-Windows Specific to the Windows desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

4 participants