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

Simple gizmo usage might trigger vulkan validation errors #13861

Open
torsteingrindvik opened this issue Jun 15, 2024 · 6 comments
Open

Simple gizmo usage might trigger vulkan validation errors #13861

torsteingrindvik opened this issue Jun 15, 2024 · 6 comments
Labels
A-Gizmos Visual editor and debug gizmos A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Vulkan Specific to the Vulkan render API S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@torsteingrindvik
Copy link
Contributor

torsteingrindvik commented Jun 15, 2024

Bevy version

eb3c813

What you did

Gizmos might trigger vulkan validation errors.

Minimal:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, |mut commands: Commands| {
            commands.spawn(Camera3dBundle::default());
        })
        .add_systems(Update, |mut gizmos: Gizmos| {
            gizmos.arrow(Vec3::ZERO, Vec3::ONE, Color::default());
        })
        .run();
}

What went wrong

Validation spam, but not always, ~30% of the time I start the app I get spammed, other times not at all.

2024-06-15T12:12:38.018757Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux rolling EndeavourOS", kernel: "6.9.3-arch1-1", cpu: "AMD Ryzen 9 3900X 12-Core Processor", core_count: "12", memory: "31.3 GiB" }
2024-06-15T12:12:38.230219Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 2080 Ti", vendor: 4318, device: 7687, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "555.52.04", backend: Vulkan }
2024-06-15T12:12:38.942473Z  INFO gilrs_core::platform::platform::gamepad: Gamepad /dev/input/event7 (Microsoft X-Box One S pad) connected.
2024-06-15T12:12:39.087499Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-06-15T12:12:39.088085Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1.75
2024-06-15T12:12:39.097405Z  INFO bevy_input::gamepad: Gamepad { id: 0 } Connected
2024-06-15T12:12:39.300020Z  WARN bevy_render::view::window: Couldn't get swap chain texture. This often happens with the NVIDIA drivers on Linux. It can be safely ignored.
2024-06-15T12:12:39.590875Z ERROR wgpu_hal::vulkan::instance: VALIDATION [SYNC-HAZARD-READ-AFTER-WRITE (0xe4d96472)]
        Validation Error: [ SYNC-HAZARD-READ-AFTER-WRITE ] Object 0: handle = 0x5647b5cda570, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0xe4d96472 | vkQueueSubmit():  Hazard READ_AFTER_WRITE for entry 9, VkCommandBuffer 0x7c72e0039d20[main_transparent_pass_3d], Submitted
 access info (submitted_usage: SYNC_VERTEX_ATTRIBUTE_INPUT_VERTEX_ATTRIBUTE_READ, command: vkCmdDraw, seq_no: 2, reset_no: 8). Access info (prior_usage: SYNC_COPY_TRANSFER_WRITE, write_barriers: SYNC_FRAGMENT_SHADER_COLOR_ATTACHMENT_READ|SYNC_FRAGMENT_SHADER_DEPTH_STENCIL
_ATTACHMENT_READ|SYNC_FRAGMENT_SHADER_INPUT_ATTACHMENT_READ|SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_READ|SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE|SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_READ|SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTAC
HMENT_WRITE|SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_READ|SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE|SYNC_SUBPASS_SHADER_HUAWEI_INPUT_ATTACHMENT_READ, queue: VkQueue 0x5647b5cda570[], submit: 7, batch: 0, batch_tag: 276, command: vkCmdCopyBuffer, command_buf
fer: VkCommandBuffer 0x5647b5f1d4f0[(wgpu internal) PendingWrites], seq_no: 6, reset_no: 1).
2024-06-15T12:12:39.590956Z ERROR wgpu_hal::vulkan::instance:   objects: (type: QUEUE, hndl: 0x5647b5cda570, name: ?)
2024-06-15T12:12:39.626466Z ERROR wgpu_hal::vulkan::instance: VALIDATION [SYNC-HAZARD-READ-AFTER-WRITE (0xe4d96472)]
        Validation Error: [ SYNC-HAZARD-READ-AFTER-WRITE ] Object 0: handle = 0x5647b5cda570, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0xe4d96472 | vkQueueSubmit():  Hazard READ_AFTER_WRITE for entry 9, VkCommandBuffer 0x7c728456a7b0[main_transparent_pass_3d], Submitted
 access info (submitted_usage: SYNC_VERTEX_ATTRIBUTE_INPUT_VERTEX_ATTRIBUTE_READ, command: vkCmdDraw, seq_no: 2, reset_no: 11). Access info (prior_usage: SYNC_COPY_TRANSFER_WRITE, write_barriers: SYNC_FRAGMENT_SHADER_COLOR_ATTACHMENT_READ|SYNC_FRAGMENT_SHADER_DEPTH_STENCI
L_ATTACHMENT_READ|SYNC_FRAGMENT_SHADER_INPUT_ATTACHMENT_READ|SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_READ|SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE|SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_READ|SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTA
CHMENT_WRITE|SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_READ|SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE|SYNC_SUBPASS_SHADER_HUAWEI_INPUT_ATTACHMENT_READ, queue: VkQueue 0x5647b5cda570[], submit: 3, batch: 0, batch_tag: 184, command: vkCmdCopyBuffer, command_bu
ffer: VkCommandBuffer 0x5647b5f25790[(wgpu internal) PendingWrites], seq_no: 6, reset_no: 1).

Additional information

Output screenshot for readability:

image

@torsteingrindvik torsteingrindvik added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 15, 2024
@torsteingrindvik torsteingrindvik changed the title Using observers and gizmos triggers vulkan validation errors Simple gizmo usage might trigger vulkan validation errors Jun 15, 2024
@torsteingrindvik
Copy link
Contributor Author

Never seen this before just now doing some work on main.
I'm suspecting the recent wgpu update is the cause: 2825ac8

@torsteingrindvik
Copy link
Contributor Author

I confirmed locally that the wgpu upgrade is the first commit this happens on.

@janhohenheim janhohenheim added A-Rendering Drawing game state to the screen A-Gizmos Visual editor and debug gizmos S-Needs-Investigation This issue requires detective work to figure out what's going wrong O-Vulkan Specific to the Vulkan render API and removed S-Needs-Triage This issue needs to be labelled labels Jun 15, 2024
@robojeb
Copy link
Contributor

robojeb commented Jun 18, 2024

This occurs for me on 0.14.0-rc.3 but only if there is another Non-gizmo mesh rendering.
If the scene consists of entirely gizmos (which I have for some math tests) it renders without validation errors.

@Azorlogh
Copy link
Contributor

Happening for me too in 0.14.0-rc.3.
Linux/X11 + NVIDIA proprietary drivers
AdapterInfo { name: "NVIDIA GeForce RTX 2060", vendor: 4318, device: 7817, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "550.90.07", backend: Vulkan }

@torsteingrindvik
Copy link
Contributor Author

I just tried an example in a 0.14.0-rc.4 context and I still get problems.

gfx-rs/wgpu#5231

This WGPU issue seems relevant

@torsteingrindvik
Copy link
Contributor Author

https://discord.com/channels/691052431525675048/692572690833473578/1251537174181052436

Here's some discussion on discord about this issue from a couple of weeks ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Gizmos Visual editor and debug gizmos A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Vulkan Specific to the Vulkan render API 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