VR FPS drop 22.0.1

VR FPS drop 22.0.1

paulino_smh
Not applicable
21 Views
15 Replies
Message 1 of 16

VR FPS drop 22.0.1

paulino_smh
Not applicable

[ FlexSim 22.0.1 ]

Hello everyone,

I have experienced a substantial FPS drop when using the latest software version (22.0.1) with respect to the current LTS software version (21.0.10) while using "VR Mode".

For testing purposes I've created two basic models following the same procedure in both of them:

  1. Set default preferences (File -> Global Preferences -> Reset All Preferences).
  2. Show FPS (File -> Global Preferences -> Graphics -> Show FPS Counter).
  3. Create blank model with default Model Units.
  4. Activate "VR Mode".

With the LTS version FPS remains above 100 as can be seen in the following image:

fps-21010.png

But with version 22.0.1 the FPS value moves around 60 (it feels more laggy), which can be a problem especially considering that this model is empty:

fps-2201.png


Do I have to enable some feature that I have forgot about in this new version or is this the expected behaviour ?

___________________________________________________________________

Additional information:

  • Headset: Valve Index
  • About FlexSim:

aboutflexsim.png

___________________________________________________________________


Thanks in advance,

Best regards.

0 Likes
Accepted solutions (1)
22 Views
15 Replies
Replies (15)
Message 2 of 16

philboboADSK
Autodesk
Autodesk
Accepted solution

It is possible that something that changed between 21.0 and 22.0 is causing the 3D rendering path to be slower on your system now than it was before. It could likely be related to the changes to the manipulation handles or the view frustum culling introduced in FlexSim 21.2.

I tried to replicate the issue on my system, but I was unable to reproduce the problem. I'm getting the same framerate in 21.0 and 22.0 in VR Mode in an empty model and in a large model that is purposefully bottlenecked by the amount of graphics to render (2000 processors in a model). My tests were done with an Oculus Quest headset on an Nvidia Geforce RTX 2080 Ti with an Intel Core i7-4790K CPU though, so it is possible that the bottleneck is happening somewhere on your system that isn't bottlenecked on mine.

It is possible that it is a setting in Steam that's treating different versions of FlexSim differently, but it is more likely a change on the FlexSim side. I need to reproduce the issue though in order to determine what exactly is causing it. Otherwise, it is just blindly guessing. If there are settings in SteamVR, you could try messing with those to determine if maybe it is somehow treating the different FlexSim versions differently, but I doubt it is.

My best guess is that the rendering on your system is CPU-bound and mine is not, and that in 22.0, our graphics pass is requiring more CPU processing than before, so your framerate is decreasing with that increased CPU load, but on my PC, it isn't CPU-bound so I'm not seeing the fps drop between versions. Perhaps my CPU can handle the load in either version and I don't see a fps drop until I add enough stuff to bottleneck the GPU, which is slowing down at the same point in both versions.

I will try to reproduce the issue with a weaker machine on a Vive headset to see if I can reproduce the issue that way.

If anyone else in the community that uses VR could also test the performance of FlexSim 22.0 vs 21.0 and report back their results and their hardware configuration (headset type, CPU info, GPU info), that may be helpful in narrowing down and reproducing this performance issue. I'll see what I can do on my own with the various headsets and hardware in our office though.



Phil BoBo
Sr. Manager, Software Development
Message 3 of 16

philboboADSK
Autodesk
Autodesk

Searching around about Valve Index performance issues and settings, I found various references to SS (super sampling) levels and Motion Blurring.

PSA: Try a lower frame rate!!! : ValveIndex (reddit.com)

Performance Valve Index with different SS ratios - Virtual Reality and VR Controllers - IL-2 Sturmov...

Based on those pages and the fact that the Valve Index is a 120 Hz headset, it is possible that something in the SteamVR settings is actually causing the difference. It is possible that it is purposefully halving the framerate and kicking on motion smoothing because your system can't keep up with 120 FPS.

