Newton on GPU (CUDA, OpenCL)

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Newton on GPU (CUDA, OpenCL)

Postby martinsm » Thu Aug 06, 2009 7:46 am

AMD has released beta Stream SDK that includes OpenCL support (currently only with CPU backend): http://developer.amd.com/GPU/ATISTREAMS ... fault.aspx
martinsm
 
Posts: 86
Joined: Mon Dec 19, 2005 3:15 pm
Location: Latvia

Re: Newton on GPU (CUDA, OpenCL)

Postby hpesoj » Tue Aug 11, 2009 9:27 am

Have you been working on GPU integration lately Julio? The videos from February look very impressive, and owning a GeForce 8800 GT myself, I am quite interested to hear where Newton currently stands with regards to GPU acceleration :D.
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

Re: Newton on GPU (CUDA, OpenCL)

Postby Julio Jerez » Tue Aug 11, 2009 3:22 pm

There is a lot of turmoil with the GPU and High Performance computing stuff now, the CUDA Stuff keeps changing,
now with have OpenCL, and Intel is comming with it Larrabee. I decided that it is best to put on hold until is is more stable.

we do not have to be the first, and I can guarantee you that wil will not be the last, but we will have it.

I am incline to go with OpenCL, but I am wating what Intel have to say aboout with ot Larrabee.
I was checking the emulation SDK teh oteh theay and it seems very nice.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton on GPU (CUDA, OpenCL)

Postby Julio Jerez » Wed Aug 12, 2009 5:34 pm

Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton on GPU (CUDA, OpenCL)

Postby martinsm » Wed Aug 12, 2009 5:37 pm

OpenCL is not meant only for GPU. It is just language and API. You can write backend for it for any device/hardware. Is it CPU, GPU - doens't matter. You coud event implement OpenCL that runs on mobile phones.
It is similary like OpenGL is only specification and API - for what system it has backend, it doesn't specify it.

CUDA from Nvidia already includes backend for CPU from its beginning. So you can develop and run CUDA programs even without Nvidia GPUs.
martinsm
 
Posts: 86
Joined: Mon Dec 19, 2005 3:15 pm
Location: Latvia

Re: Newton on GPU (CUDA, OpenCL)

Postby Julio Jerez » Wed Aug 12, 2009 5:49 pm

martinsm wrote:CUDA from Nvidia already includes backend for CPU from its beginning. So you can develop and run CUDA programs even without Nvidia GPUs.

I do not think this is totally correct. The CPPU part is for debugging only and it is on the order of tousands of times slower.
Cuda is no really the beast they say it is, in fact it is a a great disapointment.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton on GPU (CUDA, OpenCL)

Postby aqnuep » Sun Sep 06, 2009 12:42 pm

Hi Julio!

So what's now on OpenCL based Newton?
Are you working on it or you really suspended the work on it lately?

Important question about this:

I suppose all the rigid body data (including world matrix of them) will reside somewhere in a buffer in video memory.
Have you planned to put some new queries to the Newton API in order to enable access to these?
I think this is important because it makes no sense to download individual world matrices for e.g. 10000 rigid bodies from GPU memory to system memory then transfer it back to GPU memory for rendering.
I am really interested what design and usage changes you will put into Newton together with the OpenCL support...
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Re: Newton on GPU (CUDA, OpenCL)

Postby martinsm » Mon Sep 07, 2009 7:06 am

Julio Jerez wrote:The CPPU part is for debugging only and it is on the order of tousands of times slower.
Cuda is no really the beast they say it is, in fact it is a a great disapointment.

Yes, that is exactly what for CPU backend is intended. For conformance testing, debugging. It simply allows to developer if you don't have access to latest hardware. Nobody expects for CPU backend to compete with GPU backend.
Same for current OpenCL release from AMD - it's not meant for top performance, it's just for developing and debugging.

aqnuep wrote:I suppose all the rigid body data (including world matrix of them) will reside somewhere in a buffer in video memory.
Have you planned to put some new queries to the Newton API in order to enable access to these?

This would be really great. Afaik OpenCL provides means for directly transferring GPU memory to OpenGL buffers (VBO, UBO, TBO for example) without transferring through system memory. And then data from UBO or TBO could be used directly in vertex shader to access individual matrices of body for transforming mesh vertices.
martinsm
 
Posts: 86
Joined: Mon Dec 19, 2005 3:15 pm
Location: Latvia

Re: Newton on GPU (CUDA, OpenCL)

Postby aqnuep » Mon Sep 07, 2009 11:50 am

martinsm wrote:Yes, that is exactly what for CPU backend is intended. For conformance testing, debugging. It simply allows to developer if you don't have access to latest hardware. Nobody expects for CPU backend to compete with GPU backend.
Same for current OpenCL release from AMD - it's not meant for top performance, it's just for developing and debugging.


