wgpu: Vulkan Validation Error: Cannot free VkBuffer that is in use by a command buffer.

Description Vulkan validation error:

ERROR gfx_backend_vulkan: 
VALIDATION [VUID-vkDestroyBuffer-buffer-00922 (0xe4549c11)] : Validation Error: [ VUID-vkDestroyBuffer-buffer-00922 ] Object 0: handle = 0x4ce96a00000014e6, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0xe4549c11 | Cannot free VkBuffer 0x4ce96a00000014e6[] that is in use by a command buffer. The Vulkan spec states: All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922)
object info: (type: BUFFER, hndl: 0x4ce96a00000014e6)

I think this occurs in veloren when a switch between scenes is initiated that is quickly interrupted. Since I get it after getting kicked to the character selection screen by an error from the server.

Repro steps Attached API trace

Expected vs observed behavior No validation errors

Extra materials wgpu-trace.zip wgpu-trace.z01.zip wgpu-trace.z02.zip should be able to extract these by removing the .zip from the last two and running unzip wpgu-trace.zip

Platform

OS: Manjaro 21.1.0 Pahvo
DE: Xfce4
GPU: AMD Radeon HD 7900 Series (TAHITI, DRM 3.40.0, 5.10.49-1-MANJARO, LLVM 12.0.0)
wgpu commit: a92b8549a8e2cb9dac781bafc5ed32828f3caf46

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 20 (15 by maintainers)

Commits related to this issue

Most upvoted comments

It seems like I can actually still reproduce this for my original case (but not in the examples). It only occurs in a very specific scenario so I had not noticed before. I will need to find some time to see if I can test this with an updated version of wgpu.

Perhaps you could branch out the actual repro case for me to try?

I completely missed this!

It seems like I can no longer reproduce this, I ran cargo test --example water on several branches: v0.10, v0.11, v0.12, and master. None of them produced this validation error. I can only assume a driver update has resolved it.

Strangely, I also didn’t get any test failures like this one which I had before:

thread 'main' panicked at 'Image data mismatch! Outlier count 2359296 over limit 460. Max difference 255', wgpu/examples/water/../../tests/common/image.rs:134:13

Either I’m running the test differently or a driver update fixed both things.

Current gpu info: From glinfo:

AMD Radeon HD 7900 Series (TAHITI, DRM 3.40.0, 5.10.79-1-MANJARO, LLVM 13.0.0)

From vulkaninfo:

VkPhysicalDeviceDriverProperties:
---------------------------------
	driverID           = DRIVER_ID_MESA_RADV
	driverName         = radv
	driverInfo         = Mesa 21.2.5
	conformanceVersion = 1.2.3.0
VkPhysicalDeviceProperties:
---------------------------
	apiVersion        = 4202678 (1.2.182)
	driverVersion     = 88088581 (0x5402005)
VK_LAYER_KHRONOS_validation (Khronos Validation Layer) Vulkan version 1.2.199,

I think I figured out how to get the test to not panic (by deleting the reference image). And it appears to still be producing vulkan validation errors and hanging.

@kvark thanks for the tip, here is the link (it should last 24hr let me know if another upload is needed) https://wormhole.app/d9kpY#oEaxV-v-Moh-FppzVmSREA