Bad FPS with low CPU and GPU usage

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

Post Reply
Kosta88
Posts: 159
Joined: Mon, 2. Jan 06, 19:09

Bad FPS with low CPU and GPU usage

Post by Kosta88 » Thu, 17. Sep 20, 07:27

Hello,

further I get into the game, the worse the performance gets - right now in Flashpoint, looking at my station, no monster, and I am getting 22fps.
However my CPU is showing me about 40% max usage (both overall and spread over cores, so really not max utilization) and the GPU is at about 20% load, with memory used also only 3,5GB out of 11GB. RAM is also only at 44%.
The hardware is 6700K @ 4,8Ghz, 1080ti, 32GB of RAM.
I am at high setting with 2x MSAA. I can up it way higher, the GPU usage will go up as expected, still not 100%, however the FPS will remain exactly the same.
And the performance doesn't get much better if I reload the game, only maybe 26fps.
If I fly into sectors without stations or many ships, performance improves.
I noticed performance getting worse over days and loaded games, but also in a single instance of the game which runs for hours.

So what's the deal? Bad hardware utilization? Bad optimization?

CBJ
EGOSOFT
EGOSOFT
Posts: 51902
Joined: Tue, 29. Apr 03, 00:56
x4

Re: Bad FPS with low CPU and GPU usage

Post by CBJ » Thu, 17. Sep 20, 11:50

We've done some detailed analysis of the CPU utilisation situation, and it turns out that the per-core CPU load figure that you're seeing in Windows doesn't really show the true situation. The reality is that game uses two cores fairly heavily (one of them usually at pretty much 100%) and a number of other cores at a somewhat lower level. The reason that the Windows core utilisation figure often shows a much lower level per-core, is that your system automatically moves the heavier load threads around to different cores on different frames to balance the "wear and tear", and the figure you're seeing is averaged over multiple frames.

With regard to the framerate, the game is normally CPU-bound, so the behaviour you're reporting with settings changing GPU load but not framerate is to be expected. The actual framerate you see will depend on a number of factors: where you are, how much is going on in that location, the size of your in-game empire, whether you have the map open and what map settings you have if you do, and so on. There can also be external factors (some sound drivers seem to have problems dealing with the game's sound output, for example) and third party scripts/mods can slow things down too. I would have expected you to get more than 26fps in open space (while not in a battle) but there could certainly be situations where that would be a reasonable number.

To help further we'd need:
- a full DXDiag and vulkaninfo
- an indication of whether you are using any third party scripts/mods
- some idea of the circumstances under which you're seeing the 26fps
- a savegame so that we can confirm those circumstances

All of the above are mentioned in the sticky thread at the top of the forum, including how to provide the required information.

Artean
Posts: 1101
Joined: Tue, 14. Feb 06, 17:41
x4

Re: Bad FPS with low CPU and GPU usage

Post by Artean » Thu, 17. Sep 20, 18:32

The performance in Second Contact II Flashpoint is pretty bad in general, but there is a place that tanks the fps dramatically. Travelling from Argon Prime into Flashpoint and leaving the highway to the right into the asteroid field just before the gate to The Void, there is an invisible line that cuts my fps in half. Its been there since release of X4. The performance impact stays until I leave the sector.
"In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move." - D.N.A

Imperial Good
Moderator (English)
Moderator (English)
Posts: 4759
Joined: Fri, 21. Dec 18, 18:23
x4

Re: Bad FPS with low CPU and GPU usage

Post by Imperial Good » Thu, 17. Sep 20, 20:28

Kosta88 wrote:
Thu, 17. Sep 20, 07:27
However my CPU is showing me about 40% max usage (both overall and spread over cores, so really not max utilization) and the GPU is at about 20% load, with memory used also only 3,5GB out of 11GB. RAM is also only at 44%.
The hardware is 6700K @ 4,8Ghz, 1080ti, 32GB of RAM.
Being a Core i7 that processor has hyperthreading. Due to how hyperthreading works the additional virtual cores offered do not execute threads as fast as the main core does when fully used yet are counted the same as the main core as far as utilization goes. As such a CPU utilization of 40% by task manager can represent a total CPU performance utilization of 80% by ignoring these virtual cores, which is in the range for a CPU bottleneck.

X4 is very demanding as far as RAM memory performance goes. High CPU clock speeds/instructions per second alone will not give good performance, with people reporting that tightening memory timings or using faster memory yields a larger performance improvement than an additional 500 MHz of CPU clock speed. Few games are bottlenecked by memory performance as much as X4 is which might help explain some of your performance issues if you are not using something like DDR4 3200 MHz memory.
Artean wrote:
Thu, 17. Sep 20, 18:32
The performance in Second Contact II Flashpoint is pretty bad in general, but there is a place that tanks the fps dramatically. Travelling from Argon Prime into Flashpoint and leaving the highway to the right into the asteroid field just before the gate to The Void, there is an invisible line that cuts my fps in half. Its been there since release of X4. The performance impact stays until I leave the sector.
That sector is one of the more demanding sectors in the universe. Not only does it have a lot of ship activity due to a highway and being a war sector between HOP and ANT, but it also have a complicated and dense asteroid field. Although sub 30 FPS for a fresh start in that sector away from stations is low from personal experience.

Possibly lowering draw distance could help? I think I set mine to 60-75% range.
CBJ wrote:
Thu, 17. Sep 20, 11:50
The reason that the Windows core utilisation figure often shows a much lower level per-core, is that your system automatically moves the heavier load threads around to different cores on different frames to balance the "wear and tear"
This has been something that has kept me curious for a long time. However my eventual conclusion based on recent documentation is that it has nothing to do with balancing "wear and tear" but rather is just an unintentional scheduling anomaly.

The heavy thread gets unscheduled at times during its execution due to either blocking or pre-emption by other threads. This blocked or unscheduled state lasts for a very short time, possibly as good as instantaneous, but during that time the core the heavy thread was originally running on has a different thread scheduled to it and so cannot be used to continue execution of the heavy thread when it resumes, or the scheduler does not remember which core the thread was scheduled to. The scheduler has to schedule the heavy thread to the next available CPU core, which traditionally is chosen in round-robin fashion from the set of idle cores and so is often just the next core. If this happens frequently then it will appear that the heavy thread is being purposely balanced across all cores when it is more just unintentionally drifting between cores due to how scheduling works.

This behaviour was explained in recent articles for modern processors as such behaviour is now considered sub-optimal for reasons beyond cache misses. Modern processors such as Zen2 based CPUs from AMD or 10th generation Core-i processors from Intel have a concept of preferred cores, where some cores run threads faster than others. Ideally the heavy threads should be scheduled only to the highest performance cores as that would allow for their most efficient execution. The traditional approach to scheduling does not accommodate this since it treats all cores equally, the reason why heavy threads could appear so balanced across all CPU cores. As such in newer operating system builds a concept of preferred cores was introduced where the scheduler reads core priority values from the CPU at start-up and then uses these to determine a priority list of cores to schedule threads to. Although this cannot mitigate the need to reschedule the heavy thread to a different core in the event that its previous one is now occupied, it does significantly reduce the apparent "balancing" to affect only a few cores.

For example on my Ryzen 9 3900X running latest Windows 10 heavy threads will generally run on cores 2 and 3 as those are my CPU's preferred cores (varies between individual chip). If there is just a single heavy thread it will occasionally swap over which core it is running on due to being rescheduled, but it will not migrate away from those 2 cores while most of the CPU's 12 cores are idle. This is in contrast to my older Core i7-920 running Windows 7 where such heavy threads could often end up appearing to load all 4 cores equally.

Artean
Posts: 1101
Joined: Tue, 14. Feb 06, 17:41
x4

Re: Bad FPS with low CPU and GPU usage

Post by Artean » Thu, 17. Sep 20, 22:01

Imperial Good wrote:
Thu, 17. Sep 20, 20:28
Artean wrote:
Thu, 17. Sep 20, 18:32
The performance in Second Contact II Flashpoint is pretty bad in general, but there is a place that tanks the fps dramatically. Travelling from Argon Prime into Flashpoint and leaving the highway to the right into the asteroid field just before the gate to The Void, there is an invisible line that cuts my fps in half. Its been there since release of X4. The performance impact stays until I leave the sector.
That sector is one of the more demanding sectors in the universe. Not only does it have a lot of ship activity due to a highway and being a war sector between HOP and ANT, but it also have a complicated and dense asteroid field. Although sub 30 FPS for a fresh start in that sector away from stations is low from personal experience.

Possibly lowering draw distance could help? I think I set mine to 60-75% range.
Indeed, it is very demanding. But as I tried to explain, there's something more to it - travelling through that asteroid field my fps is almost cut in half in an instant, and it's always in the same place.
"In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move." - D.N.A

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30420
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Bad FPS with low CPU and GPU usage

Post by Alan Phipps » Thu, 17. Sep 20, 22:08

@ Artean: If you can provide a link to a vanilla save *just before* your ship crosses that line/boundary that affects fps so much then the devs might be interested in taking a look at it to see if they can replicate it and then what the cause might be.
A dog has a master; a cat has domestic staff.

Post Reply

Return to “X4: Foundations - Technical Support”