layers: Allow using uncached buffer for Debug Printf
Adds option to force using AMD_DEVICE_COHERENT_MEMORY for debug printf buffer to print messages even if VK_ERROR_DEVICE_LOST is encountered.
Forcing extension and device feature if not enabled by application.
Added workaround for atomic operations in uncached memory being in cache anyway.
Added workaround to failing MapMemory after DEVICE_LOST (occurs on AMD): When using uncached buffer, do not unmap buffer until messages are analyzed.
This PR attempts to implement #6101 Tested on AMD and Intel (extension not public yet) using this modified vkcube: https://github.com/dorian-apanel-intel/Vulkan-Tools/commit/e0226930a7958bb4964428691dd1376c3447bca3
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
CI Vulkan-ValidationLayers build queued with queue ID 5177.
CI Vulkan-ValidationLayers build # 12676 running.
CI Vulkan-ValidationLayers build # 12676 passed.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
@juan-lunarg @Tony-LunarG
I don't see any testing being added. Is the plan to add them later? Has this been tested? Is there a test that can go with this?
I've only tested it manually so far.
Would it be enough to copy one test from tests\negative\debug_printf.cpp and modify it to use uncached buffer and hang?
CI Vulkan-ValidationLayers build queued with queue ID 5894.
CI Vulkan-ValidationLayers build # 12692 running.
@juan-lunarg @Tony-LunarG
I don't see any testing being added. Is the plan to add them later? Has this been tested? Is there a test that can go with this?
I've only tested it manually so far. Would it be enough to copy one test from
tests\negative\debug_printf.cppand modify it to use uncached buffer and hang?
I think so, as long as the test gets a DEVICE_LOST and then successfully parses a debug printf
CI Vulkan-ValidationLayers build # 12692 passed.
Would it be enough to copy one test from tests\negative\debug_printf.cpp and modify it to use uncached buffer and hang?
This sounds like it would cause problems for Jenkins CI (Although if we switched to ctest maybe not... since the test would be in it's own process).
Because currently CI invokes the test executable and tries running all tests.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
@Tony-LunarG @juan-lunarg @jeremyg-lunarg
- I've added unit test, had to pass a value using push constants, because hardcoded infinite loop was not hanging on AMD.
- I modified layer_options.cpp file to move option from test to layer. It is not perfect, but after looking at #5895, I think it will need rewrite soon anyway.
- After updating AMD drivers, Atomics WA is no longer needed there, but leaving it for Intel for now.
- NVidia does not support required extension yet.
- Force push was required due to printf test file rename.
I plan to add also unit test for Page Fault, but preferably in another pull request.
Author dorian-apanel-intel not on autobuild list. Waiting for curator authorization before starting CI build.
CI Vulkan-ValidationLayers build queued with queue ID 7794.
CI Vulkan-ValidationLayers build # 12728 running.
CI Vulkan-ValidationLayers build # 12728 running.
CI Vulkan-ValidationLayers build # 12728 failed.
Galaxy S22 testing failed
[ RUN ] NegativeDebugPrintf.UncachedBuffer
jni/../../tests/framework/error_monitor.cpp:200: Failure
Failed
Validation Error: [ UNASSIGNED-DEBUG-PRINTF ] Object 0: handle = 0x6c1d064220, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x92394c89 | Setup Error. Detail: (Unable to allocate device memory. Device could become unstable.)
jni/../../tests/framework/error_monitor.cpp:241: Failure
Failed
Did not receive expected error 'Here are three float values 1.000000, 3.141500, 0.000000'
[ FAILED ] NegativeDebugPrintf.UncachedBuffer (5836 ms)
Galaxy S22 testing failed
[ RUN ] NegativeDebugPrintf.UncachedBuffer jni/../../tests/framework/error_monitor.cpp:200: Failure Failed Validation Error: [ UNASSIGNED-DEBUG-PRINTF ] Object 0: handle = 0x6c1d064220, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x92394c89 | Setup Error. Detail: (Unable to allocate device memory. Device could become unstable.) jni/../../tests/framework/error_monitor.cpp:241: Failure Failed Did not receive expected error 'Here are three float values 1.000000, 3.141500, 0.000000' [ FAILED ] NegativeDebugPrintf.UncachedBuffer (5836 ms)
I don't think there's much the test can do about that. I'll just add the new test to the S22 blacklist.
CI Vulkan-ValidationLayers build queued with queue ID 9060.
CI Vulkan-ValidationLayers build # 12764 running.
CI Vulkan-ValidationLayers build # 12764 passed.
CI Vulkan-ValidationLayers build queued with queue ID 10076.