google / gapid

Graphics API Debugger
https://gapid.dev
Apache License 2.0
2.21k stars 328 forks source link

Capturing Basemark GPU Vulkan medium produces different frame counts (VkTrace vs GAPID) #2106

Open MarkY-LunarG opened 6 years ago

MarkY-LunarG commented 6 years ago

GAPID 1.1.0 Windows 10 64-bit Dell XPS 15 w/ 16GB RAM Intel Integrated and Nvidia 960M

I captured the BasemarkGPU benchmark using Vulkan's medium quality test and I get different results.

  1. Set EXE to C:\Program Files\Basemark GPU\binaries\BasemarkGPU_vk.exe
  2. Set working directory to C:\Program Files\Basemark GPU\binaries
  3. Set arguments to ResultUpload false TestType ExperienceMedium TextureCompression bc7 AssetPath assets/bsb ProgressBar false Fullscreen false

When I capture with VkTrace, I get 1536 frames, but when I capture the same benchmark with GAPID I only get 817 frames (according to some messages I see when I run gapit video). I know VkTrace identifies frames based on each QueueSubmit, is GAPID identifying frames differently? Or is GAPID not recording every frame?

AWoloszyn commented 6 years ago

GAPID uses VkQueuePresent as a frame delimiter in Vulkan

MarkY-LunarG commented 6 years ago

My mistake, VkTrace also uses vkQueuePresent.

AWoloszyn commented 6 years ago

The difference could be time taken during the trace, it depends on how that benchmark behaves. If it has a fixed time (rather than a fixed # of frames), then performance differences could account for the difference.

MarkY-LunarG commented 6 years ago

I understand that. I also see a difference in other apps which I render for about 30 seconds of DOTA2 but I only have around 200 frames in my trace and GAPID doesn't appear to be slowing the playback to < 10fps. Could the server lag recording that much so it only captured <20 seconds of gameplay?

AWoloszyn commented 6 years ago

We do buffer some amount of data, although it is ~32k so I would only expect you to be missing maybe the last 32k of stuff.

If you can share with me how you ran this, I would be happy try and see what is going on.

MarkY-LunarG commented 6 years ago

You should be able to run it with the commands in the description above. It also includes a link to the download location.

AWoloszyn commented 6 years ago

Sorry about that, somehow I missed that.

AWoloszyn commented 6 years ago

We have made many improvements to windows trace performance. I think this should now be fixed. Please feel free to let me know if this is still an issue.

MarkY-LunarG commented 6 years ago

What build should I use to test this? What's out in public or a private build?

AWoloszyn commented 6 years ago

The most recent release 1.2.0 should have the fixes. We plan on releasing 1.2.1 which may have a couple of minor improvements, but nothing significant in this area.

On Thu, Nov 8, 2018, 5:22 PM Mark Young <notifications@github.com wrote:

What build should I use to test this? What's out in public or a private build?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/google/gapid/issues/2106#issuecomment-437177618, or mute the thread https://github.com/notifications/unsubscribe-auth/AIn9DEvve-3aQqK4ENG1nupWM4qx4UCcks5utK6ngaJpZM4VnVDw .

MarkY-LunarG commented 6 years ago

Ok. I've tried the v1.2.0 release with both BaseMark and DOTA2 and I'm not able to verify. First, the frame count for BM looks very similar (around 980), but DOTA2's trace won't even give me that information after 20 minutes of attempting to run the video.

Also, I can no longer screenshot to see what the images are so I can verify that at least the last few frames I saw were captured. I've tried screenshoting on both as well, but I keep getting this:

DOTA:

10:02:58.527 W: <gapis> Framebuffer error after capture<65246646c13220d064cc9463e31abf4eb36d7db0>.commands[100]: Unknown format for Color attachment: VK_FORMAT_UNDEFINED

BaseMark:

09:50:59.705 W: <gapis> Framebuffer error after capture<2fa450d895b4911d1b4f574e6dbf6d57ac9afa95>.commands[800]: Unknown format for Color attachment: VK_FORMAT_UNDEFINED
16:50:59.742 E: <gapit> rpc error: code = 13 desc = transport is closing

I've tried frames towards the end and the beginning on multiple captures and I keep getting the same message.

My DOTA frame capture batch file is the following (I pass the frame in as the argument):

pushd C:\Program Files (x86)\gapid
gapit screenshot -at %1 -out C:\temp\dota_frame_%1.png C:\temp\dota.gfxtrace
popd
AWoloszyn commented 6 years ago

Thanks for testing this. The DOTA problem sounds like we may be hitting a trace that is too large (another bug is open to see that), I can take a look at that.

You can run gapit unpack on the trace and count the number of VkQueuePresent calls to see how many frames are in the trace.

AWoloszyn commented 6 years ago

Specifically you would want to look for

BeginGroup(msg: vkQueuePresent Otherwise you may double-count things.