Board index FlightGear Support Graphics

ATI on Linux: low framerate becauseGPU and CPU are not maxed

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.

ATI on Linux: low framerate becauseGPU and CPU are not maxed

Postby daviessm » Sat Aug 02, 2014 7:22 pm

Split from http://forum.flightgear.org/viewtopic.php?f=37&t=22309 because that thread seemed to diverge.

Using a Radeon HD 5870 on Linux with either Catalyst or open source/mesa drivers I'm getting the below problem:

Using the minimal configuration I get about 580fps (and the graphics card isn't highly taxed) but when turning normal settings on - as far as I can tell, regardless of anything in the rendering dialogue box, the frame rate slows down to about 55fps when using a 'real' aircraft in a 'real' location. At this point the graphics card is showing 0-25% GPU usage through aticonfig, and top is showing that none of my four CPU cores are being used above 50% regularly.

What's really interesting is that if I bring the 777-200's main centre console display into view, I lose at least 20fps. The CPU usage and GPU usage don't change. The c172p always runs at about 55fps at EGNX, 35fps at KSFO.

    OS: Linux (Gentoo)
    FlightGear version: 3.0.0
    Graphics card: ATI Radeon HD 5870
    CPU: Intel Core i5-4690
    Console output: None
    Any airport/aircraft: Yes, although detailed airports such as KSFO mean lower frame rates.

Command line:
Code: Select all
--prop:/sim/rendering/multi-sample-buffers=1
--prop:/sim/rendering/multi-samples=2
--airport=EGNX
--runway=09
--prop:/sim/rendering/multithreading-mode=DrawThreadPerContext
--timeofday=noon
--enable-horizon-effect
--enable-specular-highlight
--enable-ai-models
--enable-clouds3d
--shading-flat
--fog-nicest
--enable-random-objects
--prop:/sim/rendering/random-vegetation=true
--prop:/sim/rendering/precipitation-enable=true
--enable-terrasync


I remove the autosave file before each run to ensure a fair test.

Screenshot from c172p at KSFO:
Image

Screenshot from 777-200 at EGNX:
Image

Can anyone point me in the right direction to find enough information to troubleshoot this?

Thanks :)
daviessm
 
Posts: 6
Joined: Tue Jul 15, 2014 6:39 pm

Re: ATI on Linux: low framerate becauseGPU and CPU are not m

Postby Hooray » Sat Aug 02, 2014 8:04 pm

Hi & welcome !

Kudos, you really seem to have done your homework here - and structured your introductory posting pretty well !

So what exactly is your problem ?
Is that already an optimized build you're using there ?

In general, those numbers seem about right to me - FlightGear isn't a particularly optimized piece of software unfortunately - mostly due to lack of feedback, i.e. lack of involvement from end-users willing to test & troubleshoot things. You could adjust FlightGear's OSG threading mode to see if that makes a difference: http://wiki.flightgear.org/Howto:Activa ... PU_support

And have you used this: http://wiki.flightgear.org/Howto:Use_the_system_monitor ?

But otherwise, there's very little that you can do without using more involved tools, like the built-in profiler: http://wiki.flightgear.org/Built-in_Profiler
And even that will typically involve building from source: http://wiki.flightgear.org/Building_FlightGear

If you have already built from source, you should ensure that your build is using the optimized profile, because debug builds are usually non-optimized, as per: http://wiki.flightgear.org/Building_usi ... bug_Builds

On Linux, I'd suggest to also disable all OpenGL related "effects" (compositing), or even use a dedicated, more lightweight, window manager like XFCE or LXDE.

In general, I tend to suggest to also compare fgfs performance with fgviewer/osgviewer performance to get a better idea of what's technically possible, and what may be due to FlightGear's "architecture", which still is very much 90s style unfortunately - and not yet very good at making good use of all CPU/GPU resources in a sense that saturation and performance are optimized for both ... but if you're CPU or GPU-limited depends heavily on your startup/run-time settings, as well as your actual hardware.
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: ATI on Linux: low framerate becauseGPU and CPU are not m

Postby daviessm » Sat Aug 02, 2014 9:03 pm

Hello!

To answer your questions...

The "problem" is that I would expect the GPU or the CPUs to be running at 100% to achieve the best frame rate. Not doing so would logically suggest there are code paths that are waiting for other things to happen and that the system isn't running to its full potential. It's fully usable as it is, but higher numbers would impress my friends more. 8)

I'm running Gentoo Linux so the program was already built from source although I don't know about optimised. Debug appears to be disabled so I don't think the debug symbols are compiled in.

