Game Development Community

PhysX hardware enabled. YAY!!

by deepscratch · in Torque 3D Professional · 06/17/2009 (11:33 am) · 22 replies

so I got the physx simulation to be enabled on hardware (if you have a physx ppu installed).
I need some testers to see/compare frame rates with it enabled and not enabled.
also, if you got the GMK, I've enabled the cloth to simulate on hardware (if you have a physx ppu installed), and I intend to try extend the hardware simulation to all the physx physics, if I can.

wanna try it out??

Connection established 3207
PhysXWorld::init() - Created hardware simulation!
CADD: 3208 local

Page «Previous 1 2
#1
06/17/2009 (11:52 am)
@deepscratch, by "physx ppu" you mean the "old" Physx ppu, or any Nvidia CUDA-enabled GPU?
#2
06/17/2009 (11:53 am)
Nice work! Does it work with NVidia's G80/G90/G200 cards?
#3
06/17/2009 (12:04 pm)
if you need testers with CUDA enabled I'm available to it.
But I can't offer one of those stone age slow PPUs ^^
#4
06/17/2009 (12:17 pm)
@Novack,
any Nvidia CUDA-enabled GPU

@Manoel,
thats why I need testers, to see what it will work with

@Marc,
great, I'll quickly put together a "how to get it enabled", and post here, just a few moments...

BTW, I'm testing on my beautiful new GTX295 ;)
#5
06/17/2009 (12:29 pm)
Let me guess, you sold one of your kidneys..?
#6
06/17/2009 (12:33 pm)
Should work with any Nvidia GPU series 8 or higher.
#7
06/17/2009 (12:35 pm)
ok, heres how,
in pxWorld.cpp
in PxWorld::PxWorld()
change
mEditorTimeScale( 1.0f )
to
mEditorTimeScale( 1.0f ),
   HW ( false )
then, in PxWorld::_init
add this
NxHWVersion hwCheck = gPhysicsSDK->getHWVersion();
		if (hwCheck == NX_HW_VERSION_NONE) 
		{
			HW = false;
		}
		else 
		{
			HW = true;
		}
just above
// Create the scene description.
   NxSceneDesc sceneDesc;
   sceneDesc.userData = this;
then add
if (HW)
			sceneDesc.simType = NX_SIMULATION_HW;
		else
			sceneDesc.simType = NX_SIMULATION_SW;
below
sceneDesc.gravity.set( smDefaultGravity.x, smDefaultGravity.y, smDefaultGravity.z );
then change
/*
   // Make note of what we've created.
   String simType = sceneDesc.simType == NX_SIMULATION_SW ? "software" : "hardware";
   String clientOrServer = this == isServer ? "server" : "client";
   Con::printf( "PhysXWorld::init() - Created %s %s simulation!", 
      clientOrServer.c_str(), 
      simType.c_str() );
   */
to this
// Make note of what we've created.
   String simType = sceneDesc.simType == NX_SIMULATION_SW ? "software" : "hardware";
   //String clientOrServer = this == isServer ? "server" : "client";
   Con::printf( "PhysXWorld::init() - Created %s simulation!", simType.c_str() );
then add this to the end of the file
bool PxWorld::getHWMode()
{
	return HW;
}
now in pxWorld.h
under a protected:
add
bool HW;
I put mine under " void _releaseQueues();"
then just below
const F32 getEditorTimeScale() const { return mEditorTimeScale; }
put this
bool getHWMode();
thats it.
if you got GMK, and you want the cloth and softbodies to be hardware, then in physShapeSoftPhysX.cpp
add this include
#include "T3D/physics/physx/pxWorld.h"
then just add this
if(m_world->getHWMode())
			meshDesc.flags |= NX_CLF_HARDWARE;
above the line that says
NxInitCooking();

thats all.
when you run the game, you'll get a print of either

PhysXWorld::init() - Created hardware simulation!
if you got compatable hardware
or
PhysXWorld::init() - Created software simulation!
if you dont.
I think thats all, lets see.
#8
06/17/2009 (5:17 pm)
When we originally wrote much of this PhysX code it was over 2 years ago. At that time we had bought a PhysX PPU card and found that for our project the PPU was slower than software simulation on a 4 core CPU. So we just commented out the hardware switch.

It will be interesting to see if the Cuda backend is better then the old PPU.
#9
06/17/2009 (7:41 pm)
Works like a charm :)
#10
06/17/2009 (9:47 pm)
Anyone care to do some performance testing on PhysX software vs. hardware?
#11
06/18/2009 (3:49 am)
yeah, yhat was what I wanted people to do....
I got a 7 FPS increase in the physx enabled genre kit...
#12
06/18/2009 (5:55 am)
Too bad I got a Radeon =P. Maybe when we get a Havok plugin.
#13
06/18/2009 (7:18 am)
isn't Havok middleware that you have to pay for though?

also dumb question but how do I see the stats like fps is there a way to make them overlay on the screen?
#14
06/18/2009 (7:21 am)
I thought so, but for PC games (I assume this include Mac/Linux) it has been free since Intel acquired Havok.

If your game is sold by more than $10 all you need to do is fill a request form in order to comply with logos and copyright notices. Otherwise it's completely no-frills.

Note that this doesn't apply to non-game products: in that case you need a license.
#15
06/18/2009 (1:01 pm)
can anyone tell me how to fix this?
www.garagegames.com/community/forums/viewthread/94889

trying to test the PhysX hardware but there seem to be some hard coded paths. I'm on x64 so they are different paths.
#16
06/18/2009 (4:23 pm)
Wouldn't fit in here but getting from really odd error now:
pixollusion.com/T3D/beta2/BuildLog.htm

look about 90% of the way down the buildLog

there are about 30 errors with the last one being:
..\..\..\..\..\Engine\source\T3D\physics\physX\pxWorld.cpp(818) : fatal error C1004: unexpected end-of-file found

almost sound like my copy of torque is corrupt or something maybe?
#17
06/18/2009 (5:18 pm)
Quote:I thought so, but for PC games (I assume this include Mac/Linux) it has been free since Intel acquired Havok.

Any link on that?
I recently visited the page as I was told a similar thing but all I found on their page was a trial, which does not allow you any commercial use
#18
06/18/2009 (5:31 pm)
@James,
try following the instructions again, I see you say you are new to coding? I was too, try again, read the instructions a few times, then try again.
maximum, if you still dont get it right, post your whole pxworld file, and we'll work it together from there
#19
06/19/2009 (10:29 am)
Quote:Any link on that?
I recently visited the page as I was told a similar thing but all I found on their page was a trial, which does not allow you any commercial use
In the trial page, click on the link that says "Try Havok General Information pages". It mentions the restrictions on various uses of the trial version.

Here's the page on professional games: www.havok.com/content/view/622/
#20
06/21/2009 (10:46 am)
@Tom,

What kind of testing are you looking for? I am willing to test as I have some free time. Just let me know what the baselines are. I have 2 GTX280s and interested to see how Physx works with Vista now that they have the new patch in place on the new drivers. I originally had to dedicate one GPU/monitor to Physx.
Page «Previous 1 2