So I recently started working with PhysX in order to test its usability for the simulation of an automated high rack warehouse.
The main criteria in this case is the performance of the simulation when simulating huge facilities.
While I am aware that I probably won’t be able to simulate a whole facility at once (I already have a concept to split it on different servers) I still want to see how far I can go with one simulation.
What I’ve done so far is creating “roll conveyors” (you can easily google what they look like) by adding a few capsules (kinematic) to the scene in a row and rotating them along their longitudinal axis. I can then drop boxes onto it which will then get carried away.
So far so good.
Now with a simulation step time of 33ms I can already create around 28000 rolls (a few boxes on it are still fine, haven’t tested further yet) without the calculation time exceeding the 33ms.
But that’s about it… 28000 rolls are the limit. With more rolls the calculation time starts increasing beyond the 33ms mark. Which would be fine, 28k is already a lot.
But the thing is, with 28k rolls the programm is only using around 30% CPU capacity and it won’t go much higher than that even when creating even more rolls (despite the calculation time still increasing).
Now it seems odd to me that Physx is not using all of the CPU capacity if it clearly needs it!
The weirdest part is, that I can easily run 2 instances of the simulation with 28k rolls per simulation at the same time (which does indeed result in doubled CPU usage). So how is it not possible to run ONE simulation with 56k rolls when I can run 2 with 28k?
I am currently working on a Windows system with 4 CPU cores.
I am using one CpuDispatcher (default) with 4 worker threads. I already tried less, and even more, threads but the result hardly changed. I also experimented around with affinity mask but also…nothing.
No matter what I did, the programm just won’t use all of the CPU’s capacity.
Another thing I should mention is, that I am running the programm as a console application. There’s no renderer (I can turn it on for debugging) and no game engine or anything and there won’t be one in the future so no worries about that.
Does anyone have an explanation for this “bottleneck”?
It’d be perfect if there’d be a solution for it but I’d already be happy if I’d at least know for sure that what I want to do, is not possible.