iMSTK Unity Very Low FPS

I followed the instructions and built the iMSTK project. After that, I installed the iMSTK build into Unity with Developer Mode. In the tutorial scene, I’m experiencing latency of 4000 - 5000 ms. Interestingly, Unity is not utilizing the CPU or GPU at all.

My system specs:
CPU: i7 - 12650H
GPU: RTX 4060 Laptop
RAM: 16 GB

We might have incorrect defaults in the simulation manager timestep, check that the timestep is somewhat in the range of 0.01-0.002 or so. Also use the simulation stats script to show the timing of the physics calculation.

The way the threading is set up now there is a lot of latency when the simulation manager timestep is lower than the actual time taken for a frame
image
image

The second image is a shot of the Simulation Stats component in action, in the second line you see the physics frame time the left value is the pure imstk value, the right is the timing with unity overhead. The timestep value set in the simulation manager needs to be higher than the imstk timing value.

iMSTK does not utilize the GPU at all, we’ve always run into the overhead communicating with the GPU as an issue preventing us from doing more work. With regard to CPU load, we probably could do more in terms of parallelization, but there are some steps in the PBD calculation that can’t be parallelized completely.

Thank you for your response. I made some improvements by changing the default values, but the performance is still very low. Here is the current situation:

Could I have done something wrong during the installation process? Could this issue be caused by an incorrect setup?

It’s hard to say, the physics time data looks good for inside imstk but for some reason unity is taking a lot of time i.e. 17ms that should not be the case. I’ll check that example locally and see if we did something to break it

1 Like