I don't have a Valve Index to test with directly right now, but you might be able to try various settings in Steam to see if those make a difference.

If I can't replicate the issue to determine what is happening on the FlexSim side in my tests, then the best course of action may be to get a machine with a better CPU if you can't find settings in SteamVR that are causing or fix the issue.

It seems to me that a Valve Index should be rendering a blank model at 120 FPS regardless of the FlexSim version, and if it isn't, then your system is likely CPU-bound, and you really should be running VR on a better CPU.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 4 of 16

paulino_smh
Not applicable

Hi @Phil BoBo and first of all thank you for the quick response,

I did some more tests but I couldn't reach 120fps on any of the two FlexSim versions.

I also run the tests on another PC with better CPU and GPU but I get the same results. However I don't think the PC that I'm currently using is CPU-bound, it can reach 120Hz nicely on other applications, so it must be something directly related to Valve Index and FlexSim. As you can see in the following images the CPU is not heavily loaded:

FlexSim 21.0.10 (~100fps):

21010-resources.png

FlexSim 22.0.1 (~60fps):

2201-resources.png


The FlexSim profile in SteamVR is the same for both versions of the program.

I have even tried with a low-end profile but the problems don't disappear:

steamvr-flexsim-lowprofile.png


The only think that worked was lowering the FPS in SteamVR from 120Hz to 90Hz as you suggested. This way I can reach a stable value of 90 fps as you can see in the following image:

90hz-ok.png


With 90 fps the VR experience is nice and usable but it would be better if we could push our hardware to the limit improving the user experience.

As you pointed out the problem is not directly related with Flexsim version 2022, I have been able to replicate the same problem in FlexSim 2021 Update 2.
With FlexSim 2021 Update 1 I reach over 100 fps so it could be something related to the changes you talked about. Do you think that the features introduced in this version could produce this behaviour? Could FlexSim have a software upper fps limit?

If the answer is yes, could any FlexSim parameter be changed to solve it?


Thank you in advance,

Best regards.

0 Likes
Message 5 of 16

philboboADSK
Autodesk
Autodesk

You have a 6-core CPU. Maxed out single threaded performance is 16.6%.

Based on those screenshots, your framerate in FlexSim is CPU-bound, and FlexSim 22.0 doing more CPU processing per frame than FlexSim 21.0 is probably what is causing your framerate to be lower.

That's good information to know. I'll see what I can do to replicate the issue and see what FlexSim is doing in the draw pass that's taking so much CPU time.

By default, the 3D view only invalidates and repaints when you move it. When VR Mode is enabled and the simulation is not running, the 3D view invalidates itself with a ticker every 8.3 milliseconds for a 120 fps framerate. If you push the Run button so that FlexSim starts processing events and repainting continuously (even in an empty model), then it will repaint as fast as the OS and display will let it, unbounded.

It is possible that something about the ticker isn't keeping up with 120 fps, but it is more likely that each draw pass is taking more than 8.3 milliseconds because of CPU processing.

With changes in the Steam setting, are you getting 90 FPS in version 22.0 or just in version 21.0?



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 6 of 16

paulino_smh
Not applicable

Summary:

  • LTS release before pressing Run button (blank model): ~100fps.
  • After 2021 Update 2 and before pressing Run button (blank model): ~60fps.
  • If I change frequency from 120Hz to 90Hz in SteamVR both versions reach a stable value of 90Hz.

The behaviour in the LTS version was as expected, if it can reach 100fps (headset set at 120Hz) it should have no problem going down to 90fps and that is what is happening.
In the case of the newer versions the behaviour was not as expected, if the system is CPU limited when headset is set at 120Hz reaching a value of ~60fps it should not change when set at 90Hz, but in this case the fps value goes up to 90fps.

In all these situations the overall system performance as can be seen in the task manager are far from the limit and it looks like a software limitation rather than a hardware limitation.

The task manager while running VR on FlexSim 2022 with the ~60fps limit that appears when headset is set at 120Hz:

