vulkano icon indicating copy to clipboard operation
vulkano copied to clipboard

Running in release causes validation errors

Open jonathansty opened this issue 7 years ago • 6 comments
trafficstars

When running my vulkano application with cargo run --release I get a validation error:

Validation(ERROR): msg_code: 0:  [ VUID-vkDestroyFence-fence-01120 ] Object: 0xc (Type = 7) | Fence 0xc is in use. The Vulkan spec states: All queue submission commands that refer to fence must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyFence-fence-01120)

When quite I receive a slightly different error but is related to the same issue:

"VUID-vkDestroyFence-fence-01120 Fence 0x2e is in use. The Vulkan spec states: All queue submission commands that refer to fence must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyFence-fence-01120)"

My code isn't doing anything particularly 'smart':

 let fence = previous_frame_end.join(acquire_future)
        .then_execute(gfx_queue.clone(),result).unwrap()
        .then_swapchain_present(gfx_queue.clone(),swapchain.clone(), image_num)
        .then_signal_fence_and_flush();

        match fence {
            Ok(s) => { s.wait(None).unwrap() },
            Err(vulkano::sync::FlushError::OutOfDate) =>{
                recreate_swapchain = true;
            },
            Err(msg) => panic!("{:?}",msg)
        }

        previous_frame_end = Box::new(vulkano::sync::now(device.clone())) as Box<_>;

Weirdly enough in debug mode I do not get these validation messages.

jonathansty avatar Oct 06 '18 18:10 jonathansty

I'm not sure what the code snippet is for, it looks like one of the alternative workarounds listed in: https://github.com/vulkano-rs/vulkano/pull/955

Its not needed to reproduce this issue however, as the existing triangle example will trigger it. I thought this validation error was as at least mentioned in an issue somewhere, but github search isn't bringing anything up ¯\(ツ)/¯ Maybe the actual contents of the validation error was never mentioned.

rukai avatar Oct 07 '18 04:10 rukai

@rukai It should be similar to #955 . Although I'm not sure why I am receiving this validation error only in a build compiled with the --release option.

Although I'll have a closer look at #955 to see if I can somehow fix this... In the deferred example I changed following code:

        let after_frame = after_future.unwrap()
            .then_swapchain_present(queue.clone(), swapchain.clone(), image_num)
            .then_signal_fence_and_flush().unwrap();
        previous_frame_end = Box::new(after_frame) as Box<_>;

to this:

        let after_frame = after_future.unwrap()
            .then_swapchain_present(queue.clone(), swapchain.clone(), image_num)
            .then_signal_fence_and_flush().unwrap().wait(None).unwrap();

        previous_frame_end = Box::new(now(device.clone())) as Box<_>;

But still get this validation error. I'm not sure if I just don't understand it correctly or not to be honest.

jonathansty avatar Oct 07 '18 07:10 jonathansty

I seem to not be able to reproduce this with the new vkDebugUtilsMessengerEXT objects so I'm closing this issue.

I've tried the examples where I was seeing it previously.

jonathansty avatar Oct 12 '18 22:10 jonathansty

Actually spoke too soon, the examples do not show the issue anymore but I'm still seeing this message pop up in my own project.

Edit: examples also still have this problem. None of the examples use any debug validation layers, once I added the standard validation this problem showed up again.

jonathansty avatar Oct 12 '18 22:10 jonathansty

Ditto seeing this (only) in release mode as well on a project

m4b avatar Dec 31 '18 06:12 m4b

I am looking into this atm, still trying to figure out what the correct solution is..

rukai avatar Dec 31 '18 06:12 rukai