Posts: 8
Threads: 1
Joined: Jan 2018
Reputation:
0
30-01-2018, 05:44 PM
(This post was last modified: 30-01-2018, 11:00 PM by salvetori.)
Hello,
I've been having an issue where every few seconds I will encounter a massive momentary drop in performance. In this scenario the cloth I am simulating is following the character cloth setup from the documentation, and is currently not colliding with anything. The solver is using the default settings save for having the simulation space set to local and having the simulation order set to late update. The cloth being simulated has thickness, with self collisions enabled. However, enabling a cloth proxy or not didn't seem to have an effect on this performance spike happening. I also tested simply disabling every single constraint and that also did not seem to have an effect.
[attachment=70]
I followed some of the pointers found in this thread: http://obi.virtualmethodstudio.com/forum...d-200.html
Unfortunately these didn't change the outcome.
The demo scenes that come with obi cloth perform fine and I don't encounter this issue in those demo scenes, particularly in the character cloth scene that I am trying to emulate.
I am not really sure what is going on so I'd appreciate some help. Let me know if you guys need more info.
[attachment=69]
Edit:
So, I was incorrect in saying that the performance spikes don't happen in the different demo scenes. This is the benchmark scene profile:
[attachment=71]
Is this just a symptom of having a weak processor?
I have a AMD 6300 Six-Core Processor
I am also using Unity 2017.3.0f3
Is there some other way to prevent these performance spikes from happening? Or am I out of luck?
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(30-01-2018, 05:44 PM)salvetori Wrote: Hello,
I've been having an issue where every few seconds I will encounter a massive momentary drop in performance. In this scenario the cloth I am simulating is following the character cloth setup from the documentation, and is currently not colliding with anything. The solver is using the default settings save for having the simulation space set to local and having the simulation order set to late update. The cloth being simulated has thickness, with self collisions enabled. However, enabling a cloth proxy or not didn't seem to have an effect on this performance spike happening. I also tested simply disabling every single constraint and that also did not seem to have an effect.
I followed some of the pointers found in this thread: http://obi.virtualmethodstudio.com/forum...d-200.html
Unfortunately these didn't change the outcome.
The demo scenes that come with obi cloth perform fine and I don't encounter this issue in those demo scenes, particularly in the character cloth scene that I am trying to emulate.
I am not really sure what is going on so I'd appreciate some help. Let me know if you guys need more info.
Hi Salvetori,
It is pretty hard to tell what's happening just from a profiler pic, specially since it is not in deep profiling mode. Would it be possible for me to take a look at your scene? You can send it to our support email: support(at)virtualmethodstudio.com
On a side note though, having a thick cloth mesh with self-collisions enabled is a recipe for low quality simulation and low performance. If possible, you should use a proxy to simulate only the inner layer of cloth and drive the outer layer.
Posts: 8
Threads: 1
Joined: Jan 2018
Reputation:
0
(30-01-2018, 10:40 PM)josemendez Wrote: Hi Salvetori,
It is pretty hard to tell what's happening just from a profiler pic, specially since it is not in deep profiling mode. Would it be possible for me to take a look at your scene? You can send it to our support email: support(at)virtualmethodstudio.com
On a side note though, having a thick cloth mesh with self-collisions enabled is a recipe for low quality simulation and low performance. If possible, you should use a proxy to simulate only the inner layer of cloth and drive the outer layer.
Thanks for the reply Jose, I'll send an email with the scene.
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
31-01-2018, 12:15 AM
(This post was last modified: 31-01-2018, 12:15 AM by josemendez.)
(30-01-2018, 11:05 PM)salvetori Wrote: Thanks for the reply Jose, I'll send an email with the scene.
Hi Salvetori,
After taking a look at your scene, I determined that the cause are sudden spikes in the GC collector. This is because your character's skeleton has many more bones than the one in the sample scene, and generates a lot more garbage for the GC to collect periodically.
Luckily, there's a way to reduce the amount of garbage generated when retrieving the bones from Unity. Replace line 577 of ObiCloth.cs:
Code: for (int p = 0; p < sharedMesh.bindposes.Length; ++p){
with this one:
Code: for (int p = 0; p < rendererBones.Length; ++p){
That should fix the issue.
Posts: 8
Threads: 1
Joined: Jan 2018
Reputation:
0
(31-01-2018, 12:15 AM)josemendez Wrote: Hi Salvetori,
After taking a look at your scene, I determined that the cause are sudden spikes in the GC collector. This is because your character's skeleton has many more bones than the one in the sample scene, and generates a lot more garbage for the GC to collect periodically.
Luckily, there's a way to reduce the amount of garbage generated when retrieving the bones from Unity. Replace line 577 of ObiCloth.cs:
Code: for (int p = 0; p < sharedMesh.bindposes.Length; ++p){
with this one:
Code: for (int p = 0; p < rendererBones.Length; ++p){
That should fix the issue.
That did reduce the spikes in garbage collection, but unfortunately other spikes are still occurring.
I enabled deep profile and took a few screenshots.
[attachment=72]
[attachment=73]
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
31-01-2018, 10:18 AM
(This post was last modified: 31-01-2018, 10:23 AM by josemendez.)
(31-01-2018, 01:47 AM)salvetori Wrote: That did reduce the spikes in garbage collection, but unfortunately other spikes are still occurring.
I enabled deep profile and took a few screenshots.
Hi Salvetori,
I'm no longer able to reproduce the issue. There are no spikes whatsoever in my profiler, and Obi never takes longer than 1.5-2 milliseconds per frame, most of the time is spent waiting for vsync (see pic). Could you share your physics settings (fixed timestep, max fixed timestep, etc)? Also, what computer are you running this on?
Posts: 8
Threads: 1
Joined: Jan 2018
Reputation:
0
Hi Jose,
Thanks for the reply. Here is the info you asked for.
My System Spec:
GeForce GTX 660
AMD 6300 Six-Core
12GB Ram
Physics settings:
fixed timestep: 0.02
max timestep: 0.3333333
time scale: 1
max particle timestep: 0.1
Posts: 8
Threads: 1
Joined: Jan 2018
Reputation:
0
(31-01-2018, 10:18 AM)josemendez Wrote: Hi Salvetori,
I'm no longer able to reproduce the issue. There are no spikes whatsoever in my profiler, and Obi never takes longer than 1.5-2 milliseconds per frame, most of the time is spent waiting for vsync (see pic). Could you share your physics settings (fixed timestep, max fixed timestep, etc)? Also, what computer are you running this on?
Bump. Haven't seen a reply in a few days, just wanted to make sure you saw it.
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(04-02-2018, 05:53 PM)salvetori Wrote: Bump. Haven't seen a reply in a few days, just wanted to make sure you saw it.
Hi Salvetori,
I did, I've been trying to find the cause. Unfortunately I'm not able to reproduce the issue (using the project you sent me) in any computer I've tried (a 2-core macbook air, a 4-core mac pro, a 32 bit 2-core pc and a 64 bit 4-core pc). There are no noticeable spikes in any of them so I'm at a bit of a loss regarding what could be causing them for you.
Some people on the internet have been complaining about random CPU usage spikes in AMD FX cpus. I highly doubt this is your case, but since I'm unable to get anything remotely similar to happen I must ask: have you noticed similar behaviour when running other CPU demanding tasks?
Posts: 8
Threads: 1
Joined: Jan 2018
Reputation:
0
(05-02-2018, 10:15 AM)josemendez Wrote: Hi Salvetori,
I did, I've been trying to find the cause. Unfortunately I'm not able to reproduce the issue (using the project you sent me) in any computer I've tried (a 2-core macbook air, a 4-core mac pro, a 32 bit 2-core pc and a 64 bit 4-core pc). There are no noticeable spikes in any of them so I'm at a bit of a loss regarding what could be causing them for you.
Some people on the internet have been complaining about random CPU usage spikes in AMD FX cpus. I highly doubt this is your case, but since I'm unable to get anything remotely similar to happen I must ask: have you noticed similar behaviour when running other CPU demanding tasks?
Thanks for the reply Jose.
I can't say that I've noticed this behaviour elsewhere, but it wouldn't really surprise me that my CPU was the issue in this case, especially if you are unable to reproduce the problem on all of those systems. Perhaps it is time for an upgrade?
|