The multithreading-mode is set to DrawThreadPerContext as that seemed to work the best when I was looking into this the first time.

I have used the system monitor but didn't see anything glaringly obvious - there are some screenshots below though.

I just tested with no window manager at all: an xsession with just fgfs running and that gained me ~1.5fps. Which is something but not really significant.

Now, you may be in luck. By day I'm a software developer and have used things like gdb and valgrind in the dim and distant past. When I get some time (and motivation!) I'm willing to test stuff, profile stuff and maybe even tweak stuff if someone would like to point me in the best direction to start doing that kind of thing.

Anyhow here are the screenshots:
ImageImage
Last edited by Gijs on Sat Aug 02, 2014 9:06 pm, edited 1 time in total.
Reason: No useless quoting please. Use the "Reply" button instead.
daviessm
 
Posts: 6
Joined: Tue Jul 15, 2014 6:39 pm

Re: ATI on Linux: low framerate becauseGPU and CPU are not m

Postby Hooray » Sat Aug 02, 2014 9:16 pm

By day I'm a software developer and have used things like gdb and valgrind in the dim and distant past. When I get some time (and motivation!) I'm willing to test stuff, profile stuff and maybe even tweak stuff if someone would like to point me in the best direction to start doing that kind of thing.


Well, we've been working towards making more subsystems optional and better configurable, so that run-time "feature-scaling" and "profiling/benchmarking" can be supported at some point.

Recently, a lot of progress has been made in this area via the "FGCanvas" effort - part of this will also involve providing an optional "standalone" canvas mode, where other -unneeded- subsystems are dynamically disabled, such as scenery/terrain, sound, AI etc - the whole idea here is to test individual combination of such "subsystem profiles" and get less "noisy" (cluttered) profiling/valgrind information for certain subsystems.

"FGCanvas" is really just the motivator here, and it's just one manifestation of this work: http://wiki.flightgear.org/FGCanvas

Another long-term effort in this area is the so called "headless" mode, where the GUI/viewer etc. will be completely disabled, i.e. for better regression testing: http://wiki.flightgear.org/FlightGear_Headless

Most of this became recently possible due to the reset/re-init work by FG core developer Zakalawe: http://wiki.flightgear.org/Reset_%26_re-init

What I have been working towards is initializing the scripting interpreter earlier, so that the whole initialization process can be -optionally- scripted, analogous to *nix "Run Levels": http://wiki.flightgear.org/Initializing_Nasal_early

Overall, the mid-term idea here is to hopefully make GUI front-ends like fgrun obsolete for the most common use-cases: http://wiki.flightgear.org/Aircraft_Center

Before you get started with core development, you may want to check out: http://wiki.flightgear.org/Howto:Start_core_development

The really long-term idea is to increasingly modularize FlightGear using the High-Level-Architecture: http://wiki.flightgear.org/High-Level_Architecture
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: ATI on Linux: low framerate becauseGPU and CPU are not m

Postby daviessm » Mon Aug 04, 2014 8:09 pm

That sounds good. :) For the moment, as a new user, I'm going to keep playing and using the sim before I have a look at any of the code. However when the time comes I know who to ask for help!

Do the screenshots above look relatively normal? Nothing obviously out of the ordinary?
daviessm
 
Posts: 6
Joined: Tue Jul 15, 2014 6:39 pm

Re: ATI on Linux: low framerate becauseGPU and CPU are not m

Postby Hooray » Tue Aug 05, 2014 5:26 pm

events/prop-rules seem relatively heavy - but if that's the case, really depends on your startup/run-time settings, especially the aircraft and any Nasal code (Nasal timers are registered/invoked via the events subsystem). Thus, you would need to compare performance using different settings (especially aircraft) to see for yourself. Patching FlightGear to provide a list of "expensive" callbacks is not overly complicated. The main issue here is that Nasal is meanwhile known to have frame spacing/frame rate effects due to its simple mark/sweep GC (Garbage Collector): http://wiki.flightgear.org/How_the_Nasal_GC_works

While it is possible to write pretty solid Nasal code that has fairly impact on the GC, most of the existing code predates those GC findings and was never written with GC considerations in mind.
But if you're able to patch the code & build from source, determining where & why things are slow is not exactly rocket science. Just keep in mind that the 777 you're currently testing with is one of the heaviest aircraft, and it also happens to be not particularly optimized - for some background, I'd suggest to check out this thread: viewtopic.php?f=42&t=22991#p213196
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 3 guests