Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: RAM, CPU, or GPU, which one is more important for large forts?  (Read 6265 times)

Miuramir

  • Bay Watcher
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #15 on: December 21, 2017, 12:57:55 am »

That works as advertised with a multithreaded application, I am discussing gaining some performance by not hopping the thread, the single thread of DF, from one core to another, there IS overhead for that.  Technical details to back that statement up available if demanded.  Toady has been making statements where in he is beginning to take the first steps towards making DF multithreaded. Once he does that, then the more cores the better, just as you are saying.

Briefly, you are technically correct about there being core switching overhead; but it's generally quite small.  What is much more noticeable is that on many modern CPUs, they have a "turbo" mode where they run faster with fewer cores; this is largely due to the ability to thermal-cycle amongst the cores while doing fractional on-demand overclocking.  If you have a quad-core CPU rated for, say, 3.0 GHz nominal, with up to 3.8 GHz under Turbo Boost (single core max), it's getting that higher speed by rotating the "hot" core around periodically, and idling the previously-hot ones to give them time to cool off.  If you lock a program to a single core, it's not going to get the benefit of that, and will probably run at a lot closer to 3.0 than 3.8.  This sort of difference is usually *dramatically* more significant than the tiny boosts you may or may not get from not switching. 

TL;DR: modern CPUs and operating systems are, in general, much better about managing system resources on a sub-second basis than anything you can do manually; and much of the old-school advice from many CPU generations back is actually a performance hindrance in the modern day. 

Additionally, to reinforce what has been mentioned already... on a reasonably-nice, reasonably-modern system that isn't weirdly resourced starved, it is probable that the limiting factor for DF is the time it takes to read and write quite large amounts of data back and forth between main memory and the various layers of cache.  (No current chip has enough on-die cache to store even a small fort's data.)  So, sustained memory bandwidth / speed is where you will probably get the most improvements if you want to make a system particularly powerful for running DF. 

Note, however, that due to the nature of DF, stability and lack of errors in that memory access are tremendously important; many people who overclock run too close to the ragged edge.  If you can't run a demanding memory test for several hours straight with no errors, dial back because your settings are too flaky for DF. 
« Last Edit: December 21, 2017, 01:06:54 am by Miuramir »
Logged

warwizard

  • Bay Watcher
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #16 on: December 21, 2017, 03:12:02 am »

  Good point about the turbo boost, my proc does not have that feature, so it was not a consideration for me when I was shopping for this system 6 years ago, all 12 of my cores are at 4.2, however there IS thermal management S/W in place that will throttle me down if the cooling load gets too big. I suppose it is time to put it to the test. I will save my fort and display the FPS in the settings, then do the processor affinity and reload from the save and see which way it goes. Fair enough, we'll collect data, instead of arguing.
Logged

martinuzz

  • Bay Watcher
  • High dwarf
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #17 on: December 22, 2017, 05:40:25 am »

Slightly on topic. WHen I set df process affinity to only 1 core (not the first core), the music will start to stutter like an old lp that's a bit wobbly.
WHen I set it to two cores, that stops, and I still get significantly better FPS than when it's using all 8 cores
Logged
Friendly and polite reminder for optimists: Hope is a finite resource

We can ­disagree and still love each other, ­unless your disagreement is rooted in my oppression and denial of my humanity and right to exist - James Baldwin

http://www.bay12forums.com/smf/index.php?topic=73719.msg1830479#msg1830479

warwizard

  • Bay Watcher
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #18 on: December 22, 2017, 05:54:01 am »

   That is what I was referring to when I stated that there may be some first steps at making DF multi threaded, the music has no effect on the actual game play, so could be set off to it's own thread without a redesign of the game. There may be some world gen multi threading, but generally as you go through world gen only a few times per version...not worrying about world gen.
Logged

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #19 on: December 22, 2017, 06:09:26 am »

   That is what I was referring to when I stated that there may be some first steps at making DF multi threaded, the music has no effect on the actual game play, so could be set off to it's own thread without a redesign of the game. There may be some world gen multi threading, but generally as you go through world gen only a few times per version...not worrying about world gen.

I gen like 50 worlds due to being a modder.
« Last Edit: December 22, 2017, 06:42:05 am by KittyTac »
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

warwizard

  • Bay Watcher
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #20 on: December 22, 2017, 06:29:26 am »

Ok I've removed the FPS cap, set it to auto save, upped my dwarf max to 400 and we'll see how it goes. First up is default, settings (no processor affinity)

Embark 4X4 with about 110 Dwarves currently (migrant wave is currently inbound so this is a fuzzy number at the moment). FPS 17
Processor affinity set to cores 1 and 2 (numbered from 0 to 11) FPS 16, note I have not changed the rest of the programs to avoid using 1 and 2 yet.
Removing as many processes as I can off of 1 and 2...  Turned off a couple of programs, FPS 16

  Looking at performance monitor, core 1 nearly 0 usage, core 2 averaging 97% usage  Turned off core affinity for DF.exe and usage gets spread out, FPS 18
repeated looking at this with affinity on and off for DF, and this fort consistently gives perhaps +1 FPS without core affinity for DF.exe on my hardware. Rebooting to get any garbage off my system, and rerunning the test.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #21 on: December 22, 2017, 07:08:04 am »

   That is what I was referring to when I stated that there may be some first steps at making DF multi threaded, the music has no effect on the actual game play, so could be set off to it's own thread without a redesign of the game.

Already is, as well as some input and graphics stuff AFAIK.

warwizard

  • Bay Watcher
    • View Profile
Re: RAM, CPU, or GPU, which one is more important for large forts?
« Reply #22 on: December 22, 2017, 07:10:56 am »

OK after M/S did updates I'm back with results, I got the best performance by setting no affinity and process priority to High, no other applications running, and all other user level permissions items set to not use core 1 and 2... Affinity and high priority..FPS 17, no affinity and priority high... FPS 22.

That process priority appears to have a major effect on DF FPS, perhaps it runs longer on each core before it gets swapped out, will need to read up on process priority technical details.

  Now interesting details: With Affinity set, DF.exe just setting in the selection screen doing nothing consumed 75% of a core and usage went to 100 % as soon as I loaded a fort and un-paused.

  Now this was my results with a 6 year old formerly top of the line desktop, your results may be different from what I experienced, so please do your own testing and report results here.
Logged
Pages: 1 [2]