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

Vulkan: FPS counter is not working on macOS with Intel integrated GPU #51371

Open
RevoluPowered opened this issue Aug 7, 2021 · 16 comments
Open

Comments

@RevoluPowered
Copy link
Contributor

Godot version

4.0.master

System information

MacOS

Issue description

Using the latest MoltenVK I'm not getting an FPS counter which works in master/4.0

I haven't ever seen it working.

Steps to reproduce

  1. Open master on Mac
  2. Open viewport info
  3. FPS counter will show the wrong values.

Minimal reproduction project

No response

@RevoluPowered
Copy link
Contributor Author

RevoluPowered commented Aug 7, 2021

Screenshot 2021-08-07 at 18 27 34

The data from MacOS.

@RevoluPowered
Copy link
Contributor Author

RevoluPowered commented Aug 7, 2021

image
Windows 10 results with 3177da1

@bruvzg
Copy link
Member

bruvzg commented Aug 7, 2021

Proper hardware timestamp support was added to the MoltenVK only 12 days ago - KhronosGroup/MoltenVK#1404. Probably, previous software implementation of timestamps (which returns tick count) had insufficient precision to measure frame time.

@Calinou Calinou added this to the 4.0 milestone Aug 7, 2021
@Calinou Calinou changed the title MacOS FPS counter is not working MacOS FPS counter is not working due to MoltenVK missing hardware GPU timestamp support Aug 7, 2021
@Calinou Calinou changed the title MacOS FPS counter is not working due to MoltenVK missing hardware GPU timestamp support Vulkan: FPS counter is not working on macOS due to MoltenVK missing hardware GPU timestamp support Aug 7, 2021
@bruvzg
Copy link
Member

bruvzg commented Aug 7, 2021

With master (f9696449eae1b99dd7293db6285c21d35e51d539) version on MoltenVK it's showing something, but values seems to be wrong (empty scene is definitely running with more than 6 FPS):
Screenshot 2021-08-07 at 21 24 49

@Calinou
Copy link
Member

Calinou commented Aug 7, 2021

With master (f9696449eae1b99dd7293db6285c21d35e51d539) version on MoltenVK it's showing something, but values seems to be wrong (empty scene is definitely running with more than 6 FPS):

If the scene is effectively running at very high framerates, then this could mean the GPU time is erroneously being multiplied by 1000 on the MoltenVK side. But I doubt it's running that fast on a hiDPI display, even in an empty scene 🙂

@bruvzg
Copy link
Member

bruvzg commented Aug 7, 2021

then this could mean the GPU time is erroneously being multiplied by 1000 on the MoltenVK side

It's probably not that simple. According to XCode Instruments profiler, average frame time is constant 16.68 ms (60 FPS, v-synced).

Screenshot 2021-08-07 at 21 39 58

@RevoluPowered
Copy link
Contributor Author

Nice so we can use the xcode instruments to measure frame time :) since its technically using Metal :D

@Calinou
Copy link
Member

Calinou commented Aug 7, 2021

It's probably not that simple. According to XCode Instruments profiler, average frame time is constant 16.68 ms (60 FPS, v-synced).

V-Sync is enabled by default (and perhaps forced by macOS too), but remember that this new Frame Time panel displays the time taken to render the frame on the GPU, not the time between two frames. This means that even with V-Sync enabled or FPS capped to a low value via low processor mode, it can report framerates above your monitor refresh rate.

It may be unusual at first, but it's definitely a win for laptop users and anyone using V-Sync in general (since you no longer need to make your machine hot and noisy to get accurate FPS reporting).

@bruvzg
Copy link
Member

bruvzg commented Aug 7, 2021

Nice so we can use the xcode instruments to measure frame time :) since its technically using Metal :D

It should be usable for performance monitoring, and MoltenVK is transferring Vulkan pipeline function names and debug comments to the Metal side. It's not a RenderDoc, but should give an overall view.
Screenshot 2021-08-07 at 21 56 55

@KoBeWi
Copy link
Member

KoBeWi commented Jun 4, 2022

Is this issue still valid in the newest alpha?

@snougo
Copy link

snougo commented Oct 16, 2022

Is this issue still valid in the newest alpha?

Yes, it still valid in beta3, at least on my Intel GPU macbook pro

@snougo
Copy link

snougo commented Nov 17, 2022

it still valid in beta5

@lostminds
Copy link

I just tried this on my mac (intel 4K iMac with Radeon Pro 560, macOS 13.0.1) and it seems to work fine now for me on 4.0.beta8

Screenshot 2022-12-16 at 13 15 16

@akien-mga
Copy link
Member

We've upgraded MoltenVK recently, including several months' work of improvements, so it might have fixed this.

Closing for now, please comment if you can still reproduce this issue in 4.0 beta 8 or later.

Repository owner moved this from To Assess to Done in 4.x Priority Issues Dec 16, 2022
@snougo
Copy link

snougo commented Dec 21, 2022

it still reproduced in beta9 on IntelGPU Mac

@akien-mga akien-mga reopened this Dec 21, 2022
@akien-mga akien-mga changed the title Vulkan: FPS counter is not working on macOS due to MoltenVK missing hardware GPU timestamp support Vulkan: FPS counter is not working on Intel macOS due to MoltenVK missing hardware GPU timestamp support Dec 21, 2022
@lostminds
Copy link

It still works in beta9 on my mac intel-processor mac with a radeon GPU so it's not a general intel macOS issue (and maybe never was then). So the bug title could be misleading since "Intel macOS" is probably understood as a mac with an intel-based processor (as opposed to the newer M1 processors).

@akien-mga akien-mga changed the title Vulkan: FPS counter is not working on Intel macOS due to MoltenVK missing hardware GPU timestamp support Vulkan: FPS counter is not working on macOS with Intel integrated GPU Dec 21, 2022
@akien-mga akien-mga moved this from Done to Todo in 4.x Priority Issues Jan 11, 2023
@clayjohn clayjohn modified the milestones: 4.0, 4.x Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants