Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Steam release should recommend 4 GHz CPU for optimal setup.  (Read 907 times)

Sarmatian123

  • Bay Watcher
    • View Profile
Steam release should recommend 4 GHz CPU for optimal setup.
« on: November 19, 2019, 03:45:23 pm »

Steam release should recommend 4 GHz CPU for optimal setup of Dwarf Fortress.

From computer architecture and parallel systems, I am reading, that 4 GHz is a sweet spot for CPU computing speed. This is due something called "power wall" barrier, which has strange physical effects on CPUs and their overclocking.

About overclocking AMD processors, it seems it is something even futile, as there speed performance per executed instructions is more bound to memory's access and memory's availability.

I hope Toady will take this under consideration for his Steam release version.

I bought 4Ghz I7 and it plays ok, even biggest maps with biggest lags due lots of rivers crossing there, which cause lots of CPU hiccups.

Even Quill18, a YouTuber I watch sometimes, on one of his twitch streams showed "older" I7 CPU he just bought. The CPU he bought was 4GHz too. He bought it actually to play other strategy games, then Dwarf Fortress. He was tired of constant lags in them on his newest CPU, with more cores, but smaller CPU's frequency.

I guess strategy games in general, are bad for parallel programming on multiple cores?
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Steam release should recommend 4 GHz CPU for optimal setup.
« Reply #1 on: November 19, 2019, 04:38:29 pm »

Steam release should recommend 4 GHz CPU for optimal setup of Dwarf Fortress.

From computer architecture and parallel systems, I am reading, that 4 GHz is a sweet spot for CPU computing speed. This is due something called "power wall" barrier, which has strange physical effects on CPUs and their overclocking.

About overclocking AMD processors, it seems it is something even futile, as there speed performance per executed instructions is more bound to memory's access and memory's availability.

I hope Toady will take this under consideration for his Steam release version.

I bought 4Ghz I7 and it plays ok, even biggest maps with biggest lags due lots of rivers crossing there, which cause lots of CPU hiccups.

Even Quill18, a YouTuber I watch sometimes, on one of his twitch streams showed "older" I7 CPU he just bought. The CPU he bought was 4GHz too. He bought it actually to play other strategy games, then Dwarf Fortress. He was tired of constant lags in them on his newest CPU, with more cores, but smaller CPU's frequency.

I guess strategy games in general, are bad for parallel programming on multiple cores?
The release and marketing is handled by Kitfox. Although I think the consensus for the time being is that all suggestions are posted here anyway, so they should see this. They have other channels too though I think, just in case.
Logged

Sheepherder

  • Bay Watcher
    • View Profile
Re: Steam release should recommend 4 GHz CPU for optimal setup.
« Reply #2 on: November 23, 2019, 09:54:09 pm »

Steam release should recommend 4 GHz CPU for optimal setup of Dwarf Fortress.

From computer architecture and parallel systems, I am reading, that 4 GHz is a sweet spot for CPU computing speed. This is due something called "power wall" barrier, which has strange physical effects on CPUs and their overclocking.

About overclocking AMD processors, it seems it is something even futile, as there speed performance per executed instructions is more bound to memory's access and memory's availability.

I hope Toady will take this under consideration for his Steam release version.

I bought 4Ghz I7 and it plays ok, even biggest maps with biggest lags due lots of rivers crossing there, which cause lots of CPU hiccups.

Even Quill18, a YouTuber I watch sometimes, on one of his twitch streams showed "older" I7 CPU he just bought. The CPU he bought was 4GHz too. He bought it actually to play other strategy games, then Dwarf Fortress. He was tired of constant lags in them on his newest CPU, with more cores, but smaller CPU's frequency.

I guess strategy games in general, are bad for parallel programming on multiple cores?

Clock frequency is not a very good way to measure processor speed, except within a specific processor architecture and generation, because there are also differences in instructions per clock (IPC), instruction pipeline, instruction set, caching and a host of other differences that drastically alter computation speed.  It's a bit like looking at the tachometer on a Nissan Micra and a Dodge Charger and assuming that the two cars go the same speed because they both rev to 6000 RPM.

I also wouldn't simply assume that AMD does badly in Dwarf Fortress.  People have suggested that DF is bogged down by cache misses, and cache performance is generally very high on Ryzen.  It would have to be benchmarked though.

The "power wall" is just the limit on the amount of electrical power that can be put into a chip before heat or current leakage through transistors becomes a problem for system stability, and there's nothing particularly significant about the 4Ghz mark.  The current generation of i9 processors will supposedly do 5 Ghz pretty consistently.  It's all just a matter of how much power a given chip will take.

There is nothing specifically about strategy games that make them ill-suited for parallel processing, it's just that parallelism is hard to program for to begin with, and even harder to retrofit into legacy code.
Logged

Sarmatian123

  • Bay Watcher
    • View Profile
Re: Steam release should recommend 4 GHz CPU for optimal setup.
« Reply #3 on: December 02, 2019, 01:49:08 am »

I also wouldn't simply assume that AMD does badly in Dwarf Fortress.  People have suggested that DF is bogged down by cache misses, and cache performance is generally very high on Ryzen.  It would have to be benchmarked though.

