-
Notifications
You must be signed in to change notification settings - Fork 636
Add a pending loaded model cache to fix livelock issue #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a pending loaded model cache to fix livelock issue #825
Conversation
Signed-off-by: Thomas Sedlmayer <[email protected]>
Signed-off-by: Thomas Sedlmayer <[email protected]>
3a6f478 to
d75225c
Compare
|
@luluiz this is an important fix for the Simulation departmemt. |
|
Hey @thomassedlmayer I've tried to use the Even so I tested your PR with the |
|
Did you install the plugin? https://github.com/lichtblick-suite/asam-osi-converter |
Yes, I have it installed |
|
@ctw-joao-luis Do you see something when you open the file without the changes of this PR (e.g. latest lichtblick release)? You should see this road starting at (0,0) expanding towards positive x:
Did you try to uninstall the extension and install it again, then do a reload? I noticed that sometimes there are issues when installing an extension over an already installed version. Did you use the latest asam-osi-converter version? Does it show any available frame transforms? Does it show any data in the raw panel? Otherwise, I don't have any clue why this doesn't render properly for you. I tested the file on different OS's and machines and it works for me every time without issues. |
So I was able to make it work, I had 2 different version of the ASAM OSI extension installed and I think that was where the problem was coming from. And yeah with that mcap the performance increase, especially not decreasing overtime, is tremendous. Good job! |
ctw-joao-luis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
1dfe923
into
lichtblick-suite:develop


This PR tackles a livelock issue that appears when the same ModelPrimitive is passed in multiple consecutive frames again and again. When the render performance is already bad, models are never actually rendered until freeing the load by pausing the playback.
What seems to happen is that the asynchronous loading of models aborts before updating the renderable list when there was received a more recent frame in the meantime. This makes sense because the renderable list of the next frame shouldn't be updated in that case. But before aborting, it performs the actual loading of the model which is then just discarded. In our use case this leads to an even worse render performance and certain models are never being shown even though they actually stay "static" (same data, same position etc.) once they appear. Once they are loaded, the model cache works and the model is reused from then on. But if it's never loaded, it is never being displayed and in every single frame it loads it but then discards it.
So I added some kind of "pending loaded model cache" which stores a loaded model for the case that it might be needed in the succeeding frame. If the rate of incoming frames is very high, there will still be some redundant tries of loading the model but at least it ends once one process has finished loading.
There are also some other slight changes in the updateModels function which only tackle readability. I thought, it might be easier to understand the code if we rename
renderabletoreusedRenderableas it is only assigned if it can be reused.I append an example mcap which can be viewed using the asam-osi-converter. The issue should appear even on better hardware when increasing the playback speed. On my laptop it starts to show on 2x speed. It starts to slow down more and more and never comes back to normal speed until pausing the playback.
many_traffic_lights.zip