taskmanager-flexsim22-60fps.png

The task manager while running VR on FlexSim 2021 with the ~100fps limit that appears when headset is set at 120Hz.
taskmanager-flexsim21-100fps.png

Based on this, the hardware seems to be able to do more work that the software is asking for, so both versions of flexsim should reach 120fps without much trouble in this scenario.

----------------------------------------------------------------

New tests after pressing RUN button:

As you suggested I test the system performance after pressing Run button on the blank model.

Under this conditions all flexsim versions reach a value between 70 and 75 fps:

  • With 90fps or above before pressing the button, it goes down to [70-75] fps after pressing it.
  • With 60fps before pressing the button (newer versions of flexsim with 120Hz set in SteamVR), the value goes up to [70-75] fps after pressing it.

After looking at the task manager I could see that this time the system was CPU limited like you said before:

  • FlexSim LTS.

    flexsim21-90h-resources-afterplaybtn.png
    flexsim21-120h-resources-afterplaybtn.png
  • FlexSim 2022.

    flexsim22-90h-resources-afterplaybtn.png
    flexsim22-120h-resources-afterplaybtn.png


As can be seen in those images FlexSim seems to be loading the vast majority of the work on a single logical processor instead of spreading it across all of them on my system, that seems to be the reason that my tests with the other PC with better CPU was giving the same results (it was an RTX A6000, which shows better multithread performance but single thread performance is similar).

----------------------------------------------------------------

Conclusion:

I know the computer I'm using is not the best option in the market right now but I expected better performance with its specs: intel i7-6800K, NVIDIA GeForce GTX 1080, 32GB of RAM.

It would be nice to reach 90fps or more to improve the user experience with this headset. Do you plan to split the work between threads on a system like this one or should we consider upgrading? If so, what system requirements do you propose to reach a value closer to 120fps?

However, before pressing the Run button the system should perform better, and it would be nice to allow the user move around at higher fps. It would be much appreciated if you could find out what is happening.


Thank you in advance for your great support.

0 Likes
Message 7 of 16

jason_lightfootVL7B4
Autodesk
Autodesk
Have you considered overclocking the CPU since it is unlocked? Decent cooling should see you get around 4.5Ghz, or higher if you're lucky with your core temps and memory controller.
0 Likes
Message 8 of 16

philboboADSK
Autodesk
Autodesk

Multi-threading doesn't help with the frame rate of a single 3D view rendering to a single display, as is the case that we are discussing in terms of VR performance in FlexSim.

Perhaps this diagram that explains v sync might help me explain:

1646956406544.png

(From missed-vsync.png (1562×534) (fragmentbuffer.com))

Each draw pass, FlexSim does some calculations on the CPU (e.g., traversing through each object in the screen and getting its position) and passes data down to the graphics card to process on the GPU (e.g., calling a vertex array object to draw a mesh of triangles in a particular location).

If the CPU processing takes longer than the GPU processing for that frame, then the framerate is CPU-bound. If the GPU processing takes longer, then it is GPU-bound.

The size of each bar is a combination of what is configured in your model and the power of your hardware. It isn't simply a "hardware" vs "software" limitation. The single-threaded clock speed of your CPU multiplied by the amount of CPU calculations that FlexSim does during the draw frame is what determines the size of the green bar. How amazing the multithreaded performance is, or how new the CPU is, or how expensive the CPU is does not matter in terms of 3D view framerate. What matters is the amount of processing that FlexSim does times the speed the CPU can do that processing.

So given that we're discussing rendering just the grid in the model, then the GPU side is nearly empty and any framerate drops are likely caused by the CPU processing portion of the draw pass. Thus, we are talking about a framerate that is CPU-bound. That doesn't mean that it is a hardware problem instead of a software problem. It means that the combination of the amount of software CPU calculations requested times the speed that the hardware CPU can process those requests is affecting the framerate. This is the hypothesis based on the results reported by you, which I can only confirm if I can replicate those results. Once I can confirm the cause of the framerate drop, then I can determine how to address that problem. This is what we are trying to accomplish. So far I've been unable to replicate your results so I have been giving you additional information and asking additional questions to help me understand what you are seeing so that I can replicate it in order to determine how to best resolve it.

