Page **1** of **1**

### First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Mon Mar 23, 2009 5:10 am**

by **bullet_team**

Roman and me have been working on implementing a 3D CUDA Projected Gauss Seidel rigid body constraint solver based on

Takahiro Harada's 2D CUDA work. Takahiro and me will be discussing this general purpose gameplay physics on GPU at the

Physics Tutorial of the Game Developers Conference in San Francisco on Tuesday March 24th.

The results are very promising: CUDA performs really well, even though we haven't optimized fully yet (low occupancy).

You can check the

precompiled Windows 32bit binaries at google code.

* update * The implementation will be open sourced, and we are working on the OpenCL port.

Thanks,

Erwin

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Mon Mar 23, 2009 1:00 pm**

by **nadro**

This looks very interesting, but I have Radeon, so I don't have CUDA support... Have You got in plans translate it to OpenCL?

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Sat Mar 28, 2009 5:46 pm**

by **Erwin Coumans**

Yes, AMD helped us with the OpenCL version. It will be open sourced soon, but you need to wait for a public available OpenCL device driver for GPU or CPU.

(the CUDA kernels are almost identical to the OpenCL)

We demonstrated both versions this week during our Physics Tutorial at the game developers conference. The slides are here:

Online Google presentation:

http://docs.google.com/Present?docid=dc ... pauth=true
PDF:

http://bulletphysics.com/GDC09_ErwinCou ... rs_2nd.pdf
Thanks,

Erwin

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Sat Mar 28, 2009 11:04 pm**

by **nadro**

This is fantastic information. Great work!

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Wed Apr 29, 2009 5:11 am**

by **thloh85**

GPU for physics is interesting, but so far I'm still unable to compile the source code under MinGW (CUDA samples for bullet), I don't plan to migrate over to VC, thus, problems...

Anyway, Erwin and the bullet team, GREAT JOB...

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Wed Apr 29, 2009 6:00 pm**

by **PaulMartz**

Hi Erwin -- Thanks for the work on this and also for posting the Windows bunaries.

Current Bullet svn head has the Cuda broadphase available, but that's it. I assume once your recent Cuda work is more complete, the Cuda constraint solver will be included in libbulletcuda as well. What is the schedule for this?

I'm not sure I understand how the CDTestFramework and ReleaseAllBulletDemos examples are using Bullet. I presume they're using the solver? What are they intended to demonstrate?

As this solver is not yet available, and given I'm interested in using Cuda with current Bullet (or even 2.74), are there any examples with source code that demonstrate how to currently confugure and use the Cuda classes in libbulletcuda? I'm currently running into issues trying to use bt3DGridBroadphase on my own.

I'm also unsure of how to use the "particles.vcproj" in current Bullet, which is part of Extras/libbulletcuda. I can't get it to successfully link; it comes up with unresolved symbols. I can post an error report if you'd like.

I know this post covers a lot of territory, but if you can fill me in on the status and plans, I'd appreciate it. I'm researching Cuda status for my client at ISU (Doug McCorkle). Thanks.

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Mon May 11, 2009 6:32 pm**

by **KxL**

This CUDA solver looks very interesting. Any update on when we will be able to test it in own builds?

Thanks,

Krystian

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Tue May 12, 2009 4:56 am**

by **Erwin Coumans**

PaulMartz wrote:
Current Bullet svn head has the Cuda broadphase available, but that's it. I assume once your recent Cuda work is more complete, the Cuda constraint solver will be included in libbulletcuda as well. What is the schedule for this?

We will include some parts of the constraint solver for Bullet 2.75, later this month. Plan is to share the kernels with a pure CPU version as well as OpenCL implementation (in collaboration with AMD).

I'm not sure I understand how the CDTestFramework and ReleaseAllBulletDemos examples are using Bullet. I presume they're using the solver? What are they intended to demonstrate?

Bullet/Extras/CDTestFramework is mainly a broadphase n-body collision benchmark. The ReleaseAllBulletDemos show all main features of Bullet.

As this solver is not yet available, and given I'm interested in using Cuda with current Bullet (or even 2.74), are there any examples with source code that demonstrate how to currently confugure and use the Cuda classes in libbulletcuda? I'm currently running into issues trying to use bt3DGridBroadphase on my own.

What issues exactly? Can you update to latest trunk, and check out Bullet/Demos/Gpu2dDemo? We will add a Gpu3dDemo, and enable CUDA soon.

I'm also unsure of how to use the "particles.vcproj" in current Bullet, which is part of Extras/libbulletcuda. I can't get it to successfully link; it comes up with unresolved symbols. I can post an error report if you'd like.

Please remove/ignore particles.vcproj, it is redundant and obsolete. We will delete it.

This CUDA solver looks very interesting. Any update on when we will be able to test it in own builds?

The GPU 3D collision/constraint solving kernels, including CUDA support, will be available later this month. Note that the solver is work-in-progress and not fully generic yet, only supporting contact constraints (although we started working on non-contact joints)

Thanks,

Erwin

### Re: First 2D and 3D CUDA PGS constraint solver preview!

Posted: **Tue Jul 28, 2009 12:15 pm**

by **Micha**

Very, very nice!

I've recompiled the demo to enable CUDA and increased the number of cubes to 4500 (10 by 10 by 45). Using this setting de framerate drops below 24 only a few times.

But I see no apparent performance increase between the CPU solver and the CUDA solver (same with CUDA integrator vs CPU integrator). Am i doing something wrong?

My hardware: Geforce GTX 260, Core2 Quad Q9550 2.83Ghz, 8Gb internal ram.

I assumed CUDA could outperform a CPU by 5 to 20 times ..