-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multithreading crash in PhysX 5.1 in CPU mode when using eNOTIFY_TOUCH_PERSISTS pair flag #630
Comments
Hello Pierre, thanks for the investigation. Perhaps it is also relevant how I run the simulation.
What information / data would you additionally need? |
sorry, accidently clicked close... |
Hello all,
I have an issue with multithreading CPU collision detection and PhysX 5.1. I want to track contact points between complex geometries (modelled as kinematic bodies) in a simulation application for press tools. Therefore, I set up two scene descriptions, one for GPU mode, one for CPU mode. If no capable GPU is installed in the user's system, the CPU model mode shall be the fallback. Most settings of both are taken from the given SDK examples. The GPU mode is working without issues.
GPU description:
CPU description:
I set up the dispatcher with the number of threads to be used and left the default parameters as they were:
m_pDispatcher = PxDefaultCpuDispatcherCreate(2); //use two threads
In my filter shader as well as in my event callback, I use the following flag combination for pair filtering:
The following combination brings PhysX to crash:
I use convex decomposition (VHACD) for approximate modelling of the complex part geometries I have to deal with. Thus, there are hunderds of PxShape objects which (potentially) collide wiht each other.
At the end the error occurs within the PxArray class.
The call stack is as follows:
My assumption is that two threads concurrently try to alter the array of persistant contact event pairs, which leads to re-allocation of memory triggered by one thread and then the other thread tries to work on a memory block which just became invalid.
I had such issues several times in my own code. Or maybe I am wrong and threre is a setting which I am doing wrong?
Could you please give me an advise?
Many thanks
Stefan
The text was updated successfully, but these errors were encountered: