Board index FlightGear Support Graphics

Multithreading question

Graphics issues like: bad framerates, weird colors, OpenGL errors etc. Bad graphics ar usually the result of bad graphics cards or drivers.
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- what graphics card do you have?
- does the problem occur with any aircraft, at any airport?
- is there any output printed to the console (black window)?
- copy&paste your commandline (tick the "Show commandline box on the last page of FGRun or the "Others" section on the Mac launcher).
- please upload a screenshot of the problem.

If you experience FlightGear crashes, please report a bug using the issue tracker (can be also used for feature requests).
To run FlightGear on old computers with bad OpenGL support, please take a look at this wiki article. If you are seeing corrupted/broken textures, please see this article.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

Multithreading question

Postby fatty » Mon Mar 08, 2021 4:27 pm

Hi,

I've been running into an odd issue while using the multithreading mode "CullThreadPerCameraDrawThreadPerContext". Usually, this threading mode offers the best performance. I can get 20-30 fps in an urban area with all shaders maxed and osm2city enabled. However, sometimes one of the threads appears to "cut out", and performance drops to 10-12 fps. In this screenshot, the times when the cpu utilization drops (one thread goes from 100% to almost 0% cpu) is when the performance hit happens. Image

This is on Linux using latest git, Nvidia GTX 1060 6gb, xeon 5687. I know the processor is old but it usually does just fine. Any ideas?
fatty
 
Posts: 202
Joined: Sat Jan 13, 2007 4:41 am
Location: Pennsylvania, U.S.

Re: Multithreading question

Postby Hooray » Mon Mar 08, 2021 5:05 pm

To learn more about FlightGear's performance it would make sense to run fgfs inside a profiler session (e.g. oprofile)

There is also built-in support for google perftools: https://wiki.flightgear.org/Built-in_Profiler

On a recent, nvidia-based, system you can get pretty fine-grained performance details using nvidia nsight (free), there you will see that the Nasal scripting interpreter and in particular its GC (garbage collector) can have quite a significant impact

Image
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Multithreading question

Postby fatty » Tue Mar 09, 2021 2:37 pm

Thank you for the suggestion, I absolutely will give that a try to get some better information.

After a little more experimentation, it seems like the thread that is cutting in and out is the one responsible for generating scenery objects. I wondered why the performance was dropping so much when it cut out, and I think I have an answer. I tried running a script to occupy one core of the processor at 100%, and with this script running, the performance in the sim did not drop when the thread cut out. I'm guessing that having one core at 100% utilization causes the cpu to boost the clockspeed.
fatty
 
Posts: 202
Joined: Sat Jan 13, 2007 4:41 am
Location: Pennsylvania, U.S.

Re: Multithreading question

Postby Hooray » Tue Mar 09, 2021 5:06 pm

Note that you can tell OSG to use additional pager threads (it's just an environment variable, run a forum/wiki search)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Multithreading question

Postby fatty » Wed Mar 10, 2021 4:57 pm

Interesting! I did find the forum discussion on that. I'll try that out as well.
fatty
 
Posts: 202
Joined: Sat Jan 13, 2007 4:41 am
Location: Pennsylvania, U.S.

Re: Multithreading question

Postby Hooray » Wed Mar 10, 2021 6:33 pm

Note that there are a few more built-in tools available to help better understand FlightGear's performance:

https://wiki.flightgear.org/OSG_on_screen_stats
Image

There's also a built-in performance monitor (also see the debug menu).
The former will display all sorts of rendering stats, whereas the latter will basically sample the majority of FlightGear subsystems and provide an overview concerning the runtime of each system compared to others (per frame)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Graphics

Who is online

Users browsing this forum: No registered users and 5 guests