:: Back to news index ::

Mafia II is not using GPU for PhysX Clothing simulation ?

with 27 comments

Everyone who played Mafia II will eventually notice, that enabling special APEX PhysX content will not only bring you flowing clothing and particle debris, but also significantly reduce framerate – even if you have a proper NVIDIA GPU and latest PhysX System Software.

Update: APEX Clothing in numbers

Update #2: Tests with dedicated PhysX GPU added – PART III.

While preparing our PhysX tweaking guide we have discovered that physically simulated clothing on characters is affecting performance the most. Why that ? Cloth is one of the basic effects, used intensively in many GPU PhysX games – just remember Mirror’s Edge and it’s countless tearable banners and flags. Two answers come to mind:

  • Clothing simulation in Mafia II is so detailed and so high-resolution, that only top dedicated GPUs can run it at proper fps.

Unlikely. Even in most intensive scenes total cloth vertices count is not exceeding 8000, while framerate is crawling around 20 fps – on GTX 470.

  • Clothing simulation is running on CPU, while it is supposed to be hardware accelerated on GPU.

Plausible. But, as our further tests have revealed, proved to be true for single GPU systems only.

Combine it with facts that a) Cloth in PhysX SDK is not using all available CPU resources by default b) Clothing is heavy computational task in any case – and you’ll see the probable reason of poor performance. Let’s check this theory.


For the first part of tests we’ll use benchmark, built into Mafia II, running with two sets of APEX effects – Clothing only (Particles are disabled using methods from tweaking guide) and Particles only (Clothing is omitted) – and PhysX acceleration enabled/disabled from NVIDIA Control Panel.

Settings: 1680x1024, AO/AA On, AFx16, APEX High. System: C2Q 9400, GTX 470, 4GB RAM, Win 7 x64, 198.32 GPU drivers, PSS 9.10.0513

Interesting results. While Particles are benefiting from GPU acceleration without doubt, PhysX switch is not affecting Clothing simulation at all.

It seems our assumption was correct – APEX Clothing is calculated on CPU in any case – but let’s confirm it with some deeper research.


Best way to find the truth is to look into entrails of PhysX SDK/APEX implementation in Mafia II.

Coarse tools like PhysX Visual Indicator won’t help, connecting PVD to the game is not easy task, so we’ll use profiler called AgPerMon, that will allow us to collect and review specific PhysX SDK simulation events.

Firstly, to find out which events are referring to GPU Cloth simulation, lets profile a simple application – SampleCloth.exe from PhysX SDK 2.8.3.


We are using scene 2: only one Cloth object in scene with applied wind acceleration.

Comparing two sets of data, extracted from SampleCloth running on GPU (left picture) and CPU (right picture) we can identify which events are responcible for GPU simulation – their names are starting with “NgPrDeformable“, “NgPrCloth” and “_cuda_kernel_Deformable“.

Now, let’s check actual game.

Mafia II – Chapter 15

For testing we used one scene from Chapter 15 – APEX is set to High, no additional characters on screen, APEX Clothing is represented by Vito’s casual suit with hat (616 dynamic cloth vertices). Also, we’ve spawned some APEX Particles events by shooting at walls.


First run – with GPU PhysX enabled in drivers.

As expected, we weren’t able to find any GPU Cloth specific events (left picture), familiar to us from SampleCloth. Instead, CPU Cloth simulation events were collected, thus - Clothing simulation is running on CPU.

What about Particles (right picture) ? They are running on GPU, as you may notice from lots of “NgPrFluid” events gathered.


Second run – with GPU PhysX disabled in drivers.

Result is predictable – both APEX Clothing (left picture) and APEX Particles (right picture) simulations are running on CPU – as they should.


Now, as new GTS 450 has arrived to suppement our current GTX 470, it is time to find out if dedicated PhysX GPU can help with Clothing simulation – as NVIDIA has stated:

Clothing is running on CPU unless you have a GPU, fully dedicated to PhysX.

First set – Mafia II built-in benchmark, testing methods and in-games settings are similar to PART I, but a different software setup (260.63 GPU drivers and 9.10.0514 PSS) was used this time.

Dedicated PhysX GPU gives a nice boost to Particles simulation, and more important – improves framerate for pure Clothing sim. So it’s actually working as promised ? Let’s check a few things firstly:

We’ve measured GPU load for a dedicated GTS 450 with MSI Afterburner 2.0.0. while performing a benchmark run with only Clothing enabled.

As you may see, Clothing simulation is putting some stress on dedicated PhysX GPU. Final test- profiling with AgPerfMon (click to view full pic)