By the way, I don't think so that AMD CPU OpenCL drivers are only for developing and debugging. It is useful in cases where no OpenCL capable video card is present. Also if you don't want to such with CPU-GPU synchronization/data transfer, then maybe you achieve faster performance with a CPU backend. Depends on the use case. Of course for physics the GPU backend is much more feasible.

martinsm wrote:This would be really great. Afaik OpenCL provides means for directly transferring GPU memory to OpenGL buffers (VBO, UBO, TBO for example) without transferring through system memory. And then data from UBO or TBO could be used directly in vertex shader to access individual matrices of body for transforming mesh vertices.


Yes, OpenCL is nice because it can easily interwork with OpenGL. The question is that will Newton provide such mechanisms to take advantage of this performance optimization. I think there was nothing said about such an improvement yet, but I bet on it that Julio is aware of the potential in such a thing. Just interested whether there's already some design pattern what he'll use to provide such functionality.

Julio! If you need some aid in this part, I would really like to help.
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Re: Newton on GPU (CUDA, OpenCL)

Postby aqnuep » Thu Oct 08, 2009 4:29 am

Julio, do you know that multiple commercial and open source physics libraries already done their OpenCL or other GPU based implementation?

How it is going for Newton?
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Re: Newton on GPU (CUDA, OpenCL)

Postby Julio Jerez » Thu Oct 08, 2009 9:37 am

Oh really! I do not really care what others do, I dance at the pace of my own song.
The value of Newton is Open source or of Using the Latest pseudo language gismo.

It will be a long time until I decide to go with Openly, of any other HPC language, those language are still no ready for production. There are changing the Hardware they are running on.
And Intel, nVidai, and ATI are still in battle with each other.
I will not be part of that.

My Guess that maybe when Microsoft, the real software company in the block, address the issue all that none from the Idiotic and Mononic Chronos group with go away.
Until then OpenCL and Cuda are not really for prime time.
Right now they are only check box feature list for desperate competitors willing to go anything to beat us.

OpenCL that can only be programmed open source mode and you need to distribute your code with you app. Open CL is real bad start and I hope nvidia recognize it and change direction, otherwise only the self appointed experts and the cutting edge companies desperate to make the news will use it.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton on GPU (CUDA, OpenCL)

Postby aqnuep » Fri Oct 09, 2009 8:13 am

I disagree in most of the things you said.

And Intel, nVidai, and ATI are still in battle with each other.

First, battle between NVIDIA and ATI won't be over soon and I wouldn't expect the holy grail from Intel's Larrabee. ATI's DX11 hardware is already almost as flexible as an x86, except of course those built-in fixed function stuff. But GPU was always better in graphics than CPU not just because of more computational power, but GPU wins especially thanks to those built-in fixed function stuff.

I do not really care what others do, I dance at the pace of my own song.

I don't want to tell you what you should do, I was just asking for some info about what is going on with the GPU implementation of Newton.

My Guess that maybe when Microsoft, the real software company in the block, address the issue all that none from the Idiotic and Mononic Chronos group with go away.

At the beginning I was also critic with the Khronos Group, but since that it seems that they're doing their job quite well. At least IMO.

OpenCL that can only be programmed open source mode and you need to distribute your code with you app.

Yes, I understand that. I wasn't even thinking about it. I know that Newton is a closed source project, but it worths the fact that this way it'll never get OpenCL implementation? Havok will release an OpenCL implementation. How's that they don't fear of the fact that one tricky guy with a fake OpenCL driver can capture their code? I don't know. It's just a retoric question.

Anyway, Newton was always my first place for physics, but for my new project I need as tight integration of physics and graphics as possible.
So in optimal case all collision and mesh data should reside only in video memory. This is the only way to achieve ultra cheap soft bodies, deformable objects and body destruction.

Sorry for being a bit offensive. I don't want to tell what is right and not. I really appreciate your work and I adore Newton! That's why I'm interested. Just since a while this is the first time when I started to think about switching to another physics API, and that I DO NOT want to do.
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Re: Newton on GPU (CUDA, OpenCL)

Postby Julio Jerez » Fri Oct 09, 2009 9:23 am

aqnuep wrote:Anyway, Newton was always my first place for physics, but for my new project I need as tight integration of physics and graphics as possible.
So in optimal case all collision and mesh data should reside only in video memory. This is the only way to achieve ultra cheap soft bodies, deformable objects and body destruction.
Sorry for being a bit offensive. I don't want to tell what is right and not. I really appreciate your work and I adore Newton! That's why I'm interested. Just since a while this is the first time when I started to think about switching to another physics API, and that I DO NOT want to do.


