Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Bug Potential Bug - Vsync taking up to 90ms in development Build

Discussion in 'General Graphics' started by TheReveng3r, Feb 2, 2023.

  1. TheReveng3r

    TheReveng3r

    Joined:
    Jan 19, 2022
    Posts:
    2
    Hello,

    I have a very strange issue with my unity(2021.2.19f1), My game runs perfectly at 60 fps for 1-2 minutes and then Vsync start to take my fps down to 30-40 fps for no reason.

    Why am I suspecting this might be a unity bug?
    - Because I close them game in a zone where I have 30 fps because of vsync and then I open the game again and I have 60 fps for 1-2 minutes again and then again 30 fps without doing much in game.

    What have I tried?
    -I tired to disable Vsync from unity and for some reason it was still activated.
    -I tried opening 3 games at once (my game, Mirm global and league of legends) all of them on ULTRA - my game had 30 FPS the other games had over 60 FPS with no drops
    -I tried the game on much powerful devices ( PC with 3070ti and laptop with 3060 ) and those devices don't have my issue

    I ran out of idea, please help.


    Laptop Razer Blade 17 Pro - System Description:
    CPU: i7-10875H
    RAM 32GB
    GPU - RTX 2080 SUPER Max-Q 8GB

    I have attached a few screenshots from profiler below:
    1.png 4.png 3.png 2.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,255
    It means the GPU is busy still rendering the previous frame(s). Even with vsync disabled, if the GPU hasn't finished rendering the previous frame the CPU will eventually have to stall to let it finish before it can present another frame to the GPU.

    Understand all of the metrics on the Profiler you have shown are related to the CPU only. You can add GPU profiling under the Profiler Modules to get better insight into what's happening there, and you'll see that the GPU frame times your limiting factor.

    As for the weird behavior you're seeing, either something you're doing is much more expensive to render than you realize, or you're running into GPU thermal throttling. You'll want to have some kind of hardware monitoring software, like HWiNFO64, running at the same time and you could see your GPU's clock speeds suddenly dropping at the same time as you see your frame times suddenly shoot up. Which would also explain why you're not seeing the behavior on more powerful hardware. If you do see the clock speeds dropping, especially if you're also seeing the GPU temp hitting its limits, it could mean the fans in your laptop need to be cleaned, or the thermal compound has dried up, or it could just have always been the behavior that laptop had (which is sadly pretty common for Razers, they almost universally overheat).
     
  3. TheReveng3r

    TheReveng3r

    Joined:
    Jan 19, 2022
    Posts:
    2
    Hey there,

    I can confirm that my laptop is heating a lot, however in other games I don't have this FPS drop issue.

    I mean the laptop is still overheating but I still keep around 60 fps, but in my case it's dropping to 30 fps for some time and then goes back up to 60 fps and then down to 30 and so on.

    I also tried to play Genshin Impact (made with unity) and I don't have this issue. This is a very strange issue and I have absolutely no clue how to fix it.

    I also did what you advised and added the GPU usage in profiler below
    . 123.png 1234.png
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,255
    That just means that even at a reduced clock speed, those games are able to render under 16.6 ms per frame. Nothing to do with whether or not the game is using Unity, and everything to do with what your game is rendering.
     
    arkano22 likes this.