These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

Linux

 
  • Topic is locked indefinitely.
 

Moar FPS: CPU Affinity / Renice daemon

Author
Kai Bergen
Volafile
#1 - 2015-06-21 14:11:40 UTC  |  Edited by: Kai Bergen
So I think everyone who tried to squeeze the last few FPS out of a WINE game has heard about CPU pinning/affinity by now.

There have been numerous hacky solutions in the past I haven't been quite happy with, so I've taken it upon myself to write something proper that will work with most WINE games.

The result was a simple daemon that, based on a config file, will automatically re-nice processes and assign them to CPUs.

The source code can be found here: https://github.com/laino/nicedaemon

As you can see the default configuration already ships with settings for EVE Online and League of Legends pre-defined,
but it should be easy enough (provided you have some knowledge of linux systems) to add configuration for any game you want. The configuration resides in /etc/nicedaemon.conf

How to install

Installing it is just a matter of doing:

git clone https://github.com/laino/nicedaemon
cd nicedaemon
make
sudo make install


If you're using systemd you're in luck because it ships with a .service file. To automatically run the daemon when your computer starts, do:

sudo systemctl enable nicedaemon.service 
sudo systemctl start nicedaemon.service


If you don't have systemd, you'll have to launch the daemon manually (or contribute an init script file).
To launch the daemon manually, open a terminal and type:

sudo nicedaemon


Remember to keep the terminal open and the daemon running while you play your game of choice.

After making any changes to the configuration (residing in /etc/nicedaemon.conf), you'll have to restart the daemon:

sudo systemctl restart nicedaemon.service 


Fly safe!

What you can expect to gain from this:

EVE Online: I found the average FPS to be about the same, but it completely eliminates any temporary FPS drops which would otherwise occur now and then (constant 40 FPS instead of 25-40 FPS)

League of Legends: About 15% more FPS flat for me.

If you tried it with any other game, let me know about the configuration you used and the performance gains you got (if any).
Torgeir Hekard
I MYSELF AND ME
#2 - 2015-06-22 06:44:44 UTC
Honestly, I wouldn't play with low niceness levels on complex applications with pretty much undefined behaviour. If something bad happens with a niced process, you can get yourself an unresponsive system. If anything, low niceness is useful for an emergency console.
Kai Bergen
Volafile
#3 - 2015-06-22 13:16:55 UTC
Torgeir Hekard wrote:
Honestly, I wouldn't play with low niceness levels on complex applications with pretty much undefined behaviour. If something bad happens with a niced process, you can get yourself an unresponsive system. If anything, low niceness is useful for an emergency console.

You're 100% correct for the general case. The picture is a bit different if you assign the process to a specific CPU core though. Now the process can only use that single core fully, leaving the average system with 3-7 idle cores.
Katrina Bekers
A Blessed Bean
Pandemic Horde
#4 - 2015-07-01 14:20:50 UTC
So, basically you bind a process to a single CPU (cpuset) and raise its priority (nice)?

And instead of a clumsy shell wrapper, it's an elegant daemon.

Did I understand correctly?

<< THE RABBLE BRIGADE >>

Kai Bergen
Volafile
#5 - 2015-07-07 22:08:14 UTC
Katrina Bekers wrote:
So, basically you bind a process to a single CPU (cpuset) and raise its priority (nice)?

And instead of a clumsy shell wrapper, it's an elegant daemon.

Did I understand correctly?

Pretty much. Those shell script solutions each suffered from at least one of the following problems:

  1. They poll running processes like once every second, which is very inefficient and wastes resources
  2. You need to run them manually AFTER you launch a game (i.e. tab out of it and fiddle around with shell scripts)
  3. It's hard to adapt them anything else, because they're usually specific to some game


I'm not saying they're all bad and you shouldn't use them, but if any of the above is a pain to you, then you're better off with the daemon.
Ravow
Republic Military School
Minmatar Republic
#6 - 2015-08-08 03:32:55 UTC
I'm using taskset in my EVE starting script since age.
I confirm that It help a little.
Ravow
Republic Military School
Minmatar Republic
#7 - 2015-08-09 23:44:32 UTC  |  Edited by: Ravow
I forgot to mention.

If you use CSMT patches, you need to allocate two cores, not one. CSMT detach the D3D => OGL from the main thread and it's why it help a lot. Note that it's that second thread who is stuck to 100% and over-clocking will still help greatly.

Also you can try to isolate others threads so they do use the two "EVE" threads.

#!/bin/sh
cd /EVE
R600_DEBUG=hyperz taskset -c 4-5 wine explorer /desktop=Ravow,1920x1080 bin/exefile.exe
Jack Aesop
The Scope
Gallente Federation
#8 - 2015-08-27 16:41:43 UTC
Brilliant! I played with it last night and it works like a charm. I'll play with CSMT tonight.

Well done!