Graphics PresentAndSync problem

Hello everyone.

I am working on a game, but ran into a problem while testing it on my android tablet.
The game runs a 6-7 FPS on my android Nexus 7, 2nd Generation. When i profile it i get this

Graphics.PresentAndSync - uses a huge amount of my CPU.
I tried with different rendering paths, i tested the scene only using the sprite diffuse shader. Changing the shader helps a bit but not much.

The same game runs with 20-25 FPS on my old slow iPad2 on iOS, which makes it seem like an android thing.

See image for the CPU usage in the profiler.

Did anyone run into the same problems?

Oh forgot to mention this, but i am using Unity 5.0.1

Can you try turning off VSync in quality settings?

Tried both Don’t Sync and Every V Blank - same outcome.

In a scene with a single sprite it uses around 12 ms! And its using the sprites diffuse shader :frowning:

If you see much time being spent in ‘Device.Present’ it usually means that the thread is blocked by the graphics driver to wait for the GPU to catch up. The Unity CPU profiler measures the wall time.
To check if the GPU is busy on the Nexus7(2013) you could use the Grapher in Qualcomm’s AdrenoProfiler, it is pretty good and easy to use.

In case you use the procedural skybox (the default in Unity 5) please try to disable it and clear with a solid color instead.

Can you provide some guidelines how to achieve this?

Thx will look into that. My camera is set to Solid Color.

Just check your camera’s Clear Flags

Hi guys,

We are facing performance issue with Nexus 7 as well, the game runs “fine” (~20 FPS) in Unity 4.6. We test with Unity 5.1.1 and the performance are very low (~5-6 FPS), the other devices we got (Xperia, more recent Nexus, IPad, Samsungs, etc…) doesn’t get a performance hit when switch to Unity 5.

I have removed any Skybox from Lighting panel, and set my camera to Solid Color, but it doesn’t change.

Someone as a tip ? @BFGames did you manage to find the issue ?

Thanks a lot.

Hey guys,

So i’m not sure where exactly the onset of this was for me, but I only noticed my performance issue AFTER my upgrade to Unity 5.2. I’m myself suspicious that it was REALLY the onset here, I likely just only noticed then. Regardless this is what i was seeing:

Same issue, Graphics.PresentandSync was taking up about 70-80 ms. I went down the standard performance checklists, and like many others, was experiencing this in what I would consider a VERY basic scene (though more complex than most were seeing).

So I went through the painstaking process of enabling and disabling piece by piece all the different graphical components in my game, and what I found was that my problem was a few icons I was displaying on a UGUI canvas (icon is an IMAGE). I added multiple OUTLINE components to the image, to give a styled look to the image. THOSE OUTLINES WERE THE ISSUE.

After reading up on it (and someone please correct me if I’m wrong here) each time I added an outline to that image, the renderer now has to take a second pass as the entire image, essentially doubling the render time. Hence, I woudl expect if you add MULTIPLE outline components to a single image, and also since that image was a status/game icon, its ALWAYS displaying, then the render passes would be exponential? (this is where I’m likely going to be corrected… but anyway…). If not exponential, then likely just due to the fact that we are making many passes (I had 4 outlines on a single icon to create a styled effect).

Removed multiple outlines on icons displayed on UGUI canvas… Back up to 60+/- fps on Android.

Thoughts anyone? Anyone seeing issues like this specific to images/outlines and/or ugui objects in general?

1 Like

according to this Significant Device.Present with VSync turned off - Questions & Answers - Unity Discussions
the profiler causes this delay

This is definitly not the same thing, we verified.

2 Likes

Guys in my case this happend because i have some filters on the camera like antialisaing and flares layer. i desactivate this and i had back to 55-60 fps

I had same problem but mine was because I must have inadvertently changed the shadow settings on my light. The Shadow Type → Resolution had been set to “Very High Resolution”, changed it to “Use Quality Settings” and all was well again! Hope it helps other people too.

It’s alive!
Looks like this has to do with some deep performance settings. Any clues?
I got the same issue. No shadows, no v-sync, and minimal unlit shaders using LWRP.

wouldn’t point at “some deep performance settings” , although there are plenty of settings dependent on where you deploy the build, make sure to look through everything. I had some random 50mb texture used for a skybox light material, and i thought i had an “empty scene”