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

Question Low FPS on High end PC, high FPS on average PC problem

Discussion in 'General Discussion' started by SawyerK, Jan 9, 2023.

  1. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    Hi!
    I have a unique problem. My game runs really badly (20fps) on high end PCs but it runs great on worst PCs.
    Some players of my game who have high end PCs reported this problem.
    Changing graphics settings, resolution doesn't effect the performance for the high end pc user (still 15-20fps no matter the graphics), so its definitely something to do with Unity or the hardware itself. It runs great for me, and other lower end pc users (40-60 fps depending on the pc and the graphics settings).

    - Player's pc Win 11 RTX 3080, i9-10920X, 64GB ram, the game on any graphics settings runs on 15-20 fps.
    - Another player Win 10 gtx 1050ti, intel xeon e5-1620 reported more fps then the high end PC player.
    - Another player Win 10 gtx 1050 2gb vram / 4 core cpu runs the game on 50 fps on high graphics.
    - Another player Win 10, i7 - 8700K, 32 gb ram, RTX 3070ti - 60 FPS on Ultra
    - My specs Win 10 i7 - 10700F, 32 GB RAM, GeForce RTX 3060 and the game runs 60 fps on Ultra graphics.
    -Another player Amd Ryzen 7 3700x, 32gb DDR4 3200mhz, RTX 2070 Super 60-90fps medium
    -Another player Intel xeon e5-1620 Nvidia gtx 1050ti 16gb ddr3 RAM 40fps
    -Another player Win 10 16GB ram DDR3 1600 Gigabyte RX550 4GB ASTRAPE M1-650W IntelCore I5-4590CPU 1920x1080 VeryLow settings 40fps
    -Another player AMD Ryzen 7 2700 16GB RAM DirectX 12 NVIDIA GeForce RTX 2060 1600x900 windowed Ultra graphics 40-58fps
    -Another player Intel Core i5 3.3ghz. AMD Radeon 580RX 8GB. 8GB DDR 20-30 Fps on Ultra

    Unity 2019.1.5f1

    My guess is something to do with old Unity version conflicts with the modern hardware. Maybe windows 11 is the problem? Or something with my Project settings is not set up correctly for high end modern PCs. It can't be the graphics or the programming because it would run extremely badly on the lower end pcs which is not the case, it actually runs better.

    So I'm out of ideas and I really need some help with this, thank you!

    Project Settings:
     
    Last edited: Jan 13, 2023
  2. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Not sure if that could be the problem, but the one that has 20 fps is the only one with Windows 11.
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,064
    Or just a Unity bug. Is there a specific reason you can’t update to the 2019 LTS (2019.4.40 I think?)
     
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    Seeing as the only one on Windows 11 has issues, I would say so. I've been reading of constant issues with Windows 11 effecting games and similar applications, hence why I'm staying the hell away for the time being.
     
    r31o likes this.
  5. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    I tried but there was too many errors, I would have to remake the whole game cause I use an old assets for car physics sadly.
     
  6. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    There was a couple other people with high end pc that have this issue, I try to ask them what windows they have, but no reply yet.
     
  7. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,885
    Unfortunately even if it is caused by windows 11 < > unity issue, if you cant update to a newer unity then you likely simply wont be able to fix this.

    If its caused by a unity bug, it will be resolved but only in later versions. So updating to an LTS version is key (and in general you should never do any commercial development on anything other than an LTS version for exactly these reasons)

    You may end up having to choose between rewriting the car physics so you can update, or having members of your playerbase unable to play at decent framerates...
     
    Last edited: Jan 11, 2023
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,064
    Can't you at least update to the newest 2019.1?

    Unfortunately that is the issue with engines like Unity, if you really rely on a system you don't have access to to behave a certain way, you might be arbitrarily blocked from updating to something newer. (which is why I think if physics behaving a certain way is critical to your game, you should write your own physics, or get a library you have source access to)
     
  9. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,801
    If it's Windows 11 specific, it's probably because their system has defaulted to use a low power mode.
     
  10. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    Also I tried to check the players performance with the Profiler but I can't connect to it through IP. It just throw an error "can't connect to profiler IP" windows firewall was off for both of us. I have "developer build" and "autoconnect profiler" checked in the build menu.
     
  11. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,801
    That's because that's not how it works. That's to profile things on a local network, not over the internet.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,517
  13. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,987
    Make sure the high end PC is able to run other games at a normal frame rate. If you have a fairly small sample set, it is possible that the high end PC might simply be having a weird issue. Test the performance of a few other well known games on that PC to make sure it is not a problem specific to that one computer.

    I saw a mid range PC last year that was getting 4 FPS in every game, even 2D games like Core Keeper. That computer needed the video drivers re-installed. After that, performance returned to normal for all games on it.

    In addition to that, I have seen a few computers struggle with high resolutions and high frame rates on old video cables. A lot of users think all video cables are the same, completely ignoring the need for new HDMI and/or DisplayPort cables. For example, a lot of users have old HDMI 1.4 cables connected to new video cards and monitors. And that results in data errors and terrible frame rates. Any time you see weird frame rate problems in a high end system, double check the video cable.

    The old video cable issue can crop up on consoles, too. I saw an Xbox One S getting terrible framerates with certain 2D games, like Little Witch in the Woods. The console rendered internally at 1080p, but would automatically upscale the output to 4K if it detected a 4K TV or monitor. With an old HDMI 1.4 cable, that console would stutter terribly. Manually setting the Xbox output to 1080p fixed the issue. Replacing the HDMI cable with a 2.0 or 2.1 fixed the issue and allowed for the output to work properly at 4K. The old HDMI 1.4 cable was not damaged, and it still worked fine with a Nintendo Switch (which was limited to 1080p).

    The issue happens with old DisplayPort cables as well. I have seen DP 1.2 cables stutter at 1440p on high end PCs. Replacing the cables with DP 1.4 cables resolved the issue.
     
    Antypodish and Ryiah like this.
  14. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
  15. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    Thank you for the reply!
    Player said everything else runs smoothly, so it's probably some other problem.
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,517
    Unfortunately this doesn't appear to be an issue with their machine/setup. It seems whatever is causing this slowness is either within Unity's jobsystem or Physics. Here are a couple screenshots from a sampled profiler from 1 second of game time, in which 11 frames were rendered (so it's running at 11 FPS):

    upload_2023-1-13_12-47-1.png
    upload_2023-1-13_12-48-0.png

    So, either the scene just has way too many collisions going on, or Unity's job system from Unity 2019.1 scales really badly on his 24 core machine.

    Now, I don't know which part of your scene the collisions are coming from. However, it seems that 6 ms per frame is spent just sending notifications about those collisions to your scripts. That script that receives the notification seems to call AudioSource.IsPlaying and AudioSource.Loop. That seems excessive even if the other parts weren't slow.

    If the issue is job system scaling, unfortunately the only solution is to upgrade to Unity 2019.4, which introduced a command line parameter (-job-worker-count) to control how many job threads Unity spawns.

    Another interesting thing is that a specific Update() method is taking another ~8 ms per frame:

    upload_2023-1-13_12-56-18.png

    That method seems to set light.Intensity, so perhaps that will help you locate the script responsible and figure out what it's doing.
     
  17. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    Hi!
    Thank you for the help!
    Managed to update the project to Unity 2019.4.40f1 LTS.
    The problem still occurs for the player, but he set the processor affinity in windows task manager to only use certain cores rather than all 24 available, and locking the game to only use physical cores, the framerate increases.
    So my question is now, Is there a script available that sets the maximum cores to 12?
    I'm really bad at C#, made the game mostly with Playmaker.
    Thank you!
     
  18. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,594
    Unity games by default are single threaded. Unless you code them otherwise. I think even PhysX may be running on same thread.

    I wouldn't be bo thee about one player case scenario, that artificially inhibits CPU, while gaming. It is on the player's fault.

    Now you wasting resources and effort, just to support that single player.
     
  19. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,493
    Not sure about 2019 but in more actual versions a solid amount of stuff in the background has been "jobified" and works in parallel. Physics, Audio, particles-meshing and if you use Dx12 in 2023 also rendering. You can see that with the profiler.

    That only refers to the engine of course. Update() and other typical monobehavior methods are still singlethreaded, yeah.

    @SawyerK
    Btw. I have an R 3900X, thus a 12core/24threads CPU as well (and an Rtx 3080). Feel free to send me the game in a PM to test if you like.
     
    MadeFromPolygons and Ryiah like this.
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,517
    Nope, the trace he sent me shows Unity doing work on 24 cores. Not well, mind you, but still uses the cores. And synchronization in our old versions of job queue can be expensive when core count gets too high.

    Try having him start the game (that's been upgraded to 2019.4.40f1) with "-job-worker-count 4" command line argument.
     
    MadeFromPolygons and Noisecrime like this.
  21. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,594
    Talking about game build:
    Question is, does it do in parallel, or it just switches threads.

    I can not imagine Mono Behaviour to be parallelised, unless using system.jobs, or Unity.jobs.

    Maybe particle systems are some in parallel. But aren't they on GPU?

    I, do wonder if PhysX is done in parallel at all?

    Yep thats editor. And it makes sense. But I am curious about recent Unity game builds, if they utilise multithreading in any capacity by default.

    As I have mentioned above, I wouldn't be surprise, if game runs single threaded, and just switches thread, whenever is spare, managed by OS.
     
  22. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,493
    Why would there be a difference in that regard? Those things are jobs and those are portable.

    There is a CPU task running for particles unfortunately. The name hints that it does something along the lines of batching all particles with their updated positions into that singular mesh which the GPU renders.
    Am talking about the standard particles. The newer VFX which seems to be a magnitude faster might be GPU only, but unfortunately not available in the built-in RP.

    Monobehaviors of course are single threaded since the vast majority of the unity API is single threaded (and that for a reason since you'd end up really quickly in hells kitchen when you randomly access such a complex API).
     
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,517
    It's not MonoBehaviour that is parallelized. The engine executes a lot of code outside of it. And yes PhysX is multithreaded and uses the jobsystem under the hood.
     
    MadeFromPolygons and Antypodish like this.
  24. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,594
    The reasoning is, since editor does lots of more stuff than game build.
    So I may have expect, that editor runs more parallels stuff by default. While build less so.
    Hence I am interested, how many features and utilities in game builds post 2019 are executed in parallel.

    Do you mean Unity engine per say, or game build engine under the hood? As these two are significantly different.

    This is actually interesting and cool to hear.

    Do we know, what else is running on separate threads in builds?
    I assume coroutines are still main threaded?

    Knowing these in more details, may help narrowing down OP discussed issues.
     
  25. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,517
    When I say Unity engine, I mean the code that is part of UnityPlayer.dll and UnityEngine.*.dll in the built game.

    Any code you write yourself that doesn't explicitly run things on other threads will run on the main thread. For native engine code, that is changing a lot between Unity versions as we keep moving more and more things off the main thread so unfortunately I cannot give you a full list of things... looking at the profiler timeline view, however, should give you an idea of what's happening on those threads.
     
  26. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    Thank you for the help. He tried the command line argument -job-worker-count 4 with the upgraded version of the game he said: "So I've experimented with pretty much every possible way of setting the -job-worker-count launch flag and it doesn't make any difference as far as I can tell, the only thing that improves my performance is manually assigning CPU affinity in task manager"
     
  27. SawyerK

    SawyerK

    Joined:
    Feb 11, 2016
    Posts:
    53
    I guess this is a problem that cannot be fixed, some users just going to have weird problems with games made with Unity. But having performance problems only on top end 24 core cpu pcs is not very good.
     
  28. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,493
    Just for general information, I did try the game with my 24thread Cpu and did not experience the drops.
    I would kinda bet whatever is messed up on that specific users side likely would mess up a lower core count system as well.
     
  29. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,987
    You cannot make a broad generalization regarding performance with Unity based on a tiny sample set. It is possible that the user having issues may be a unique case or even a very odd case. Have you investigated that user's setup in depth?

    What resolution is the user playing your game at? What resolution does the user play other games at? For example, some gamers have PCs that have trouble at 4K but play great at 1080p or 1440p. An old video cable can cause issues at 4K even when the video card, CPU, and monitor are all fine. If your game defaults to the native resolution of the monitor, your game might be trying to run at a higher resolution than the player uses for their other games.

    I have a 12 core (24 thread) AMD Ryzen 3900X and it runs Unity games really well. Both of the games I have on Steam get hundreds of frames per second on this PC and were built using Unity. Disputed Space was built using Unity 5.x, and Allspace was built using Unity 2019.x.
     
    Ryiah likes this.
  30. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,517
    I still think that something is going wrong with collisions on the user's machine. It's taking wayyy too much time in that code (including 8 ms per frame just in the collision callbacks). I'd suggest adding some logging to see what is colliding so much.