In my previous tests, I was using a 4.0 GHz CPU that is designed for maximizing this type of gaming 3D rendering work. A lower clock speed CPU with lots of cores may be better for other types of processing work, such as running experiment replications or executing JavaScript on multiple tabs in a web browser, but when we are talking about the 3D framerate in VR in FlexSim, then the single-core clock speed is the most important metric of the CPU hardware.

Between my previous comment and now, I have done additional tests on more hardware. I tested on a laptop with a 2.8 Ghz processor with a Geforce 965M graphics card and an HTC Vive headset. I also did some tests on a 244 Hz monitor to investigate further.

I have still not replicated any significant difference between FlexSim 21.0 and 22.0 in terms of framerate. I still cannot answer why you are getting different results between those versions, as I have been unable to get different results between those versions on the 3 very different systems that I tested.

Given that your system handles 90 FPS in both FlexSim 21.0 and 22.0, then I hypothesize that Steam is what is halving the framerate in 120 Hz mode down to 60. Why it is behaving differently between 21.0 and 22.0, I cannot tell. Many graphics features (such as v sync, g sync, asynchronous spacewarp, motion smoothing, etc.) default to halving the framerate if they cannot reach the desired framerate (as shown in the image above, the last blue bar missed its mark and will be moved to the next dashed black line, thus halving the framerate). So it makes sense that if the processing of each frame tops out at ~100 FPS, that it would drop that down to 60 FPS in order to enable something like motion smoothing. I cannot explain why that would be happening with FlexSim 22.0 but not FlexSim 21.0 because I cannot reproduce that behavior. But given that both are handling 90 FPS, then the actual processing on the FlexSim side is likely the same between the versions, and something in Steam is treating them differently.

What I can reproduce is the Quick Properties window absolutely massacring the framerate because of the amount of CPU processing it requires when it is open. On my 244 Hz monitor, I got 240 FPS easily as long as Quick Properties was closed, and if I opened Quick Properties, then the framerate got clobbered down to below 60 FPS.

Thus, if your goal is to maximize your VR framerate instead of your goal being to determine what is different between FlexSim 21.0 and 22.0, then my suggestion is to add a custom toolbar button (File > Global Preferences > Customize Toolbar) that enables VR Mode instead of using the checkbox in Quick Properties. This way, you can close all the views other than a single 3D view in order to minimize the amount of CPU processing that FlexSim is doing during a draw pass. Below is a code snippet that you can execute from a script window or a custom toolbar button that will enable or disable VR Mode without Quick Properties:

treenode view = activedocumentnode();
if (get(viewwindowtype(view)) != VIEW_TYPE_3D)
return 0;

int vrmode = getvarnum(view, "vrmode");
applicationcommand("switchviewvrmode", view, !vrmode);

vrmode = applicationcommand("switchviewvrmode", view, -1);
setvarnum(view, "vrmode", vrmode);

if (vrmode) {
// force first-person mode
int firstPerson = get(viewfirstperson(view));
if (!firstPerson) {
double rz = get(viewpointrz(view));
double rx = get(viewpointrx(view));
double x = get(viewpointx(view));
double y = get(viewpointy(view));
double radius = get(viewpointradius(view));
double height = sin(degreestoradians(-1 * rx)) * radius;
double dist = cos(degreestoradians(-1 * rx)) * radius;
double locx = x + cos(degreestoradians(-90 + rz)) * dist;
double locy = y + sin(degreestoradians(-90 + rz)) * dist;
set(viewpointradius(view), height);
set(viewpointx(view), locx);
set(viewpointy(view), locy);
set(viewfirstperson(view), !firstPerson);
}
// look at the horizon (so that the world doesn't seem slanted)
set(viewpointrx(view), 0);
}

