Bay 12 Games Forum

Please login or register.

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

Author Topic: Dwarf Fortress making use of a multicores  (Read 14846 times)

Unshaven

  • Bay Watcher
    • View Profile
Dwarf Fortress making use of a multicores
« on: June 06, 2010, 04:53:37 pm »

I know that dwarf fortress is a very CPU intensive program. That's being said I also heard that it only utilizes one core for all that processing, Wouldn't the game see a big performance gain if it made use of all of the cores ? What's the technical hurdle hindering this from happening ?
Logged
On any other forum my name would be considered dirty

Kidiri

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #1 on: June 06, 2010, 05:00:51 pm »

A major code rewrite. And the 40d## (as opposed to 40d) and 3.04-05 versions use a second core for graphics. It's not much, but it frees up a bit more of one core for the rest.
Logged
Veni, Vidi, Pompeii.
Soylent Green is kittens!
Sometimes, when my Dorfs are exceptionally stupid again, I wonder what exactly the [INTELLIGENT]-tag does.

mnjiman

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #2 on: June 06, 2010, 05:33:50 pm »

In all honesty, Dwarf Fortress MUST make use of multiple cores if it wishes to get any more complex then it already is.. which is what Toady is going to do anyways.

This has to happen one way or another for it to run at a reliant speed in the future since most computer have multiple cores rather then bigger processor's.
Logged
I was thinking more along the lines of this legendary champion, all clad in dented and dinged up steel plate, his blood-drenched axe slung over his back, a notch in the handle for every enemy that saw the swing of that blade as the last sight they ever saw, a battered shield strapped over his arm... and a fluffy, pink stuffed hippo hidden discretely in his breastplate.

Hyndis

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #3 on: June 06, 2010, 06:23:48 pm »

In all honesty, Dwarf Fortress MUST make use of multiple cores if it wishes to get any more complex then it already is.. which is what Toady is going to do anyways.

This has to happen one way or another for it to run at a reliant speed in the future since most computer have multiple cores rather then bigger processor's.

The problem is that you can do a parallel task using serial processing, but you cannot do a serial task using parallel processing.

This is the same thing plaguing other programs as well. Its just very hard to code things to make proper use of multiple processors. Most processors tend to cap out at around 3ghz per core, and these days they're coming out with 6 or even 8 core processors.

