Author Topic: Better performance with Linux open source drivers  (Read 6172 times)

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Better performance with Linux open source drivers
« on: 28 December 2011, 17:45:49 »
By default most Linux distributions ship Radeon (ATI/AMD) and Intel open source graphics drivers with vertical screen blanking / synchronisation enabled. While this is a safe default, disabling this can allow for better performance and is stable in many hardware configurations nowadays.

To check which graphics drivers you are using, you may use the lscpi command or inspect your X log.

This command works for me to display my graphics driver, it may or may not work for you, too:
lspci -knnv | fgrep -A 10 VGA | awk '/Kernel driver in use/ {print $5}'

To disable vertical screen synchronisation and potentially improve your graphics performance (FPS) add this to your user profiles' startup scripts, such as to ~/.bashrc:
Code: [Select]
#Intel (i815, i915) or Radeon (r300, r600) driver + DRI2: Disable vertical screen synchronisation
export vblank_mode=0

Beware: this may break your graphical desktop, causing you lots of trouble if you do not know how to undo it from a text based terminal window.

If it worked, on the next start of an OpenGL application (such as MegaGlest) from a terminal window you should get to see this:
ATTENTION: default value of option vblank_mode overridden by environment.
 
Users of the Intel and Radeon open source drivers can also install driconf, a graphical frontend for setting graphics driver related configuration options. Note that With intel drivers, this should work out of the box. With radeon drivers, you may need to manually edit the ~/.drirc file every time you change an option on the driconf GUI, and replace radeon by dri2 respectively (depending on the driver you actually use).

ATI users with open source drivers: Please report your experience at http://wiki.x.org/wiki/RadeonProgram (see the MegaGlest entry in this table)
« Last Edit: 2 February 2012, 15:47:02 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: Better performance with Linux open source drivers
« Reply #1 on: 28 December 2011, 17:50:07 »
Do note that if you disable V-sync you may experience tearing in games where the screen is moving fast, in reality v-sycn does not hamper you FPS by alot, it only tries to lock your FPS to monitor refresh rate.
WiP Game developer.
I do danish translations.
"i break stuff"

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better performance with Linux open source drivers
« Reply #2 on: 28 December 2011, 21:31:25 »
Do note that if you disable V-sync you may experience tearing in games where the screen is moving fast, in reality v-sycn does not hamper you FPS by alot, it only tries to lock your FPS to monitor refresh rate.
But for the majority of players who are likely playing MegaGlest below their monitor's refresh rate, it can be a massive drop in frame rate. For example, on a monitor with a 75Hz refresh rate, running at 50 FPS, turning V sync on would cause it to be capped at 37.5 FPS. If your frame rate is tippy, moving above and below the monitor's refresh rate, you could be seeing your frame rate being constantly halved. Regardless of whether you consider 37 FPS  to be smooth (I would), seeing it halved is definitely noticeable. So if you have under the monitor's refresh rate most of the time, V sync is bad. Only if you're over the monitor's refresh rate all the time would vsync be good.

http://hardforum.com/showthread.php?t=928593
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: Better performance with Linux open source drivers
« Reply #3 on: 30 December 2011, 15:50:49 »
Do note that if you disable V-sync you may experience tearing in games where the screen is moving fast, in reality v-sycn does not hamper you FPS by alot, it only tries to lock your FPS to monitor refresh rate.
But for the majority of players who are likely playing MegaGlest below their monitor's refresh rate, it can be a massive drop in frame rate. For example, on a monitor with a 75Hz refresh rate, running at 50 FPS, turning V sync on would cause it to be capped at 37.5 FPS. If your frame rate is tippy, moving above and below the monitor's refresh rate, you could be seeing your frame rate being constantly halved. Regardless of whether you consider 37 FPS  to be smooth (I would), seeing it halved is definitely noticeable. So if you have under the monitor's refresh rate most of the time, V sync is bad. Only if you're over the monitor's refresh rate all the time would vsync be good.

http://hardforum.com/showthread.php?t=928593

 :thumbup:

Exelent post!, I learned something thanks for giving more accurate infomation.
WiP Game developer.
I do danish translations.
"i break stuff"