Not on all platforms via FrameTimingManager. There may be workarounds with costum heuristics and e.g. native plugins to get some platform specific counters to make up for the lack of FTM. I.e. not trivially and in general, no.
Iām seeing this weird behavior on Android.
In an empty test scene, the average GPU frame time remains roughly around 3.5ms at any FPS below 60 (I tested 5, 10, 15, 20 & 30). At 60 FPS, the GPU frame time jumps up to 10ms.
Could it be device specific? I tested it on a different Samsung device as well and the behavior was very similar but a bit delayed.
Unity 23.1.2f1 - Graphics API Vulkan
I feel like thatās not really a FrameTimingManager thing but something you should check out with a platform specific profiler, like one from your specific deviceās GPU Manufacturer/Designer(e.g. Arm Mobile Studio), for more concrete confirmation, but: Mobile devices have a limited power budget and they have heat build-ups to consider. So the higher the FPS, the more power will be needed by both the CPU and the GPU and more of that at the same time, as there is less idle time on the CPU. The screen may also need extra power for that. All of that means that less power is available at any point in the frame time, more heat is building up and the device is likely to down-clock the GPU as a consequence
That makes a lot of sense. This actually explains why the newer device took some time before thermal throttling the GPU.
Thank you. I will profile with Arm Mobile Studio (and other tools mentioned in ultimate profiling guide) for a more detailed analysis if the need arises.
I might be being really stupid, but on DX11/DX12, the frametiming stuff works wonderfully in editor, but not in a Windows build. I ticked the box under Player settings. Why is everything coming back as 0? 2022.3.3f1.
Google shows this page for many GPU profiling queries. Can you please elaborate on how to open this window, or at least point to a page that explains it?
Is it possible to get the gpuFrameTime on Quest 2 using OpenGLES3 and OpenXR?
This post might hint that itās not supported yet?
Can somebody help me understand the values a bit better. I have tested a build on a Samsung S10 (OpenGLES3). Itās running at 60fps. Frame time is 16ms, as expected. CPU time is 11ms which is understandable. GPU frame time is reported as 20ms. How can that be explained? As far as I understood this thread, only Metal could potentially report a higher GPU time than general frame time. Am I missing something? (2022.2.17, URP 14.0.7)
If itās only available in 2022 why is it in the documentation for 2021. With examples. This is just wasting peopleās time.
If youāre on Unity 2021, what options do you have for getting GPU frame timings?
Sorry for this - as a part of Dynamic Resolution feature we only supported on 2021 iOS
, macOS and tvOS (Metal only), Android (Vulkan only), Windows Standalone (DirectX 12 only), and UWP (DirectX 12 only). Weāve extended support to almost all platforms it in 2022, but it required changes that could destabilize 2021, so we didnāt backport those changes to 2021.
One option you may be able to use depending on the platform is native graphics plugin API - https://docs.unity3d.com/2021.3/Documentation/Manual/NativePluginInterface.html
It should be possible to obtain the render device and use it to issue timestamps/timerqueries at a certain point of frame and collect later.
It turns out it does work for my platform in 2021.3 , just not in the editor.
Funny. For me it works in the editor and standalone development builds but NOT in standalone release builds.
Unity 2021.3.22f1
The improvements mentioned in this thread landed on 2022.1.0a14
Thank you! Understandable.
Hi, I was wondering if you could help.
I am using Unity 2022.3.14f1.
I have a script that collects profiling data using ProfileRecorders with the Time Manager Manager enabled over 60 frames. However the data I am collecting seems quite inconsistent and it would be great to get some clarification on what I am seeing.
The stats I am collecting are :-
āCPU Total Frame Timeā
āCPU Main Thread Frame Timeā
āCPU Render Thread Frame Timeā
āGPU Frame Timeā
āMain Threadā
āPlayerLoopā
The problem I am seeing is that āCPU Total Frame Timeā, āCPU Main Thread Frame Timeā, āMain Threadā and āPlayerLoopā stats seem quite inconsistent, for example on one frame āCPU Total Frame Timeā is the slower value where as on another āCPU Main Thread Frame Timeā is slower and another the āPlayerLoopā stat is slower.
I would expect that there should be a stat that is consistently the slowest stat, that stat shows the time the whole frame takes on the CPU(including waiting for other threads to sync with the main thread).
Any information on this would be of great help.
For others following along, the above has been answered in this thread .
This ProfilerRecorder returns zeroes in non-Development Build iOS players, but works fine in Development Build iOS players, and in Unity Editor regardless of the Development Build setting. I am intentionally not setting the project setting to enable the FrameTimingManager in all builds, as the only release builds we want it enabled in are internal.
āCPU Main Thread Frame Timeā and āCPU Render Thread Frame Timeā ProfilerRecorders do not have this inconsistency. (2022.3.23f1, URP 14.0.10)
m_gpuRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Internal, "GPU Frame Time");
@chrismarch_1 thanks to you we noticed the examples here and in the documentation have not been updated to reflect the fact that these counters donāt belong to the Internal category but to the Rendering one. That was a late change to the code when the examples were already written.
Iām not sure thatād fix your issue but I didnāt get to test that theory. Iām on PTO for the next week and didnāt want to leave you hanging for too long though. If you give that a try, please let me know if that worked
Are the stats from the Frame Timing Manager the same as those in the DisplayStats of the URP Rendering Debugger?
(The overlay you can open by double tapping with 3 fingers on mobile or pressing both controller sticks in, see Rendering Debugger reference | Universal RP | 17.0.3).