Lots of “NgPrDeformable” and “NgPrCloth” events are indicating, that in case of dedicated PhysX card, APEX Clothing simulation is fully calculated on GPU, and thus performance gain is achieved.

We also can say, that in actuall game difference is even bigger. Some situations (with APEX High and without any tweaks), previously putting our single GTX 470 on knees, are running smooth and fluent with a dedicated GTS 450.


1) If you have a single NVIDIA GPU.

According to our results – in current version of Mafia II additional APEX Clothing content is running on CPU regardless to PhysX settings (while it is expected to be hardware accelerated by NVIDIA GPUs) and, thus, producing a huge performance drop.

In order to improve performance you can either disable (fully or partially) clothing simulation as described in our guide, or overclock your CPU.

APEX Particles effects are working normally, and can be calculated on GPU without any major performance loss.

2) If you have NVIDIA GPU, fully dedicated to PhysX calculations.

In this case both APEX Particles and APEX Clothing effects are running on dedicated GPU, leaving the game fully playble with APEX High setting and un-tweaked content.

Accent is put on fully dedicated – according to our data, PhysX switch in drivers must not be used in “Auto” mode, and we expect that SLI configurations may have problems with Clothing calculations too.

Written by Zogrim

August 30th, 2010 at 9:19 pm

27 Responses to 'Mafia II is not using GPU for PhysX Clothing simulation ?'

Subscribe to comments with RSS

  1. People are constantly forgetting that a GPU can be 4x to 10x cheaper than the equivalent CPU, of which is able to deliver the same performance. For example, comparing a $200 GeForce 9800 GTX to a $1200 Intel Core i7 980x is just unfair. Nvidia has the right to market it since a dedicated PhysX GPU is far more cost-effective than a $1000 CPU. Not to mention the CPU will be free to perform more tasks.



    15 Sep 10 at 4:32 am

  2. >People are constantly forgetting that a GPU can be 4x to 10x cheaper than the equivalent CPU

    And other people are constantly forgetting that you can’t run an OS on a GPU.
    Justifying a manufacturer’s right to promote additional GPUs for over-marketed, initially unoptimized technolohy such as PhysX is… wrong.
    The Ageia’s goal was not to create a cutting-edge and effective software solution, but to sell more hardware.

    Back on topic. If it’s true that it works only for green+green hybrids, it seems the protection is inside APEX dlls that come with the game. It may be possible to fix it for red+green hybrids, but then it should be done for every APEX-game individually.



    15 Sep 10 at 12:16 pm

  3. With the new Nvidia BETA 260.63 drivers, already packaging PhysX System Software 9.10.0514. I see a 10 FPS average increase in my FPS with a dedicated GPU for PhysX.

    However I still don’t see understand it is not possible to have PhysX Cloth running on GPU instead of CPU when SLI is enabled. At least there should be a profile setting to change it. I asked on Nvidia forums, but still no answer if this is a choice from Nvidia drivers choice or a choice from 2K.

    Sorry amigenius, I didn’t have time to check on what you asked.

    I have to change in Nvidia Control panel each time I play a different game than Mafia II.



    15 Sep 10 at 12:33 pm

  4. GenL
    If it’s true that it works only for green+green hybrids, it seems the protection is inside APEX dlls that come with the game
    Does this apply for clothing only, or for particles too ?
    Also, according to Joel Hruska from, Clothing won’t run on GPU if PhysX is set to “Auto” mode (in drivers), only if dedicated GPU is specified (that’s what Nvidia told him)
    Since, afaik, Hybrids are using “Auto” mode by default, this may cause the problem.

    but to sell more hardware
    It is a goal for every company.



    15 Sep 10 at 3:06 pm

  5. >“Auto” mode
    I see. This may be the case then.

    >It is a goal for every company.
    There are still companies doing this without marketing fps-breaking proprietary techs, you know.



    16 Sep 10 at 12:45 pm

  6. Hmmm,

    so maybe it’s possible to set the registry to dedicated physx, so that ATI+NVIDA Hybrids are using the NVIDIA as dedicated physx gpu….




    17 Sep 10 at 5:41 am

  7. So in the end everybody got away with that issue.

    I’d believe it is a problem for Nvidia to solve though…
    Why run PhysX Cloth on CPU when using SLi… You really need to dedicate a GPU to this, preventing the use of SLi…



    29 Jul 11 at 11:48 pm

Leave a Reply

Copyright © 2009-2014. | About project | Privacy Policy
PhysX is trademark of NVIDIA Corporation