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

Validation layer error in sample application #421

Closed
IAmNotHanni opened this issue Jun 18, 2024 · 5 comments · Fixed by #424
Closed

Validation layer error in sample application #421

IAmNotHanni opened this issue Jun 18, 2024 · 5 comments · Fixed by #424
Labels
bug Something isn't working next release To be done as soon as possible

Comments

@IAmNotHanni
Copy link
Contributor

IAmNotHanni commented Jun 18, 2024

Hello
For current main (7942b79), I get this validation error on Windows 11 with CMake 3.26.3 and Visual Studio 17.10.3. The cube of the sample application is being rendered correctly though. The validation layer error is printed every frame (I am only showing one here in my logs).

Running VMA sample application on AMD Ryzen™ 9 7950X (AMD Radeon(TM) Graphics)

Vulkan Memory Allocator Sample 3.1.0
Vulkan API version used: 1.3
physicalDeviceProperties:
    driverVersion: 0x8000FA
    vendorID: 0x1002 (AMD)
    deviceID: 0x164E
    deviceType: 1 (INTEGRATED_GPU)
    deviceName: AMD Radeon(TM) Graphics
    limits:
        maxMemoryAllocationCount: 4096
        bufferImageGranularity: 1 B
        nonCoherentAtomSize: 128 B
physicalDeviceVulkan11Properties:
    maxMemoryAllocationSize: 2147483648 B (2.00 GB)
physicalDeviceVulkan12Properties:
    driverID: 1 (AMD_PROPRIETARY)
    driverName: AMD proprietary driver
    driverInfo: 22.40.40 (AMD proprietary shader compiler)

MEMORY HEAPS:
heapCount=3, typeCount=8
Heap 0: 268435456 B (256.00 MB) DEVICE_LOCAL, MULTI_INSTANCE
    Type 0: DEVICE_LOCAL
    Type 4: DEVICE_LOCAL, DEVICE_COHERENT (AMD), DEVICE_UNCACHED (AMD)
Heap 1: 16437477376 B (15.31 GB)
    Type 1: HOST_VISIBLE, HOST_COHERENT
    Type 3: HOST_VISIBLE, HOST_COHERENT, HOST_CACHED
    Type 5: HOST_VISIBLE, HOST_COHERENT, DEVICE_COHERENT (AMD), DEVICE_UNCACHED (AMD)
    Type 7: HOST_VISIBLE, HOST_COHERENT, HOST_CACHED, DEVICE_COHERENT (AMD), DEVICE_UNCACHED (AMD)
Heap 2: 268435456 B (256.00 MB) DEVICE_LOCAL, MULTI_INSTANCE
    Type 2: DEVICE_LOCAL, HOST_VISIBLE, HOST_COHERENT
    Type 6: DEVICE_LOCAL, HOST_VISIBLE, HOST_COHERENT, DEVICE_COHERENT (AMD), DEVICE_UNCACHED (AMD)

Conclusions:
- 2 heaps are DEVICE_LOCAL, total 512.00 MB.
- 2 heaps are HOST_VISIBLE, total 15.56 GB.
- 1 heaps are DEVICE_LOCAL and HOST_VISIBLE, total 256.00 MB.
- No types are HOST_VISIBLE but not HOST_COHERENT.
- No types are not DEVICE_LOCAL and not HOST_VISIBLE.
- 4 types are AMD-specific DEVICE_COHERENT or DEVICE_UNCACHED.
- No types are LAZILY_ALLOCATED.
- A buffer with VERTEX_BUFFER usage can be created in some non-DEVICE_LOCAL type.
- An image with OPTIMAL tiling and SAMPLED usage can be created in some non-DEVICE_LOCAL type.

Enabled extensions and features:
Validation layer: 1
Sparse binding: 1
VK_EXT_memory_budget: 1
VK_AMD_device_coherent_memory: 1
bufferDeviceAddress: 1
VK_EXT_memory_priority: 1
VK_KHR_maintenance5: 0

VUID-vkAcquireNextImageKHR-semaphore-01779 ║ Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01779 ] Object 0:
handle = 0x3fbcd60000000028, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x5717e75b | vkAcquireNextImageKHR():
Semaphore must not have any pending operations. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must not have any
uncompleted signal or wait operations pending (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/
vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779)

Running VMA sample application on NVidia RTX 3090

Vulkan Memory Allocator Sample 3.1.0
Vulkan API version used: 1.3
physicalDeviceProperties:
    driverVersion: 0x8AD54000
    vendorID: 0x10DE (NVIDIA)
    deviceID: 0x2204
    deviceType: 2 (DISCRETE_GPU)
    deviceName: NVIDIA GeForce RTX 3090
    limits:
        maxMemoryAllocationCount: 4294967295
        bufferImageGranularity: 1024 B
        nonCoherentAtomSize: 64 B
physicalDeviceVulkan11Properties:
    maxMemoryAllocationSize: 4292870144 B (4.00 GB)
physicalDeviceVulkan12Properties:
    driverID: 4 (NVIDIA_PROPRIETARY)
    driverName: NVIDIA
    driverInfo: 555.85

MEMORY HEAPS:
heapCount=2, typeCount=6
Heap 0: 25507659776 B (23.76 GB) DEVICE_LOCAL
    Type 1: DEVICE_LOCAL
    Type 2: DEVICE_LOCAL
    Type 5: DEVICE_LOCAL, HOST_VISIBLE, HOST_COHERENT
