There's an interesting issue with certain Linux CPU governors that will actually bring down performance in Vulkan games. You might not need this, depending on what CPU governor you have installed.
You might end up seeing jerking or micro-stutter, far more than you would in OpenGL games. The issue is that when using OpenGL in games, you're generally taxing a single core of your CPU due to less multi-threading. With Vulkan spreading the load more, your CPU isn't being used so much.
The Linux CPU governor takes that as an opportunity to bring down your CPU performance, as right now it's not the smartest bulb in the tanning bed.
Here's what a Croteam developer said about the issue:
QuotePowersave governor is an awful choice for playing games. It may quite be the case that it's not happening for OpenGL especially because GL runs slower.
When the game is running fast enough that CPU has to wait on the GPU, the governor sees that as an opportunity to downclock the CPU, or put cores to sleep. The jerking is a result of the CPU throttling up and down very quickly.
In general, CPU governors on Linux are much, much dumber than the Windows one. (It seems that Windows overrides the throttling for all 3D apps, or similar.)
That's why we have this warning in the log. Switch over to Performance governor, at least while playing.
So a tip for now when playing Vulkan games on Linux: Set your CPU to high performance mode, you can do it like so in terminal ("performance" is just an example, see more here):
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
A higher performance mode will generally result in higher power consumption too.
Then to set it back to normal. You don't need to use "powersave" see more options here, as it's just an example. According to the Arch Wiki you likely want "ondemand" for AMD:
echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
You can find out what performance mode you're in right now by running this in terminal:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
My default on the Intel i7 5960x is powersave, for example.
Hopefully this issue will be fixed as more games come over to Vulkan. It would be nice if developers didn't need to code around issues like this on Linux.
Quoting: lucifertdarkI tried this the other day when you posted it & the cpu kept overheating, turns out one of the clips that are supposed to hold the fan in place had broken & it wasn't sitting against the cpu so cooling wasn't happening at all, one refresh of the thermal paste & a new fan later & no more overheating, thanks to you Liam I got a potentially cpu threatening problem fixed. :D
Cool!
... in both meanings of the word! :D
Quoting: EikeCool!He didn't so much save my bacon as save my chips. ;)
... in both meanings of the word! :D
"Jannis
I use a file in /etc/sudoers.d/ to allow commands I want to run with sudo from scripts without password:
# cat /etc/sudoers.d/20-customstuff
jannis ALL=(ALL) NOPASSWD: /usr/bin/openvpn, /usr/bin/cpupower, /usr/local/bin/cryptmount.sh, /usr/bin/radeontop, /usr/bin/psd-overlay-helper, /usr/local/bin/emsync.sh
This allows to run certain commands or scripts with sudo without entering a password.
I put my custom scripts into /usr/local/bin/ as that's owned by root, in path variable, and won't conflict with the package manager. I also "chown root:root" and "chmod 755" my scripts to prevent privilege escalation.
Anyway, to toggle cpu governors, I made a small script¹ and set it to execute on keypress on one of the custom keys on my roccat keyboard. It uses /usr/bin/cpupower which is in the NOPASSWD line mentioned above.
¹ pastebin.com - [Bash] /usr/local/bin/toggleperformance - Pastebin.com
[Bash] /usr/local/bin/toggleperformance - Pastebin.com
[Bash] /usr/local/bin/toggleperformance - Pastebin.com
pastebin.com"
https://pastebin.com/vj6jD8bE
Quoting: KeyrockThanks for the heads up, Liam. I made two files, called gov_perf and gov_psav and copied the short scripts into them, then made them executable and copied them to usr/bin. That way I can issue the commands from any directory with a single word typed. I'm sure I could add gov_perf to launcher scripts of games so that the process is auto-magic. Now to figure out a way to make games trigger gov_psav upon exit...You know you could add them as bash aliases as well? they would then work from terminal, tested & fully working here. :D
alias perform='echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'
Gives you performance &alias demand='echo ondemand | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'
puts it back to ondemand.put those lines in your .bash_aliases file & you're good to go.
Last edited by lucifertdark on 4 April 2017 at 5:38 pm UTC
See more from me