CoppeliaSim runs slow without 100% CPU

Typically: "How do I... ", "How can I... " questions
Post Reply
ferruz@us.es
Posts: 2
Joined: 02 May 2020, 08:21

CoppeliaSim runs slow without 100% CPU

Post by ferruz@us.es »

Hello,

I am running CoppeliaSim (educational version) in a virtual machine with Ubuntu 16.04 operating system; I am using the ROS plugin to interact with other ROS nodes. The problem is that the simulator will not run in near real time unless the cycle is increased to 100 ms. However, if I check the system monitor I find that the CPU load is far from 100%. It is about 50% if I use the standard Ubuntu interface, and about 30% if I use xfce4 instead, so it seems that the simulator should be able to run much faster. It does not seem to be a problem of lack of multithreading, because I have verified that CoppeliaSim is using more than a dozen threads, and no CPU is loaded to 100% either.

The virtual machine has 4 processors and 8 Gb of memory. The real machine has an Intel Core i7-7700HQ CPU running at 2.8 Ghz with four cores and eight logical processors and 16 Gb of memory. It runs Windows 10 o.s.

¿Does anyone know what may be the problem?

Thanks in advance.

coppelia
Site Admin
Posts: 10361
Joined: 14 Dec 2012, 00:25

Re: CoppeliaSim runs slow without 100% CPU

Post by coppelia »

Hello,

the simulation loop will run only on a single core, with a few tasks given to other cores in a blocking fashion. This is because the simulation loop needs to run synchronously, if we want a perfectly controllable simulation sequence, also from one simulation run to the next one.
Threaded scripts also run synchronously, they behave like threads, but operate more like coroutines. This too, in order to be able to perfectly synchronize every aspect of a simulation (and also synchronize between individual scripts, whether they run threaded or non-threaded)

Cheers

ferruz@us.es
Posts: 2
Joined: 02 May 2020, 08:21

Re: CoppeliaSim runs slow without 100% CPU

Post by ferruz@us.es »

Thank you for your reply. I thought that something like that would be the problem; however, this does not explain (does it?) that no single core is running at 100%.

In any case, it seems that I could not easily get anything better from my virtual machine :-(

coppelia
Site Admin
Posts: 10361
Joined: 14 Dec 2012, 00:25

Re: CoppeliaSim runs slow without 100% CPU

Post by coppelia »

Yes, using a virtual machine is usually adding quite some slowdowns unfortunately...

Cheers

Post Reply