NVIDIA Sheds Light On Lack Of PhysX CPU Optimizations - HotHardware

NVIDIA Sheds Light On Lack Of PhysX CPU Optimizations

0 thumbs up
About four months ago, we covered the latest round of shin-kicking between ATI and NVIDIA, with ATI claiming that NVIDIA purposefully crippled CPU performance when running PhysX code and coerced developers to make use of it. NVIDIA denied all such claims, particularly those that implied it used its "The Way It's Meant To Be Played" program as a bludgeon to force hardware PhysX on developers or gamers.

A new report from David Kanter at Real World Technologies has dug into how PhysX is executed on a standard x86 CPU; his analysis confirms some of AMD's earlier statements. In many cases, the PhysX code that runs in a given title is both single-threaded and decidedly non-optimized. And instead of taking advantage of the SSE/SSE2 vectorization capabilities at the heart of every x86 processor sold since ~2005, PhysX calculations are done using ancient x87 instructions.

When in doubt, blame the PPU.

Before the introduction of SIMD sets like SSE and SSE2, if you wanted to do floating point calculations on an x86 processor, you used the x87 series of commands. In the past 11 years, however, Intel, AMD, and VIA have all three adopted SSE and SSE2. Both allow for much higher throughput than the classic x87 instruction set—given the ubiquity of support across the PC market, it's hard to tell why NVIDIA hasn't specifically mandated their use.

As RWT's analysis shows, however, virtually all of the applicable uops in both Cryostasis and Soft Body Physics use x87; SSE accounts for just a tiny percentage of the whole. Toss in the fact that CPU PhysX is typically single-threaded while GPU PhysX absolutely isn't, and Kanter's data suggests that NVIDIA has consciously chosen to avoid any CPU optimizations, and, in so doing, has artificially widened the gap between CPU and GPU performance. If that allegation sounds familiar, it's because we talked about it just a few weeks back, after Intel presented a whitepaper claiming that many of NVIDIA's test cases when claiming huge GPU performance advantages were unfairly optimized.
 

Article Index:

Prev 1 2 3 4 5 Next
0
+ -

I usually support AMD, but I can see right through this. OF COURSE they dug up dirt on this, since it's a competitor's product! Now, I don't like nVidia's ambiguous "promote it/tie it to hardware" stance, but optimization simply doesn't work if you're developing for multiple platforms.

To answer Taylor: I think that it's not CPU optimized because although I agree that multiple cores are underutilized, a CPU has only 12 parallel processing cores at the most (here I refer to the i7-980X) but a GPU can have hundreds, making it perfect for calculating hundreds of particles (water drops, bullet casings, falling pencils, whatever). That's why I think they didn't focus on CPU optimization, and for another reason: going back to optimization for multiple platforms. What do they choose to support, Intel or AMD? And besides, like Joel said, nobody's stopping people from developing for software Physx as well, where physics calculations are built into the game/simulator engine.

0
+ -

Nether, (nice reference to Kara, btw).

 

AMD didn't commission this study. AMD has nothing to do with this study. Kanter is a person of very long standing in the tech community--his work confirms some of the facts AMD reported, insomuch as PhysX isn't optimized well for x86 CPU performance. AMD drew its own conclusions about why that is, Kanter drew his, and NVIDIA has its own explanation.

 

None of the parties in question--not AMD, not NVIDIA, not Kanter--are arguing that PhysX is fabulously well optimized for x86 CPUs. NVIDIA's position can be summarized simply in three parts:

1)  There are reasons why the numbers look the way they do.

2)  Kanter is using older projects that probably used fewer optimizations.

3)  The new code base NV will launch will make it easier to take advantage of CPU optimizations.

0
+ -

I don't buy Nvidia's response. It is not a simple case of them not wanting to optimize PhysX for the CPU, they seem to be purposely crippling it. As I understand David Kanter's original article, there is no advantage in using x87 over SSE. SSE and later iterations are much faster and easier to use, so why use x87?

 

Also, as Charlie Demerjian pointed out in his blog, today's compilers already default to use SSE in their output. If you want compiler's to output x87, to have to specifically tell it so. Of course given Charlie's obvious bias against Nvidia, you need to take this with a grain of salt, but it sounds logical given Intel and AMD deprecated x87 use years ago. Perhaps those who have experience in this can shed more light.

 

All they need is to recompile. Then Nvidia could've spent at most several weeks testing the recompiled library, according to David Kanter. And also, they could still provide the x87 version as an option during setup, in case somebody really needs it.

 

Simply put, there simply is no reason not to use SSE. If Nvidia doesn't want to optimize PhysX on the CPU, fine, I can understand that. But to use older, slower code deliberately just so that they can show PhysX is faster on their hardware by a lot is downright deceitful. Just as deceitful as disabling PhysX when there is an ATI GPU present, or disabling AA in Batman when using ATI GPU, or presenting non-functioning Fermi mockups and telling the world it's the real "puppy."

0
+ -

Thundermane,

I think you're missing part of NVIDIA's point. Remember, PhysX is a physics engine that runs in software mode (on the CPU) on virtually every platform it supports. Not optimizing for x86 code probably was a business decision, but the SDK itself isn't/wasn't designed to take full advantage of SSE when it was written 5-6 years ago.

