Bug 108909

Summary: Vkd3d test failure test_resolve_non_issued_query_data()
Product: Mesa Reporter: Timothy Arceri <t_arceri>
Component: Drivers/Vulkan/intelAssignee: Intel 3D Bugs Mailing List <intel-3d-bugs>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: jason, t_arceri
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Timothy Arceri 2018-11-30 03:29:10 UTC
Tested on SKL.

The d3d12 test suite can be run using the command:

tests/d3d12 or by running make check

Result:

d3d12:18341: Test failed: Got unexpected timestamp 0xdeadbeef.

For comparision the test passes on RADV.

Instructions for building the Vkd3d test suite:
-----------------------------------------------

Source code: git://source.winehq.org/git/vkd3d.git

autogen.sh
configure
make

Updated Spriv headers may be needed:

https://github.com/KhronosGroup/Vulkan-Headers.git
https://github.com/KhronosGroup/SPIRV-Headers.git

CPPFLAGS="-I/home/tarceri/git/SPIRV-Headers/include -I/home/tarceri/git/Vulkan-Headers/include" ./configure

Also an undated version of widl (a tool in the wine project) may be needed:

git://source.winehq.org/git/wine.git

./configure --without-freetype
make tools/widl

Then pass the new build to configure for Vkd3d e.g.

WIDL=~/git/wine/tools/widl/widl ./configure
Comment 1 Józef Kucia 2018-11-30 09:45:11 UTC

*** This bug has been marked as a duplicate of bug 108894 ***
Comment 2 Samuel Iglesias Gonsálvez 2018-12-03 10:54:30 UTC
This test is still failing after commit:

commit 37f9788e9a8e443772b5ad6f339567e6ae6a8320
Author: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Date:   Thu Nov 29 13:02:03 2018 +0000

    anv: flush pipeline before query result copies

So it seems that the bug is different, for the time being, I unmark it as a duplicate of bug 108909.
Comment 3 Lionel Landwerlin 2018-12-03 14:23:46 UTC
I'm afraid we'll need a render target flush...
The stall at pixel scoreboard doesn't ensure everything has landed.
Comment 4 Samuel Iglesias Gonsálvez 2018-12-04 11:55:31 UTC
(In reply to Lionel Landwerlin from comment #3)
> I'm afraid we'll need a render target flush...
> The stall at pixel scoreboard doesn't ensure everything has landed.

I was about to say that. This diff fixes the issue:

diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c
index 4831c4ea334..46c12bfe7d6 100644
--- a/src/intel/vulkan/genX_query.c
+++ b/src/intel/vulkan/genX_query.c
@@ -529,6 +529,7 @@ void genX(CmdWriteTimestamp)(
          pc.DestinationAddressType  = DAT_PPGTT;
          pc.PostSyncOperation       = WriteTimestamp;
          pc.Address                 = anv_address_add(query_addr, 8);
+         pc.RenderTargetCacheFlushEnable = true;
 
          if (GEN_GEN == 9 && cmd_buffer->device->info.gt == 4)
             pc.CommandStreamerStallEnable = true;
Comment 5 Samuel Iglesias Gonsálvez 2018-12-04 12:08:04 UTC
Oh forget previous diff, Lionel sent a patch for review with the fix :)
Comment 6 Lionel Landwerlin 2018-12-05 11:46:47 UTC
Fixed for real with :

commit 9a7b3199037ac4b798974f561067cb3d66be8010
Author: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Date:   Mon Dec 3 14:33:35 2018 +0000

    anv/query: flush render target before copying results


There is also a crucible test if anybody wants to review it :

https://patchwork.freedesktop.org/series/53479/

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.