Log in

View Full Version here: : Galaxy Simulations - OpenCL / Direct Compute harnessing massive GPU capabilities


g__day
16-12-2009, 12:52 AM
http://www.youtube.com/watch?v=r1sN1ELJfNo - 1 year ago

http://www.youtube.com/watch?v=ebCou7hnol0 - 4 months ago

Note the latest Video cards are around 4-5 times more powerful than the hardware used in these demos!

Executable http://galaxy.u-aizu.ac.jp/trac/note/raw-attachment/wiki/Astronomical_Many_Body_Simulations_ On_RV770/R700demo.zip

This works a treat on my ATI 5850 video card! - a galaxy with 40,000 stars flies around beautifully.

http://galaxy.u-aizu.ac.jp/trac/note/attachment/wiki/Astronomical_Many_Body_Simulations_ On_RV770/screenshot.png

* * * * * * * * * * * * * * *

This is a pretty nifty example of a simulation of 10,000 -> 40,000 stars interacting - very fast, in real time.

Previously this sort of demonstration required either alot of time or access to a node or beowolf cluster supercomputer. But next generation graphics cores (ATI's are released, NVidia are due in late Q1 2010) reveal a massive number of powerful processors (ATIs mid range has 1440 processors, the higher end 1,600 and top of the line 3,200) and you can glue multiple graphics card together.

Up to now it was pretty challenging spreading compute bound loads between a CPU and GPU. With Windows 7 and either Direct X11's direct compute, Kronos Open platform OpenCL, ATI's Stream or NVidia's CUDA it is now possible to load balance compute loads across both the CPU and GPU highly effectively.

What this demo shows is a compute bound problem being solved on the fly; 3d gravity models are order (n squared) complexity - 30,000 stars means approximately 900,000,000 (* 18 roughly) calculations per step in any simulation. GPUs have reached over 3 teraflops performance - that's 3,000,000,000,000 floating point operations per second - an order of magnitude or two more powerful than CPUs alone.

NVidia and ATI will shortly begin to release scientific demonstrations of this software. I for one would love to run galaxy simulations as my screen saver.

Matthew

SkyViking
16-12-2009, 10:03 AM
Galaxy simulations just rock don't they :)
I used to develop a galaxy simulation program some years ago, just for fun. I once had my computer running day and night for a month, to complete a 1.000.000 particle simulation. There are techniques to reduce the number of required calculations, so the calculation time doesn't grow exponentially (so 30,000 stars don't require 900,000,000 force calculations), it's of course a lot more complex to implement than a brute force O n^2 algorithm.

Here are some screen shots from my program and a 400,000 particle simulation made on my old Athlon 1800+:
http://www.titirangiobservatory.com/galaxymerger.html

Note: I'm not sure the executable works properly because it has been years since I last fiddled with it.

g__day
16-12-2009, 12:49 PM
I reckon a 4 way 5890 rig could just about do a 1 million star similutation in real time.

The best algorithms use a tree forcing approach to come close to order (n log n) - think wrapping everything within a "bubble of stars" as a point source of gravity at its centre of balance to everything outside that bubble.

But its cool to see the simulation fly in real time!