Try that and see whether you can achieve the 120 FPS that you desire, as I believe that's your actual goal rather than determining what changed between FlexSim 21.0 and 22.0, which I have been unable to determine.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 9 of 16

paulino_smh
Not applicable

Thank you for the explanation. I have been able to confirm that the properties panel was the reason why the frames were so low. By closing the panel and pressing the Run button I can reach 120fps and even 144fps If I set SteamVR to 144Hz:

flexsim-144hz-afterrunbtn.png

The only weird thing now is that if I click the Stop button the frames goes back to ~60, even when the properties panel is closed:

backto60afterstopbtn.png

However I point this out just to report the issue, it's not a big problem for me right now as I can hit the run button before using the headset but it would be nice to reach those fps even if the model is stopped (I'll keep testing with SteamVR options and let you know if I find something).

I'll accept your answer because my original problem is solved, ask me if you want to perform additional checks.

Best regards and thank you again for the support.

0 Likes
Message 10 of 16

paulino_smh
Not applicable

Overclocking would be the last option, I'm working on a shared computer and don't want to risk breaking anything but thanks for the idea.

0 Likes
Message 11 of 16

philboboADSK
Autodesk
Autodesk

Using the tree view, try changing line 71 of VIEW:/standardviews/documentwindows/Perspective>eventfunctions/OnPreDraw from 120 to 150:

1647010351942.png

Then close all your views, open only a 3D view, and enable VR Mode with the model stopped.

Let me know whether that works to get 120/144 FPS in the Valve Index.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 12 of 16

paulino_smh
Not applicable

Hello @Phil BoBo

I have changed the value to 150:

60fpsafter150change.png

After the change nothing happens.
I get ~60fps when all panels are closed and the model is stopped.

60fpsafter150changewithoutpanels.png

And it goes back to 120/144Hz when all panels are closed and I press the Run button:

120fpsafterpressingrun.png

However, I dont know if I'm doing something wrong in applying the changes. I opened the script you told me, changed the value and ran the test. Are the changes automatically saved for the current session or do I have to do something else to save it? If I save and close the model the next time I open it the value is 120 instead of 150.

0 Likes
Message 13 of 16

philboboADSK
Autodesk
Autodesk

The VIEW:/standardviews node contains the data that views are generated from when they are created. By changing the value in the tree, any 3D views opened afterwards will have the updated code. That's why you need to close and reopen the views after making the change.

If you close and reopen the FlexSim application, then it will reload the original values for all the data in the VIEW tree. The Module SDK is used to make changes to the view tree that persist between sessions.

Did you close the 3D view after making the change? Close all the views and then reopen just a single 3D view with the changed code.

If changing the value to 150 works to get the desired framerate, then I'll change the defaults from 120 to 150. Otherwise, I'll need to replicate the issue myself in order to figure out why it is still only getting 60 FPS. Maybe the ticker repaint mechanism is being limited by the framerate of the monitor instead of the headset.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 14 of 16

paulino_smh
Not applicable

Steps followed:

  1. Changed the requested value to 150.
    1-tickspersecond-vrmode-150.png
  2. All views closed.2-allviewsclosed.png
  3. 3d Model View opened.
    3-open3dmodelview.png
  4. VRMode executed through the custom button we added earlier.
    4-enablevrmodewithcustombutton.png


After following all the steps the stopped model fps is still ~60. Once again I can reach 120/144Hz after pressing the Run button.

0 Likes
Message 15 of 16

philboboADSK
Autodesk
Autodesk

K. Good to know. Thanks for testing that.

If you want unbounded FPS, use the run button for now. You can set the simulation speed to 0 if you don't want to process any simulation events.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 16 of 16

paulino_smh
Not applicable

Alright, I accept the answer for now, if you need to perform additional checks to solve the problem you can ask me.

Thanks for the support.

0 Likes