I will adress the soft body issue soon, for that and for some graphics algorithm that requires massive parallel graphics and simplistic physics I will try the GPU solution with CUDA.
But for the Physics will way. Softbody, fluid are simple enought and parallel enought that the cost of comunication with CPU can be justified.
there you need to regenetate graphics geometry and there is much tighter coupling between graphics and physics, so much more can be done in GPU.
When the time is right, Newton will implement PHC, until them I will focus, on what other things.
All of these pseudo languages are still in phase of experimentation. Open Source for me is a NO, NO.

However I do not want to hold hostige to a promise, Newton is just a library amoung so many out there, do not hesitate to try something else.
you did not sign any agregment here, anyone if free to come a go. Maybe in the futute you can try again and you will still be welcome.


I still have very high hope on Larrabe, I believe Intel has the right idea but they are trying to be too much in a first pass.
Larrabe architecture is the right solution for High performance computing but without dedicated hardware for rasterization it is incomplete for graphics

I believe that one cores of Larreabe will smoke all 32 nvidia cores by a landslide.
This is a Fact, I test thus with intell Nahelem.
One Core of and Intel iCore7 is about 20 times faster that one multiCPU of the nvidia G285, the problem is that rasterization takes too much CPU resources, and it need to be done but massive silicon in parallel.

My guess is that the first and maybe the second iteration of Larrabe will not beat Nvida and ATI in graphics department, but it will leave then in the dust in everything else.
Hey righ now every algorithm you implement in and coreI7 is about 4 to five time faster than in a Gforce, but you get killed copied data in an out of the GPU.
Just that fact alone will make Larrabe a winner, since it will be a pure CPU that can run sequential algorithm at full speed without the need to result back to CPU to complete calculation.
But It wound be until Intel Realises that the need to complemented with special Rasterization and Polygon assembly that the solution will be complete.

This Idea OpenCL that you do stuff but issuing a serious of small kernel for the CPU is just and ill conceives software parading tha is and extention of the Shader solution.
that maybe good for simplistic graphics, but not for advance graphics like Racetracing or for high performance computing where you need to solve complex algorithm.

OpenCL and CUDA like Collada is the king of Gabage we get for the Moronic Chromos Group that seems to high jacked Nvidia, ATI, and now try to do the same to Intel and Microsoft.
Just for that I will not touch any of the brain child for those arrogant idiots.

In any case like I said, when a appropriate software solution in reliable I will use it,
I did the CUDA solver and it got to be quite Good, but Nvidia do not listen to users,
I asked then for the possibility to have 32 and 64 bit library than can coexist in one system and the simply say no. So I Move on to something else.
you can search for my post in the forum, I am not a welcome person over there.
When I post the crown is very silence.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton on GPU (CUDA, OpenCL)

Postby aqnuep » Fri Oct 09, 2009 10:03 am

Thanks for the fast response.

For computing, I totally agree that larrabee is more suitable but not for graphics, as you said. We will see what will happen in the graphics industry later :)

Anyway, I know that you don't do Newton especially for me or somebody else, so don't think that my comment as a wish of a crying baby :)
Newton will always be my favorite because my first successful physically based side-projects were done with it (after figuring out that ODE and stuff like that s*ck in many stuff).

Still, I would like Newton to be in the market as the BEST physics engine, that's why I wrote all these things.

About CUDA, Brook+ and stuff like that I really see no point in sticking to them. I favor OpenCL because it's cross-vendor and cross-platform. Just have a look and PhysX. Have you heard that rumours sais that nowadays typical gamers think like having NVIDIA for physics and ATI for graphics, but NVIDIA now added a blocking in their drivers to disable PhysX if there is an ATI card in the machine. That's why I hate these local "standards" like CUDA and stuff like that.

About Newton being open source, well, I'm not really interested whether Newton is open source or not. I just care about that it's working fast and working great and it didn't cause any headache for me in the past that Newton is closed source because I've always received fast response on this forum :)
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Re: Newton on GPU (CUDA, OpenCL)

Postby Julio Jerez » Fri Oct 09, 2009 11:57 am

When I finish this new feature I have being working for the last month, which I hope to have it ready these week end.
I will star the Soft Body, Fliud and Cloth solution and for that I will start with OpenCL.
Since I will be stating that from scratch I will make it friendly to GPU, and CPU by doing both simultaneously.

For Newton 2.0x the rigid body part it was too late and I need to do too much rewriting.
That and the fact that Nvidia keeps changing stuff are one the reasons I decided to not continue at this time.
Maybe after 2.x is final and I start with Newton 3.0 from scratch wee I will build everything from the ground up to GPU friendly. But I will definitely use OpenCL for Fluids, Soft bodies and Cloth.

There I can use the extra performance for self collision and just brute force calculations that are simple and data parallel.

BTW the new feature I am working now and that I will try to release this weekend will open a new way of thinking about Physics for games, no longer the idea of worlds with few hundreds of bodies will be the limiting factor for making game levels, The Physics will be Unlimited, and I am speaking of levels with several of thousands of colliding pieces working at 100s of frames per seconds in a standard CPU.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron