Thursday, July 15, 2010

Nvidia PhysX Software is Ancient, Slow for CPUs

PhysX for CPUs is built on x87. Not the best choice on modern day CPUs, it seems.

Nvidia's acquisition of Ageia in 2008 was a strategic move to boost the marketability of its GPU offerings. With the discontinuation of the dedicated PhyX boards, the acceleration moved to the GeForce GPU as a differentiation factor that set it apart from AMD's ATI cards.
If a PhysX game detected the presence of an Nvidia GPU, it would move the hardware physics to the video card. Without an Nvidia board, the physics would hit the CPU, which in all cases is slower than what a GPU can do.

It's expected that Nvidia would like to do everything it can to distance itself from the CPU and the GPUs of its competitors, but closer looks at the PhysX software implementation have shown that there could be some shadiness going on.

An excellent investigation by David Kanter at Real World Technologies found that Nvidia's PhysX software implementation for use by CPUs still uses x87 code, which has been deprecated by Intel in 2005 and now has been fully replaced by SSE. Intel supported SSE since 2000, and AMD implemented it in 2003.

The x87 code is slow, ugly, and remains supported on today's modern CPU solely for legacy reasons. In short, there is no technical reason for Nvidia to continue running PhysX on CPUs using such terrible software when moving to SSE would speed things considerably – unless that would make the GeForce GPGPU look less mighty compared to the CPU.

Ars Technica's Jon Stokes confronted Nvidia about deficient PhysX code and we are just as surprised as he was that Mike Skolones, product manager for PhysX, said "It's a creaky old codebase, there's no denying it."

Nvidia defends its position that much of the optimization is up to the developer, and when a game is being ported from console to PC, most of the time the PC's CPU will already run the physics better than the console counterpart. The 'already-better' performance from the port could lead developers to leave the code as-is, without pursuing further optimizations.

"It's fair to say we've got more room to improve on the CPU. But it's not fair to say, in the words of that article, that we're intentionally hobbling the CPU," Skolones said. "The game content runs better on a PC than it does on a console, and that has been good enough."

No comments:

Post a Comment