The "power wall" is just the limit on the amount of electrical power that can be put into a chip before heat or current leakage through transistors becomes a problem for system stability, and there's nothing particularly significant about the 4Ghz mark.  The current generation of i9 processors will supposedly do 5 Ghz pretty consistently.  It's all just a matter of how much power a given chip will take.

There is nothing specifically about strategy games that make them ill-suited for parallel processing, it's just that parallelism is hard to program for to begin with, and even harder to retrofit into legacy code.

4GHz for old CPUs then, and 5GHz for new ones.

Yes, parallelism is hard to begin with. This is true. Lots of theory. Little automation. Data parallelism, thread parallelism, cache issues. False sharing issues. Major headache. First you study computer architecture, then parallel systems and you still confused.

There is a 1-day solution:
First you watch 4h of introduction to openMPI:
www.youtube.com/playlist?list=PLLX-Q6B8xqZ8n8bwjGdzBJ25X2utwnoEG

Then you need to install openMPI for gcc.
"sudo apt-get install libopenmpi-dev"
"sudo apt-get install openmpi-bin"

then add at top of cpp file you add in header:
#include <omp.h>

Then you look for every for-loop in program and just write above "#pragma omp parallel for reduction(operation:variable)"

#pragma omp parallel for reduction(+:x)
for (int i = 0; i < (N - 1); ++i) {
  x += calculation;
}

or

#pragma omp parallel for reduction(-:x)
for (int i = 0; i < (N - 1); ++i) {
  x -= calculation;
}

or alike.

then you compile the thing.cpp with flag "-fopenmp" like "g++ thing.cpp -fopenmp -o thing"

and suddenly you're genius at parallel programming.
Your program runs suddenly 20 times faster for no other reason then 4 cores CPU and 8 threads in them.

Reduction does it all for you automatically. Magic touch for programmers.

Of course going into details and learning it all, allows you to program even faster executing parallel code, but at the cost of limitation of your parallel program to particular given CPU architecture.

GPU parallel programming however is a pain in the unmentionable. What do you watch with greater ease, SSE and AVX programs or Dwarf Fortress graphics? :D
« Last Edit: December 02, 2019, 01:54:46 am by Sarmatian123 »
Logged

Sarmatian123

  • Bay Watcher
    • View Profile
Re: Steam release should recommend 4 GHz CPU for optimal setup.
« Reply #4 on: December 02, 2019, 01:50:25 am »

1
Logged

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: Steam release should recommend 4 GHz CPU for optimal setup.
« Reply #5 on: December 02, 2019, 08:06:25 am »

i am not even sure what to say to that. maybe something like, 'i think df's data parallelism issue is far too big for that to have any meaningful effect'. yeah, i think that will do.
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

Sarmatian123

  • Bay Watcher
    • View Profile
Re: Steam release should recommend 4 GHz CPU for optimal setup.
« Reply #6 on: December 04, 2019, 03:37:05 pm »

i am not even sure what to say to that. maybe something like, 'i think df's data parallelism issue is far too big for that to have any meaningful effect'. yeah, i think that will do.

Indeed, but one of the 2 main parallel algorithm paradigms, fortunately is, the recursive divide and conquer parallel algorithm. Yay! :)

Roman Trobec, Bostan Slivnik, Patricio Bulic and Borus Robic, "Introduction to Parallel Computing", 2018, is a book in 250 pages, which mostly covers programming issues with openMP, MPI and OpenCL, which are available on distributions like Ubuntu. It provides very short introduction to parallel theory, for the people with little knowledge of computer architecture. The book has even a walk-through for how to install those parallel libraries on your computer. I would just add there "sudo apt install libopenmpi-dev openmpi-bin" (on Ubuntu) for sake of MPI install completeness.

openMP - #include <omp.h> - speeds for-loops and even (with omp tasks) recursive algorithms on multiple cores CPU.
MPI - #include <mpi.h> - is more like running server - client architecture. It provides communication between processes. Clearly, an alternative is to just have 2 programs, which communicate with each other, instead. It is also for CPU multiple cores.
openCL - #include <OpenCL/opencl.h> - provides commands for GPU parallelization.

Reading this book takes little longer, then listening to 4h videos about openMP, which I provided the link above, but it covers few more libraries for #include in c++. Free to download and free to use. :)

I was told, Toady did try his best some time ago at parallel programming with not so spectacular results. I think the 4h worth of video lectures and this book, will simplify the understanding for parallel programming for Toady and maybe, just maybe, convince someone to make proper  recommendations on steam for best hardware to have for DF (lots of juice CPU? and in future mayhaps even a good GPU?) and... Well... To convince Toady to split some procedures, which can be successfully parallelized into separate proces (MPI) or another program (client-server).

The DF's path search algorithm's parallelization, is actually worked out well and put on Wikipedia.
https://en.wikipedia.org/wiki/Parallel_all-pairs_shortest_path_algorithm
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Steam release should recommend 4 GHz CPU for optimal setup.
« Reply #7 on: December 04, 2019, 04:52:56 pm »

My friend told me his best friend's cousin mentioned that Toady rewrote Dwarf Fortress and it didn't work. So please download this book.

Either quote the guy or send him an email and ask about the results of his side projects in parallel processing, then quote him (with permission). It's so weird to post third-hand quotes and then ask people to try to "convince" Toady of something he may or may not already know on his own forum.
Logged