Author Topic: GPU Caps Viewer 1.40: Vulkan - Tessellation v2 - sporadic TDR on Intel HD 620  (Read 358 times)

0 Members and 1 Guest are viewing this topic.

CK

  • Newbie
  • *
  • Posts: 6
    • View Profile
This is a bit tricky one, since it does not happen always.

Repro is simple: just start the demo and close it (escape key).

There is no visible problem, but if you check the system log sometimes you see 4101 event being logged at the time of closing the app.
It looks like resources are destroyed by the application while being still referenced by command buffers on GPU.

When the demo is running it does something like this:
Code: [Select]
....
vkWaitForFences()
vkQueueSubmit()
vkWaitForFences()
vkQueueSubmit()
vkWaitForFences()
vkQueueSubmit()
....

When user closes demo, application stops above sequence and starts to destroy objects and free memory as below:
Code: [Select]
vkDestroyBuffer() usage 0x01 VK_BUFFER_USAGE_TRANSFER_SRC_BIT size 0x0000000000020000
vkFreeMemory size x0000000000020000
vkDestroyBuffer() usage 0x80 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT size 0x0000000000004300
vkFreeMemory() size 0x0000000000004300
vkDestroyBuffer() usage 0x40 VK_BUFFER_USAGE_INDEX_BUFFER_BIT size 0x0000000000001000
vkFreeMemory() size 0x0000000000001000
vkDestroyImageView()
vkDestroyImage()
vkFreeMemory() size 0x0000000000020000
vkDestroyPipeline()
vkDeviceWaitIdle()

Destroying sequence starts right after last submit which perhaps shouldn't take place.

From VK spec:
Quote
vkDestroyBuffer()            "All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution"
vkFreeMemory()       "All submitted commands that refer to memory (via images or buffers) must have completed execution"
vkDestroyImageView()   "All submitted commands that refer to imageView must have completed execution"
vkDestroyImage()           "All submitted commands that refer to image, either directly or via a VkImageView, must have completed execution"
vkDestroyPipeline()            "All submitted commands that refer to pipeline must have completed execution"


The simple fix in the demo would be just to add vkDeviceWaitIdle between the last vkQueueSubmit and first vkDestroy*



JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1709
    • View Profile
    • Geeks3D.com
Yes I will look at my Vulkan code in order to add a vkDeviceWaitIdle() somewhere.  I already call vkDeviceWaitIdle() but I should call it sooner  ;)

Now, one thing you can do, to see if it can improve things a bit,  is to add a wait_for_gpu() in the demo terminate script. Edit the file
gxldemos/vk-tessellation/main_vk.xml and add gh_renderer.wait_for_gpu() in the TERMINATE script:

Code: [Select]
<script name="terminate_scene" run_mode="TERMINATE" >
  <raw_data><![CDATA[

gh_renderer.wait_for_gpu()

gh_gpu_buffer.unmap(ub1)
gh_imgui.terminate()

  ]]></raw_data>
</script>

Let me know.

CK

  • Newbie
  • *
  • Posts: 6
    • View Profile
It does seem to work  :)

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1709
    • View Profile
    • Geeks3D.com
Cool, I will release a new update as soon as possible. Thanks for your tests!

CK

  • Newbie
  • *
  • Posts: 6
    • View Profile
I run the test several times with 1.40.1 and the problem was not happening. So it seems to be fixed  :)
Thanks!