That would be 24ghz to throw at things, if only it were possible to do a serial task with parallel processing. Its not.  :(

Computer science is sort of stuck at the moment on this. Its very hard for a single program to make use of multiple cores at the same time.
Logged

ProZocK

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #4 on: June 06, 2010, 06:35:12 pm »

Forgive me for my noobness, but isn't there a way to put all other processes you are running into one core and dwarf fortress toanother? And if there is a way, how to do it?
That way help a bit...
Logged
I always imagine dwarves to train as if fighting pretend monsters. "It's a carp, use your sword!" "Shwish! Shwoosh! It's dead!" "Oh no, it's a giant cave spider! Noo, it's got me! Kill it with your axe!" "Swoosh, I cut off its head!"
UNDEAD ELEPHANTS.HERDS OF THEM.EVEN IN DEATH I STILL GRAZE.

Hyndis

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #5 on: June 06, 2010, 06:37:55 pm »

Forgive me for my noobness, but isn't there a way to put all other processes you are running into one core and dwarf fortress toanother? And if there is a way, how to do it?
That way help a bit...

Yes, thats done normally. But you still only get about 3ghz for DF, even if you have 24ghz of processing power in your computer (assuming you have a fancy new 8 core or something like that).
Logged

Bronze Dog

  • Bay Watcher
  • Kobold Sympathizer
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #6 on: June 06, 2010, 06:43:22 pm »

Forgive me for my noobness, but isn't there a way to put all other processes you are running into one core and dwarf fortress toanother? And if there is a way, how to do it?
That way help a bit...

I don't know how it's done on other OS's, but for Windows, you open Task Manager, right click the DF process and choose "Set Affinity" and check the processor you want it on and uncheck the others. I'm guessing that if DF takes enough of that core, all the other processes will be moved to the other(s).
Logged
Bronze Dog has been feeling rather happy lately. He is fond of scimitars, black bronze, turquoise, and kobolds for their underdog status.

immibis

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #7 on: June 06, 2010, 08:29:13 pm »

Forgive me for my noobness, but isn't there a way to put all other processes you are running into one core and dwarf fortress toanother? And if there is a way, how to do it?
That way help a bit...

I don't know how it's done on other OS's, but for Windows, you open Task Manager, right click the DF process and choose "Set Affinity" and check the processor you want it on and uncheck the others. I'm guessing that if DF takes enough of that core, all the other processes will be moved to the other(s).

Not a good idea for 0.31.04+ since that uses two cores if possible (One for gameplay, another for graphics). It doesn't usually max out both but it's a start.
Logged
If I wanted ramps I would've designated ramps, dammit!

Mason11987

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #8 on: June 06, 2010, 08:37:03 pm »

Forgive me for my noobness, but isn't there a way to put all other processes you are running into one core and dwarf fortress toanother? And if there is a way, how to do it?
That way help a bit...

I don't know how it's done on other OS's, but for Windows, you open Task Manager, right click the DF process and choose "Set Affinity" and check the processor you want it on and uncheck the others. I'm guessing that if DF takes enough of that core, all the other processes will be moved to the other(s).

Not a good idea for 0.31.04+ since that uses two cores if possible (One for gameplay, another for graphics). It doesn't usually max out both but it's a start.

But if you have 4 (I do) you can give 2 to DF, and leave the other 2 free.

Unshaven

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #9 on: June 06, 2010, 10:40:59 pm »

Thank you for your responses I believe I now have a better understand of the problem. Having the graphics running on a another processor is a nice improvement though. It sounds like a tough problem. Perhaps toady or someone else will figure something out.
Logged
On any other forum my name would be considered dirty

Porpoisepower

  • Bay Watcher
  • For Surely he is the Cuisinart Hat Rack
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #10 on: June 06, 2010, 11:12:11 pm »

If you can run it in it's own virtual machine you can get a slight performance boost.

This may sound counter productive but some VM software can bounce threads to free processors more effeciently than your OS. 

Logged
That's what DF needs, The gutbuster brigade.  Screw that elf and his cat. Thibbledorf Pwent is the real hero.

immibis

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #11 on: June 07, 2010, 02:31:23 am »

If you can run it in it's own virtual machine you can get a slight performance boost.

This may sound counter productive but some VM software can bounce threads to free processors more effeciently than your OS.
Sure, maybe, but wouldn't the VM overhead far outweigh that?
Logged
If I wanted ramps I would've designated ramps, dammit!

CppThis

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #12 on: June 07, 2010, 03:13:51 am »

Thread management isn't the point, concurrency is.  Honestly outside of a few specialized applications (servers), virtualization is just a marketing gimmick to convince managers to buy equipment they don't need to solve problems that don't exsist.

It's like Hyndis said, if you have a bunch of tasks being issued and the execution of one affects another (as opposed to simply the output), there is no known way to make them run on separate cores.  It might be possible to pull pathfinding out though, which would help a lot.
Logged

se5a

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #13 on: June 07, 2010, 05:56:54 am »

virtualization is awesome if you have to reboot the virtual machine that's running X program, you can reboot it without affecting other parts of the network. however if your business has everything running on a single non virtualized server the whole network goes down because you have to boot the DC which is also the DNS and the DHCP and a bunch of other acronyms.

or you can buy a separate bit of hardware for everything.
virtualization can be cheaper and easier to maintain.

Edit: damned spellcheckers...
« Last Edit: June 08, 2010, 04:52:24 am by se5a »
Logged

Dr. Melon

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress making use of a multicores
« Reply #14 on: June 07, 2010, 07:33:44 am »

visualization is awesome if you have to reboot the virtual machine that's running X program, you can reboot it without affecting other parts of the network. however if your business has everything running on a single non visualized server the whole network goes down because you have to boot the DC which is also the DNS and the DHCP and a bunch of other acronyms.

or you can buy a separate bit of hardware for everything.
visualization can be cheaper and easier to maintain.

It's "Virtualization" not "Visualisation".
Logged
Pages: [1] 2