Heap 1: 16706387968 B (15.56 GB)
    Type 0:
    Type 3: HOST_VISIBLE, HOST_COHERENT
    Type 4: HOST_VISIBLE, HOST_COHERENT, HOST_CACHED

Conclusions:
- 1 heaps are DEVICE_LOCAL, total 23.76 GB.
- All heaps are HOST_VISIBLE.
- No types are HOST_VISIBLE but not HOST_COHERENT.
- 1 types are not DEVICE_LOCAL and not HOST_VISIBLE.
- No types are AMD-specific DEVICE_COHERENT or DEVICE_UNCACHED.
- No types are LAZILY_ALLOCATED.
- A buffer with VERTEX_BUFFER usage can be created in some non-DEVICE_LOCAL type.
- An image with OPTIMAL tiling and SAMPLED usage can be created in some non-DEVICE_LOCAL type.

Enabled extensions and features:
Validation layer: 1
Sparse binding: 1
VK_EXT_memory_budget: 1
VK_AMD_device_coherent_memory: 0
bufferDeviceAddress: 1
VK_EXT_memory_priority: 1
VK_KHR_maintenance5: 1

VUID-vkAcquireNextImageKHR-semaphore-01779 ║ Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01779 ] Object 0:
handle = 0x3fbcd60000000028, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x5717e75b | vkAcquireNextImageKHR(): 
Semaphore must not have any pending operations. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must not have any
uncompleted signal or wait operations pending (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/
vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779)

Running VMA sample application on Intel Arc A770

Vulkan Memory Allocator Sample 3.1.0
Vulkan API version used: 1.3
physicalDeviceProperties:
    driverVersion: 0x19544A
    vendorID: 0x8086 (Intel)
    deviceID: 0x56A0
    deviceType: 2 (DISCRETE_GPU)
    deviceName: Intel(R) Arc(TM) A770 Graphics
    limits:
        maxMemoryAllocationCount: 4338804
        bufferImageGranularity: 1 B
        nonCoherentAtomSize: 1 B
physicalDeviceVulkan11Properties:
    maxMemoryAllocationSize: 16777216000 B (15.62 GB)
physicalDeviceVulkan12Properties:
    driverID: 5 (INTEL_PROPRIETARY_WINDOWS)
    driverName: Intel Corporation
    driverInfo: Intel driver

MEMORY HEAPS:
heapCount=3, typeCount=4
Heap 0: 16777216000 B (15.62 GB) DEVICE_LOCAL
    Type 0: DEVICE_LOCAL
Heap 1: 16706387968 B (15.56 GB)
    Type 1: HOST_VISIBLE, HOST_COHERENT
    Type 2: HOST_VISIBLE, HOST_COHERENT, HOST_CACHED
Heap 2: 268435456 B (256.00 MB) DEVICE_LOCAL
    Type 3: DEVICE_LOCAL, HOST_VISIBLE, HOST_COHERENT

Conclusions:
- 2 heaps are DEVICE_LOCAL, total 15.88 GB.
- 2 heaps are HOST_VISIBLE, total 15.81 GB.
- 1 heaps are DEVICE_LOCAL and HOST_VISIBLE, total 256.00 MB.
- No types are HOST_VISIBLE but not HOST_COHERENT.
- No types are not DEVICE_LOCAL and not HOST_VISIBLE.
- No types are AMD-specific DEVICE_COHERENT or DEVICE_UNCACHED.
- No types are LAZILY_ALLOCATED.
- A buffer with VERTEX_BUFFER usage can be created in some non-DEVICE_LOCAL type.
- An image with OPTIMAL tiling and SAMPLED usage can be created in some non-DEVICE_LOCAL type.

Enabled extensions and features:
Validation layer: 1
Sparse binding: 1
VK_EXT_memory_budget: 1
VK_AMD_device_coherent_memory: 0
bufferDeviceAddress: 1
VK_EXT_memory_priority: 1
VK_KHR_maintenance5: 0

VUID-vkAcquireNextImageKHR-semaphore-01779 ║ Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01779 ] Object 0:
handle = 0xb097c90000000027, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x5717e75b | vkAcquireNextImageKHR(): 
Semaphore must not have any pending operations. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must not have any
uncompleted signal or wait operations pending (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/
vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779)

Looks like there is something wrong with swapchain management. I can't promise if I have time to look into this at the moment, but I will if I have the time.

best regards
Johannes

@IAmNotHanni
Copy link
Contributor Author

IAmNotHanni commented Jun 18, 2024

Adding vkDeviceWaitIdle(g_hDevice); at the end of DrawFrame() does "solve" the issue on all the gpus I tested, but it should not be fixed like this in my opinion.

@IAmNotHanni
Copy link
Contributor Author

IAmNotHanni commented Jun 21, 2024

To make debugging of the sample application easier, we should make use of vkSetDebugUtilsObjectNameEXT, especially since it's already loaded in the current sample app, but not used yet.

I created an issue for this: #423

@IAmNotHanni
Copy link
Contributor Author

By using vkSetDebugUtilsObjectNameEXT, I found out the issue is about g_hImageAvailableSemaphore, and not g_hRenderFinishedSemaphore.

@IAmNotHanni
Copy link
Contributor Author

Looks like this issue is also mentioned here: https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Rendering_and_presentation

@IAmNotHanni
Copy link
Contributor Author

Ah I think I found the problem: we need one semaphore for each swapchain image, not one semaphore for all.

@adam-sawicki-a adam-sawicki-a added bug Something isn't working next release To be done as soon as possible labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next release To be done as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants