• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Looking for a real-time N-body simulation

Joined
Jan 13, 2015
Messages
135 (0.04/day)
Hey guys,

I'm looking for a real-time n-body simulation that takes advantage of a discrete GPU. I've seen YouTube videos of n-body simulations, but I'm looking for a program that I can download, change the parameters and run on my PC. Anyone?

Cheers,

grecinos
 
Nvidia has some samples and one of them I believe is an n-body simulation using opencl. Check them out and if im wrong maybe something else you will find in there that is interesting. https://developer.nvidia.com/opencl

edit: just found it, it's at the bottom of the page.
 
Thanks for the link. That looks very close to what I'm looking for. I downloaded the "OpenCL N-Body Physics Simulation". I tried to compile the sample code with MS Visual Studio 12 but am getting an error code.

Their compiled sample crashes with some error message as well:

!!! Error # -11 (CL_BUILD_PROGRAM_FAILURE) at line 297 , in file .\src\oclBodyS
ystemOpenclLaunch.cpp !!!

Exiting...

It came with a readme doc, I'll have to do some investigating in their documentation. If you have any suggestions, that'd be great.
 
There is an executable in ...\NVIDIA GPU Computing SDK\OpenCL\bin\win64\Release where you can run it with these parameters:
Command line switches:
--qatest Check correctness of GPU execution and measure performance)
--noprompt Quit simulation automatically after a brief period
--n=<numbodies> Specify # of bodies to simulate (default = 7680)
--double Use double precision floating point values for simulation
--p=<workgroup X dim> Specify X dimension of workgroup (default = 256)
--q=<workgroup Y dim> Specify Y dimension of workgroup (default = 1)

I'm getting cl_device_not_found juist running ti though :x (it may be my use windows 10 drivers on 8.1)
I'll try compiling it also.


Edit: I just started typing graphics vendors (intel and amd) with n-body and also came up with this: https://software.intel.com/en-us/articles/opencl-cross-devices-nbody-simulation-sample check it out, that one may not give you as much trouble when compiling. AMD probably has an n-body sample too in one of there sdks. look around if the Nvidia one becomes a pain in the butt.
 
Last edited:
Excellent. Thanks for the update. I'll check it out tomorrow. FYI, I'm on a Windows 7-64 bit PC.
 
I downloaded Intel's n-body simulation as per your link provided. I think it's closer to successfully compiling than Nvidia's code. But, it's giving me an error message. It's complaining about a file called "cl_platform.h". It wasn't included in the intel_ocl_nbody_multidevice_win.zip file. Nvidia's simulation does have that file. I tried copying it to the appropriate directory, but no dice, it couldn't find the file. It probably wouldn't have compiled, but I was surprised that it couldn't even find the include.
 
remember to check windows hasnt blocked any files because they came from a nother computer..
that is annoying at times when it has you trouble shooting things that dont need trouble shooting.
 
Back
Top