Playing video or audio in other apps can cause an increase in pybullet simulation performance
Posted: Thu Jan 18, 2018 7:01 am
Yeah, you read that right, an increase in simulation performance.
Initially this behavior appeared to be random. It happened frequently, but I had no idea why, and I could not reproduce the issue on demand.
After a lot of trial and error I can now reliably trigger this behavior with the web browser Waterfox and the video recording and live streaming app OBS Studio. Both of these programs have portable 64-bit versions which is what I use. I imagine that any modern web browser will work, but I do know that Internet Explorer 11 will not.
To display the behavior take a pybullet script and set the timeStep so that it's smaller than your system can play well. For me that's 1/1000.0 or anything under 1/100.0
I'm really curious as to why this happening. Are the other apps somehow causing pybullet to run on the gpu or use more cpu threads?
Also, if this is a bug, please find a way to make it a feature or at least don't fix it.
Windows 7 64-bit sp1, geforce 750 Ti, nVidia driver 390.65,
WaterFox 56.0.2(64-bit), OBS Studio 20.1.3(64-bit)
pybullet compiled with and without numpy,
and for both Python 3.6.4 and 2.7.13
Sim parameters:
Initially this behavior appeared to be random. It happened frequently, but I had no idea why, and I could not reproduce the issue on demand.
After a lot of trial and error I can now reliably trigger this behavior with the web browser Waterfox and the video recording and live streaming app OBS Studio. Both of these programs have portable 64-bit versions which is what I use. I imagine that any modern web browser will work, but I do know that Internet Explorer 11 will not.
To display the behavior take a pybullet script and set the timeStep so that it's smaller than your system can play well. For me that's 1/1000.0 or anything under 1/100.0
- In Waterfox, go to a page with video, for example youtube, load a video, after it starts playing pause it.
- Run the pybullet script. The simulation should be very slow.
- Now un-pause the video and the simulation performance will increase signifigantly.
In my case 1/1000.0 with a video playing runs as well as or better than 1/100.0 without a video playing! I suppose it could be dropping frames, but it sure doesn't look like it to me. Toggling video playback on/off will toggle the performance increase on/off. - This also works with audio only, e.i. podcasts, played in Waterfox.
I'm really curious as to why this happening. Are the other apps somehow causing pybullet to run on the gpu or use more cpu threads?
Also, if this is a bug, please find a way to make it a feature or at least don't fix it.
Windows 7 64-bit sp1, geforce 750 Ti, nVidia driver 390.65,
WaterFox 56.0.2(64-bit), OBS Studio 20.1.3(64-bit)
pybullet compiled with and without numpy,
and for both Python 3.6.4 and 2.7.13
Sim parameters:
Code: Select all
p.setPhysicsEngineParameter(fixedTimeStep = timeStep, numSubSteps=1, numSolverIterations=10)