nVidia Driver Tweaks for Fligthgear on *nix OS
Posted: Mon Jan 02, 2017 3:29 pm
I have recently changed my laptop for a better one, but when I upgraded my OS I encountered some regression on FGFS rendering. So I investigated on many things, and I'm happy to share with you some of them I discovered during my investigations. My own troubles still continue, but are in a good way ..
I'm running a FreeBSD OS, but you can actually use everything under Linux, NVidia drivers are "more or less" the same ("more" here means Linux can use CUDA for example (Blender is very happy... ), FreeBSD cannot amongst others)
I think it is possible to tweak your NVidia card under MSWindows the same way, but I'm not sure. Just read carefuly your nvidia README, the team really provides a lot of information for everyone.
I heavily used GLMark2, a kind of "apt-get install glmark2" on Linux could help you if you want to benchmark your GPU + test your parameters.
Notice that a better GLMark2 score do not leads to a better performance on FGFS. This is because GLMark2 bench everything relative to OpenGL, and FGFS don't use everything relative to OpenGL. So, some score matters, some others don't.
Anyway, if you don't have already set-up your driver, this is the good time to do it.
I - nvidia driver optimization:
- these settings have been tested on an *nix OS, I don't know if they are
useable for MSWindows OS, but I guess yes.
I use the "Application Profiles" feature through the nvidia-settings app. as seen here:
It's really easy to use: you first define a profile (2cd Profiles tab), then you define what app (1st tab) use this profile. Save everything, launch you app, and see. Some parameters can be defined at start time on your shell environment (export ...)
1) The 1st parameter that has really improved my fps is _GL_YIELD="NOTHING"
I think that you can ignore the calls sched_yield() on multi-core CPU
setting it to "NOTHING", so the driver don't wait on external state to
change. Of course, this consume a bit more CPU, but I think that is not
relevant on a 4-Cores for example.
In order to be clear, take an eye on this glmark2 bench:
With GL_YIELD at its default value (on)
[build] use-vbo=false: FPS: 3287 FrameTime: 0.304 ms
[build] use-vbo=true: FPS: 3463 FrameTime: 0.289 ms
With GL_YIELD=NOTHING
[build] use-vbo=false: FPS: 3348 FrameTime: 0.299 ms
[build] use-vbo=true: FPS: 3530 FrameTime: 0.283 ms
The only issue I saw with my parameter is on the way an X11 client will
refresh its windows: you could see some part that are updated a bit slower
than other. But when you play with FGFS, do you really care about others X
client ? )
2) GLShaderDiskCache + GLShaderDiskCachePath
They work together. The 1st indicates to compile any shaders your app will
use at runtime once and for all. So, if your app use the same shader,
the GPU don't have to compile it over again and again.
This really improve your performance.
GLShaderDiskCachePath indicate where to put the files, eg
/home/ETisMyName/.nv/GLCache
Notice that you could see some lags during the 1st minutes you play FG,
then they disappears.
3) GLThreadedOptimizationss=true.
Not sure if this is relevant to FGFS. But I don't see any regression with it, so I keep it.
II - Flightgear tweaks
- I tried to use the multithreading support on FG, but it doesn't work at all
for me (and yes, FG was compiled with pthread).
You can try the 3 values (see inside preferences.xml) eg:
Flightgear Root/preferences.xml:
<multithreading-mode>AutomaticSelection</multithreading-mode>
IMHO, FG don't really use multithreading. I still don't understand why FG
don't use the full cpupower you could have. In most case, it is single
threaded (and so use only one cpu thread). If someone knows the reasons ..
III - X11 Window Manager.
IMHO, the best for a day to day use is ... the legacy Compiz-0.8. Every bench I launched on it are far better than other WM featuring a compositor (or like compiz, using OpenGL)
But for FG, the best is probably Openbox, or some other lightweight wm, w/o any compositor of course.
Whatever WM you use, disable the compositor. Kill compton or xcompmgr, disable XFCE compositor, or simply change your WindowManager.
In fact, GL score are from 100% to 200% better without any compositor.
Try to avoid Firefox too during you play session, html5/x264/coffeeMaker could really decrease some precious GPU clock.
That's all folks !
oÔ
I hope this will help you,
Happy new year
Valéry
I'm running a FreeBSD OS, but you can actually use everything under Linux, NVidia drivers are "more or less" the same ("more" here means Linux can use CUDA for example (Blender is very happy... ), FreeBSD cannot amongst others)
I think it is possible to tweak your NVidia card under MSWindows the same way, but I'm not sure. Just read carefuly your nvidia README, the team really provides a lot of information for everyone.
I heavily used GLMark2, a kind of "apt-get install glmark2" on Linux could help you if you want to benchmark your GPU + test your parameters.
Notice that a better GLMark2 score do not leads to a better performance on FGFS. This is because GLMark2 bench everything relative to OpenGL, and FGFS don't use everything relative to OpenGL. So, some score matters, some others don't.
Anyway, if you don't have already set-up your driver, this is the good time to do it.
I - nvidia driver optimization:
- these settings have been tested on an *nix OS, I don't know if they are
useable for MSWindows OS, but I guess yes.
I use the "Application Profiles" feature through the nvidia-settings app. as seen here:
It's really easy to use: you first define a profile (2cd Profiles tab), then you define what app (1st tab) use this profile. Save everything, launch you app, and see. Some parameters can be defined at start time on your shell environment (export ...)
1) The 1st parameter that has really improved my fps is _GL_YIELD="NOTHING"
I think that you can ignore the calls sched_yield() on multi-core CPU
setting it to "NOTHING", so the driver don't wait on external state to
change. Of course, this consume a bit more CPU, but I think that is not
relevant on a 4-Cores for example.
In order to be clear, take an eye on this glmark2 bench:
With GL_YIELD at its default value (on)
[build] use-vbo=false: FPS: 3287 FrameTime: 0.304 ms
[build] use-vbo=true: FPS: 3463 FrameTime: 0.289 ms
With GL_YIELD=NOTHING
[build] use-vbo=false: FPS: 3348 FrameTime: 0.299 ms
[build] use-vbo=true: FPS: 3530 FrameTime: 0.283 ms
The only issue I saw with my parameter is on the way an X11 client will
refresh its windows: you could see some part that are updated a bit slower
than other. But when you play with FGFS, do you really care about others X
client ? )
2) GLShaderDiskCache + GLShaderDiskCachePath
They work together. The 1st indicates to compile any shaders your app will
use at runtime once and for all. So, if your app use the same shader,
the GPU don't have to compile it over again and again.
This really improve your performance.
GLShaderDiskCachePath indicate where to put the files, eg
/home/ETisMyName/.nv/GLCache
Notice that you could see some lags during the 1st minutes you play FG,
then they disappears.
3) GLThreadedOptimizationss=true.
Not sure if this is relevant to FGFS. But I don't see any regression with it, so I keep it.
II - Flightgear tweaks
- I tried to use the multithreading support on FG, but it doesn't work at all
for me (and yes, FG was compiled with pthread).
You can try the 3 values (see inside preferences.xml) eg:
Flightgear Root/preferences.xml:
<multithreading-mode>AutomaticSelection</multithreading-mode>
IMHO, FG don't really use multithreading. I still don't understand why FG
don't use the full cpupower you could have. In most case, it is single
threaded (and so use only one cpu thread). If someone knows the reasons ..
III - X11 Window Manager.
IMHO, the best for a day to day use is ... the legacy Compiz-0.8. Every bench I launched on it are far better than other WM featuring a compositor (or like compiz, using OpenGL)
But for FG, the best is probably Openbox, or some other lightweight wm, w/o any compositor of course.
Whatever WM you use, disable the compositor. Kill compton or xcompmgr, disable XFCE compositor, or simply change your WindowManager.
In fact, GL score are from 100% to 200% better without any compositor.
Try to avoid Firefox too during you play session, html5/x264/coffeeMaker could really decrease some precious GPU clock.
That's all folks !
oÔ
I hope this will help you,
Happy new year
Valéry