Bay 12 Games Forum

Please login or register.

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

Author Topic: Using GPU power instead of CPU power?  (Read 10486 times)

Sheepherder

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #15 on: May 12, 2011, 05:09:37 am »

My graphics card was $70. It has a single processor core, so it is only able to process one thread at a time. Graphics adapters with many cores and a general purpose programming API are uncommon, and the APIs vary wildly from vendor to vendor, however, dual-core and quad-core PCs are the norm.

$30
$32

Plus OpenCL.
Logged

tolkafox

  • Bay Watcher
  • Capitalism, ho!
    • View Profile
    • Phantasm
Re: Using GPU power instead of CPU power?
« Reply #16 on: May 12, 2011, 04:54:25 pm »

DDR2, yay!

Thing I found in the dump.
Logged
It was a miracle of rare device, A sunny pleasure-dome with caves of ice!

cameron

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #17 on: May 12, 2011, 05:08:40 pm »

$30
$32
Plus OpenCL.
Neither of those gpus have much in the way of non-graphical compute capibility and certainly no OpenCL support

OpenCL also isn't just somthing you can pick up and put to use in a week or even a few months if you have no experiance with that sort of thing (it is much harder then simple multi-threading in most if not all cases).


My graphics card was $70. It has a single processor core, so it is only able to process one thread at a time. Graphics adapters with many cores and a general purpose programming API are uncommon, and the APIs vary wildly from vendor to vendor, however, dual-core and quad-core PCs are the norm. Any PC over $400 or $500 is likely to have a four-core processor but is unlikely to have a 128-core graphics adapter. All Intel and AMD processors play nice with multithreading and most of the newer ones are 64-bit. It would be absolutely absurd to program DF to work with geforce GPGPU cards when you can make it work on everyone's multi-core PCs which are able to use 64 bit registers that go nicely with their huge sticks of inexpensive RAM.
Graphics cards don't really have cores in the same sense as a cpu, they more have large numbers of comparitivly simple logic units so they can't really be cross compared in that fashion as the other guy was trying to explain. Even the simplist integrated gpu has more seperate logic units then the majority of cpus.

Cpus are much faster when they have to do a few complicated sequential tasks whereas Gpus are much better suited to a large number of reletivly simple independent tasks. This means that utilizing a Gpu will bring rather extreme preformance benifits in some cases. Dwarf-fort would certainly have some tasks which would benifit from this, I rather doubt DF would ever use it though, due to the difficulties of implementation.
Logged

Not a Cylon

  • Escaped Lunatic
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #18 on: May 13, 2011, 07:46:26 pm »

Just to echo the “GPGPU is great, but only in the right application” sentiment, Folding@Home indicates (on a page from 2008, admittedly) that the GPU-enabled client provides a speedup of 20-40x. But of course, F@H is a physics simulation, involving nothing resembling a pathfinding AI; an electron isn't trying to find the shortest path to the +oaken splint+, after all, it's just getting pushed around.

My rough understanding is that if you can reduce a problem to linear algebra, then the GPU is your dear, dear friend. Graphics, yes; physics, yes; cryptanalysis, apparently yes; pathfinding? That seems much more doubtful.

(Heh … that does make me wonder if physics models could apply to pathfinding after all; I mean, one could say that a thirsty dwarf that's far away from alcohol has a very high potential :-) )
Logged

sockless

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #19 on: May 15, 2011, 01:12:54 am »

Ahh yes, but the fluid dynamics in DF are physics!

Also it's a similar thing. The reason that GPUs are good at password cracking is that they are very good at doing many simple tasks, brute forcing the password in other words. That is also in essence what pathfinding is (until someone proves that P=NP).
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

Draco18s

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #20 on: May 15, 2011, 08:31:17 am »

Ahh yes, but the fluid dynamics in DF are physics!

Actually, it's cellular automata.
Logged

sockless

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #21 on: May 15, 2011, 11:37:38 pm »

Ahh yes, but the fluid dynamics in DF are physics!

Actually, it's cellular automata.

Please explain.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

Draco18s

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #22 on: May 16, 2011, 12:23:12 am »

Ahh yes, but the fluid dynamics in DF are physics!

Actually, it's cellular automata.

Please explain.

http://en.wikipedia.org/wiki/Cellular_automata
http://en.wikipedia.org/wiki/Turing_machine

While the GPU may still be better able to process cellular automata (I am not qualified to make a statement of truth-hood), cellular automata are not physics.
Logged

Xyon

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #23 on: December 05, 2017, 02:48:32 pm »

Necrobump because I wonder how the GPUs of today compare to six years ago.  It still seems like a possible worthwhile pursuit, at least in theory.

It still seems like fluid, weather, and temperature interactions could be good to offload onto a GPU.  I wonder if anything else could be good for that, like events happening in the world while you are in fort mode. Growth of crops and trees?
Logged

Azerty

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #24 on: December 06, 2017, 01:54:19 pm »

Necrobump because I wonder how the GPUs of today compare to six years ago.  It still seems like a possible worthwhile pursuit, at least in theory.

It still seems like fluid, weather, and temperature interactions could be good to offload onto a GPU.  I wonder if anything else could be good for that, like events happening in the world while you are in fort mode. Growth of crops and trees?

While fluid calculations are the kind of calculs to be off-loaded to a GPU, world gen could also use this, especially in the creation of the geography.
Logged
"Just tell me about the bits with the forest-defending part, the sociopath part is pretty normal dwarf behavior."

Xyon

  • Bay Watcher
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #25 on: December 06, 2017, 02:45:07 pm »

Necrobump because I wonder how the GPUs of today compare to six years ago.  It still seems like a possible worthwhile pursuit, at least in theory.

It still seems like fluid, weather, and temperature interactions could be good to offload onto a GPU.  I wonder if anything else could be good for that, like events happening in the world while you are in fort mode. Growth of crops and trees?

While fluid calculations are the kind of calculs to be off-loaded to a GPU, world gen could also use this, especially in the creation of the geography.

So you think world gen could be offloaded to GPU?  I guess that is one thing that can take a really long time depending on the size and history of the world.  It would be nice for that to be faster even if its a much smaller aspect of total time spent in the game, or at least it should be.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #26 on: December 06, 2017, 03:44:22 pm »

I really doubt world gen could be made faster on a GPU, or at least not without completely rewriting the whole thing and with a substantial amount of work on top.  GPUs are best at doing lots of math in a format where you can break a problem up into many thousands of subproblems, and where those subproblems don't depend on each other.

World gen certainly involves math, but I suspect that most of its time is spent in decision making, which, in general, GPUs are terrible at.  I can get much more technical if anyone cares to read it, but the interactions between the different agents in world gen would be very toxic to GPU performance.  I'd be surprised if it wasn't much slower than running on a CPU, even with careful coding and tuning.

Admittedly, my knowledge of GPUs is a few years old at this point, but I don't think that much has fundamentally changed.
Logged
Through pain, I find wisdom.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #27 on: December 06, 2017, 05:00:26 pm »

World gen uses a lot of memory. Gigabytes in some worlds. I doubt it would fit on a GPU.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Using GPU power instead of CPU power?
« Reply #28 on: December 06, 2017, 05:53:59 pm »

Even consumer level GPUs can have that much memory these days, but that is a valid concern too.  Going up to and past 4GB is kind asking a lot.

You can work on the problem in chunks too, to get around that, but then performance is going to suffer even more from waiting on memory buffers to transfer...
Logged
Through pain, I find wisdom.
Pages: 1 [2]