Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Troubleshooting GPU bottleneck via Profiler

Discussion in 'Editor & General Support' started by geplourde, May 14, 2019.

  1. geplourde

    geplourde

    Joined:
    May 31, 2017
    Posts:
    17
    I've been trying to figure out how to increase FPS in my current project but don't know what I should do. My project seems to be GPU bottlenecked but despite changes I make, the project runs nearly the same. Could anyone point me in the right direction?
     

    Attached Files:

  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,980
    I'd take a look at the Frame Debugger. Basically, pause the game while it's running, open the Frame Debugger, and the observe all the different components of rendering that it shows. Generally, for each draw call, it explains why it could not batch the draw call with the previous draw call. It can help point out issues.

    What changes have you made to try to address the issue? Things you generally want to look at:
    • Have you flagged your materials as supporting GPU instaning?
    • How many lights do you have in your screen? A large number of lights can kill performance under forward rendering. (Have you tried deferred rendering?)
    • Are objects that don't move flagged as static?
    • Have you tried turning off certain objects to pointpoint which, if any, is most responsible for the performance issue?
     
    xVergilx likes this.
  3. geplourde

    geplourde

    Joined:
    May 31, 2017
    Posts:
    17
    • I've enabled GPU instancing on my materials, but most of them are static so do not benefit from this. I also tried changing them to non-static so I could utilize GPU instancing but it just made the performance worse overall.
    • I only have about 5 lights on screen at a time, when I disable them it saves me about 5-10 fps but nothing major
    • all non-moving objects are marked as static
    • I've tried pinpointing the issue and it's just the general rendering of objects... The terrain and object meshes causes the largest performance hit.

    Would reducing the tri count help the GPU drastically? That's the only thing I haven't tried yet, but don't really know how as I use standard mesh planes primarily. Other than that, I've tried many things such as mip maps, GPU instancing, reducing lights, reducing light pixel count, reducing textures, disabling shadows. Nothing causes such a performance hit as the objects and terrain.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,980
    I recently went through a round of performance tuning, and spent quite a long time reducing tri counts by implementing LOD and occlusion culling. Although those are important, they didn't actually have that much of an impact. One really bad area was pushing 3 million verts (or tris, I can't remember). I got it down to about 300,000 instead, but it only changed the FPS by maybe 10 or so. Not what I had hoped for.

    It turned out, in my case, that the kill FPS killer was a render texture I was using, which I hadn't noticed I'd originally set to 2K resolution. Changing the resolution to a lower setting made a huge difference.

    So, not that I expect your issue would be similar, but it's just to say it's not always about the tri/vert counts. So, before you spend a ton of effort reducing tri/vert count, you should probably keep exploring what's actually causing the issue.

    Unfortunately, the best advice I can give is to disable things one at a time until you can (hopefully) pinpoint one really bad offender. It's slow and tedious, and I look forward to better understand the tooling that would point me in the right direction to isolate GPU performance issues more quickly.
     
    geplourde likes this.