Do I think there's probably more NV could do with its existing SDK?  Yes. Do I think there's a legitimate business reason why the company prioritized Cell and XBox 360 development over PC development? Absolutely. It's not just the fact that the majority of games are console games, it's the nature of the beast. Consoles are much more difficult to program; it's harder to get high performance out of them.

Making fundamental changes to the way a program multithreads or evaluates SIMD instructions is a complex process that could easily break backwards compatibility. I think we'll know a lot more once the new SDK is out.

0
+ -

"The best way to encourage people to buy NVIDIA GPUs is to ensure that the special effects are amazing and only available to NVIDIA customers. Optimizing PhysX to run on an x86 CPU potentially dilutes the attractiveness of an NVIDIA GPU,"

______________________________________________

My belief is that the best way to get people to buy your products is to build a better product. (like the awesome new GTX460 series)

If PhysX was opened up and tweaked to take advantage of all of today's techno-advances, life would be better for us, the consumers, and much ill-feeling against NVIDIA would go away. I realize that they bought the fledgling concept in that company, but they closed it off to others and crippled it for their own benefit too. This was a lousy public relations move and has turned friends into foes.

0
+ -

Real,

You've oversimplified the situation. First, NVIDIA has spent a great deal of money "building a better product." As this article stated, the next version of CUDA will incorporate more SIMD instructions and will generally be more efficient. At the same time, as you've noted, the company has worked towards releasing better iterations of Fermi at various price points.

We know NVIDIA has sunk a lot of money into CUDA and PhysX development. We know they've sunk a ton of money into future video card designs. Yes, NVIDIA wants developers to use CUDA and PhysX, but it's not as if the GeForce series has been crippled when it comes to running DirectCompute or OpenCL.

I'm not claiming that NVIDIA's approach to hardware PhysX adoption is the best possible one--but it's quite inaccurate to paint NVIDIA as opting for FUD as opposed to real improvements.

0
+ -

I know Nvidia gets a lot of hate but c'mon lets get real here. 

1.) They own PhysX, whatever they want to do with it is ther prerogative.

2.) They aren't blocking DirectCompute and a lot of these effects can be done through that now.

3.) They aren't blocking OpenCL either and they are part of Khronos group.

4.) If there are any physics engine right now that performs as well as PhysX and is as easy to implement in game as PhysX I'd love to see it, but frankly there are none.  Truth is  Nvidia is the only company right now that is actually putting their money where their mouth is in terms of advancing Physics.  Bullet has been all but abandoned (not surprisingly), the lead guy left development and its in limbo once again, although I'm amazed at the lack of flack ATI is getting for constantly promising things and not delivering. 

5.) All other physics engines are way behind PhysX in terms of technical advancement and its going to take a long while before they all catch up if they do (except for Bullet, unless ATI invests a major amount of time and resources on it in terms of developers and not just publicists coming out every few months reminding people they are working on an Open approach that never manifests into anything tangible).

0
+ -

crowTrobot:

If there are any physics engine right now that performs as well as PhysX and is as easy to implement in game as PhysX I'd love to see it.

Havok

http://www.youtube.com/watch?v=3bKphYfUk-M

0
+ -

acarzt:

crowTrobot:

If there are any physics engine right now that performs as well as PhysX and is as easy to implement in game as PhysX I'd love to see it.

 

Havok

http://www.youtube.com/watch?v=3bKphYfUk-M

 

Well that demo actually doesn't show that it performs better than physx Stick out tongue

Granted that video is 3 years old now, but those are just basic collision physics.  More impressive would be particle manipulation to simulate water or gas for example.  The skeletal animation on that thing looks very basic too. Also since havok is made by intel, its only CPU implemented vs GPU parallelization with physx.

Best example of the current state of havok physics is probably Just Cause 2, although there are no hundreds of individually reacting physics particles in there at the same amount of time on the screen (dissappears after two seconds) like there is in something like Mafia 2 or Batman.  Even the impressive looking water in Just Cause 2 was implemented using CUDA (though not directly PhysX, it moreso shows the limitations of havok when handling fluid mechanics)

 

0
+ -

Joel H:
 Real, You've oversimplified the situation. 

I have a simple perspective. I'm not anywhere near as knowledgeable as you about this stuff. I don't know as much about this and many other things as you. I look at it as 'what I'm experiencing when I play games'. I've tried turning on PhysX with my 2GB GTX285 and my 1GB HD5850 card in both computers to no avail. it just doesn't work. So here is something that everybody's crowing about that I can't touch with either of my several hundred dollar video cards. Then I go online and read about it a little (mind that I really don't understand the technical aspects entirely) and lots of supposedly knowledgeable people are bitching that NVIDIA has crippled the technology unless you shell out big money to them, and they're trying to strong arm developers into adopting their propitiatory tech within their games. (leaving a lot of us to wonder what it looks like)

So I resent it. It's simple.

BTW: This doesn't mean that I won't buy from them. (the ultimate expression of financial love) I have my eye on a pair of those GTX460's for an SLI box. Price, performance and the inclusion of those technologies that I've been missing drive this decision.

Prev 1 2 3 4 5 Next
Login or Register to Comment
Post a Comment
Username:   Password: