AMD CPU is not fully utilized

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

Moderator: Moderators for English X Forum

lainio
Posts: 24
Joined: Fri, 5. Jan 18, 09:13
x4

AMD CPU is not fully utilized

Post by lainio »

Hey Egosoft,

I have checked after hundreds of hours how my CPU is utilized and was a bit surprised that a lot of threads are being in idle.
I experienced heavy lag on my system with nearly 10 stations.

Specs:
Gigabyte X570 Aorus Master (Latest BIOS)
RTX 2080 Super
AMD Ryzen 7 3700x
32GB 3600 MHz RAM (Stable XMP Profile activated)
Windows 10 20H2
Latest Chipset Drivers installed.

My Game is currently in 4.0 Beta 3.
Is this normal behavior? Is there anything I can do so get better performance? I'm currently at 20-25 FPS in that sector. On an empty Sector I get mostly 60-70 FPS


Here is the usage in that specific sector:
https://imgur.com/a/2rLernK
Alan Phipps
Moderator (English)
Moderator (English)
Posts: 31785
Joined: Fri, 16. Apr 04, 19:21
x4

Re: AMD CPU is not fully utilized

Post by Alan Phipps »

Of your 8 real cores, 2 will be heavily used and another 2-4 will probably be used much less than the first 2. Also your cpu may be swapping the most loaded threads about such that load monitoring over time may be being averaged out.

You will probably get a more detailed and accurate reply from technical experts such as Imperial Good.
A dog has a master; a cat has domestic staff.
lainio
Posts: 24
Joined: Fri, 5. Jan 18, 09:13
x4

Re: AMD CPU is not fully utilized

Post by lainio »

Thanks so far! Good to know. Have the devs done something about the performance? I get a lot more on empty sectors than usual since the 4.0 Beta 3.
I hope Imperial Good can give me a tipp.
Imperial Good
Moderator (English)
Moderator (English)
Posts: 4933
Joined: Fri, 21. Dec 18, 18:23
x4

Re: AMD CPU is not fully utilized

Post by Imperial Good »

If you are using the volumetric fog feature that is added in 4.00 then that feature can cause some sector performance to regress as it is very demanding.

X4 cannot fully use large core count CPUs like the Ryzen 7 3700X. Like most games it relies on a few heavy threads and a couple of lighter worker threads. As such it is normal for your CPU to report a large idle time/percentage. This does not mean your CPU is really being idle, since due to the lower all core workload it will be running those game critical threads faster due to a higher boost frequency, fewer cache misses and larger memory bandwidth share. This especially applies to the really high core count CPUs such as Ryzen 9 3900X where running an all core workload heavily power throttles core clock speed resulting in significantly lower individual core performance during those times.

The strange behaviour observed with the first 4 logical cores (2 physical cores) is due to SMT and those being your CPU's preferred cores. The operating system scheduler actively avoid scheduling both logical cores of a physical core with threads at the same time because doing so will cause the core resources to be split between both threads effectively halving the individual performance of the threads. This means it will prioritize fully using discrete cores before trying to schedule on SMT logical cores. As such in your screenshot the first 2 cores are both being utilized close to 100%, but at any given time only 1 of the 2 logical SMT cores of that physical core have a thread scheduled on them as can be seen by how the dips in utilization match the peeks of the partner logical core. This also results in the confusing reporting where a CPU can be reported at 50% utilization but in reality is using close to 100% of the actual computational power the CPU offers since all discrete cores are close to fully utilized.

The reason the first 2 cores get loaded more than the others is likely due to them being "preferred" cores of your CPU. The operating system scheduler will prioritize using preferred cores since they will generally achieve a slightly higher clock speed, and so run threads faster, than other cores due to factors like more favourable position on the die or due to binning better than the other cores on the core complex die. Which cores are preferred varies between individual CPUs, for example on my specific Ryzen 9 3900X 12 core CPU my preferred core happens to be the second and third core.

Thread migration between cores occurs when a thread gets descheduled for a period of time and another thread scheduled in its place. This usually occurs due to the thread blocking causing it to be descheduled during which time another thread gets scheduled to that core. When the thread is then rescheduled it cannot go back on the core it was originally as that is still busy with another thread and so has to be scheduled onto another free core, usually based on core preference or in a round-robin fashion should there be none. For example on older Intel CPUs without core preference it was common for a single threaded application to appear to load all cores approximately equally while in reality it was still bottlenecked by the single threaded performance of the CPU.
lainio
Posts: 24
Joined: Fri, 5. Jan 18, 09:13
x4

Re: AMD CPU is not fully utilized

Post by lainio »

God damnit that's a craz detailed answer.
Thanks a lot!!!!

Too bad I can't do anything to get better performance :/
User avatar
Terre
Moderator (English)
Moderator (English)
Posts: 10767
Joined: Mon, 19. Dec 05, 21:23
x4

Re: AMD CPU is not fully utilized

Post by Terre »

You could give Process Lasso a go.

https://bitsum.com/
Open Rights Group - Is your site being blocked
Electronic Frontier Foundation - Online Censorship
The Linux Foundation - Let’s Encrypt
Check if your Email account has been pwned
lainio
Posts: 24
Joined: Fri, 5. Jan 18, 09:13
x4

Re: AMD CPU is not fully utilized

Post by lainio »

Never heard of that. Is it safe to use?
Imperial Good
Moderator (English)
Moderator (English)
Posts: 4933
Joined: Fri, 21. Dec 18, 18:23
x4

Re: AMD CPU is not fully utilized

Post by Imperial Good »

If you have not already I would suggest tightening your memory timings. Your memory is technically overclocked anyway from AMDs perspective so might as well get a couple of extra percent of performance from it.

Use the Ryzen DRAM calculator application to help with potential timing numbers. If you do decide to do this then I suggest watching some videos about it on YouTube before hand. Memory XMP profiles have worst case style loose timings for maximum motherboard and CPU compatibility which can usually be significantly reduced in actual systems. Modern processors like good memory timings so by tightening the timings it is possible to achieve a performance improvement of a couple of percent. As long as you do not raise any of the voltages beyond the numbers used by the XMP profile it should not alter the longevity of the system at all as you are only altering timing tolerances and not power or current.

Use an application like Cinebench R20 to verify any performance improvements. Run the test a few times before tightening memory timings and note the single and multi thread scores. Then repeat with the tighter memory timings and the numbers should be slightly higher. If not then you must have hit an unstable value in which case you will either need to loosen the memory timings or can fall back to using the XMP profiles. The overal performance improvement might be a couple of FPS in games in non-GPU bottlenecked scenarios, but it is still extra performance at no extra cost.
User avatar
Terre
Moderator (English)
Moderator (English)
Posts: 10767
Joined: Mon, 19. Dec 05, 21:23
x4

Re: AMD CPU is not fully utilized

Post by Terre »

lainio wrote: Sun, 13. Dec 20, 22:11 Is it safe to use?
Yes, that and I've seen a Twitch streamer use it to stop other processes, OBS, getting in the way of their current game.
Open Rights Group - Is your site being blocked
Electronic Frontier Foundation - Online Censorship
The Linux Foundation - Let’s Encrypt
Check if your Email account has been pwned
lainio
Posts: 24
Joined: Fri, 5. Jan 18, 09:13
x4

Re: AMD CPU is not fully utilized

Post by lainio »

Imperial Good wrote: Mon, 14. Dec 20, 08:16 If you have not already I would suggest tightening your memory timings. Your memory is technically overclocked anyway from AMDs perspective so might as well get a couple of extra percent of performance from it.

Use the Ryzen DRAM calculator application to help with potential timing numbers. If you do decide to do this then I suggest watching some videos about it on YouTube before hand. Memory XMP profiles have worst case style loose timings for maximum motherboard and CPU compatibility which can usually be significantly reduced in actual systems. Modern processors like good memory timings so by tightening the timings it is possible to achieve a performance improvement of a couple of percent. As long as you do not raise any of the voltages beyond the numbers used by the XMP profile it should not alter the longevity of the system at all as you are only altering timing tolerances and not power or current.

Use an application like Cinebench R20 to verify any performance improvements. Run the test a few times before tightening memory timings and note the single and multi thread scores. Then repeat with the tighter memory timings and the numbers should be slightly higher. If not then you must have hit an unstable value in which case you will either need to loosen the memory timings or can fall back to using the XMP profiles. The overal performance improvement might be a couple of FPS in games in non-GPU bottlenecked scenarios, but it is still extra performance at no extra cost.
That's interesting. I tried it but without success. I used the safe values from the calculator.
But thanks a lot for your help! Really appreciate the tips :)
SirNukes
Posts: 549
Joined: Sat, 31. Mar 07, 23:44
x4

Re: AMD CPU is not fully utilized

Post by SirNukes »

lainio wrote: Mon, 14. Dec 20, 13:18 That's interesting. I tried it but without success. I used the safe values from the calculator.
But thanks a lot for your help! Really appreciate the tips :)
I just did my memory tightening today on a 5900x. It takes some good luck for the dram calculator values to work as-is. In my case with 3600 cl16 sk-hynix ram, there were at least three dud values for "safe" with generic chips (tRCDWR, tRRDS, and one of tRTP, tRDWR, tWRRD), and more problems when importing the xmp profile into the calculator. Though after finishing tuning, an X4 dense empire stress test only gained 3% performance, so you aren't missing out on much.
spookywatcher
Posts: 192
Joined: Thu, 11. Apr 19, 20:26

Re: AMD CPU is not fully utilized

Post by spookywatcher »

SirNukes wrote: Tue, 15. Dec 20, 06:22
lainio wrote: Mon, 14. Dec 20, 13:18 That's interesting. I tried it but without success. I used the safe values from the calculator.
But thanks a lot for your help! Really appreciate the tips :)
I just did my memory tightening today on a 5900x. It takes some good luck for the dram calculator values to work as-is. In my case with 3600 cl16 sk-hynix ram, there were at least three dud values for "safe" with generic chips (tRCDWR, tRRDS, and one of tRTP, tRDWR, tWRRD), and more problems when importing the xmp profile into the calculator. Though after finishing tuning, an X4 dense empire stress test only gained 3% performance, so you aren't missing out on much.
Wow. Thank You for reporting your 5900x performance. Was going to buy it to test it...but thinking against it now. Would You be so kind as to jump over to this thread: viewtopic.php?f=146&t=427248 and do the tests and post your scores in that thread?? Very much appreciated if You can.

Return to “X4: Foundations - Technical Support”