Every article tag can be clicked to get a list of all articles in that category. Every article tag also has an RSS feed! You can customize an RSS feed too!
We do often include affiliate links to earn us some pennies. See more here.

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.

Article taken from GamingOnLinux.com.
Tags: Editorial, HOWTO
17 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly came back to check on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly. Find me on Mastodon.
See more from me
The comments on this article are closed.
75 comments
Page: «5/8»
  Go to:

MayeulC Mar 23, 2017
Quoting: Cybolic
Quoting: HailToTheGrail
Quoting: CybolicI wish there was a way to not have to put in my password on every change, maybe someone knows how to work around that?

You could give setuid a try. Make a shell script as root, and then: chmod u+s script.sh
You should be able to run it as a user with it's owner rights, which are root.

No go on my Arch system. I've also tried editing the sudoers config file with visudo and using sudo instead, but that still asks for a password :/

Are you sure it is owned by root?
chown root script.sh

A plasmoid to change the CPU governor doesn't seem a bad idea, I might look into that.
Guest Mar 23, 2017
Quoting: buenaventura
Quoting: meggermanRunning AMD CPU/APU's i have always turned of Turbo mode in the BIOS and cool & quiet.

How do you do this? Entering bios with F2 during boot, I see no option to turn Turbo on/off. Perhaps it is not supported by my "AMD A8-6410 with Radeon R5 Graphics (up to 2.4ghz)". However, in bios it says that my computer has only 2000mhz cpu freq, so clearly the CPU is not turboin :P

I have the settings in BIOS

My CPU has a turbo of 4.2ghz and a base clock of 3.8. I just disable turbo and increase the multiplyer to give me a constant 4.2 ghz. I found that in particular source engine games would stutter more and jump in FPS with the CPU switching between its core clock speed steps. If i get ryzen i probably shouldnt have to worry as much given that there will always be enough base line performance for source engine games and that titles are now moving to more GPU orientated APi's.
Arehandoro Mar 23, 2017
A couple of months ago saw this article on the Steam forums addressing the same issue, with another tweaks too, and it's what I use. I believe it's basically cpufrequtils with a script to switch performance mode on and off.
Liam Dawe Mar 23, 2017
Seems reddit doesn't agree with me on this article.

Note to self: Don't read reddit.
buenaventura Mar 23, 2017
Quoting: liamdaweSeems reddit doesn't agree with me on this article.

Note to self: Don't read reddit.

This is such a boring trend among developers in general, the response to any user tweaks is always "nooeee dont tinker with our perfectly logical programs, just spend hours replacing your tuned ubuntu with the utter standard, wash your hands, then start the game and get all these logs and send them to me so that I can ask you to do it all again for reproducability. THEN we might file a bug that will sit in some list for a year. Have fun.". Yeyeye that's all rational and stuff, but I think they get blinded by their own position as computer experts, computers is essentially mumbo jumbo magic IMO, like other complex stuff humans deal with. Things just work, and they are generally too complex/contingent/systemic for any person to understand, so people tinker and code away and sometimes it just works. Trying to force it to be rational and understandable is just too time consuming when users can get improvements with random tweaks.

As long as it doesn't break anything, let us play with irrational tweaks and pray to the CPU gods like we want.
fabertawe Mar 23, 2017
Quoting: Cybolic
Quoting: HailToTheGrail
Quoting: CybolicI wish there was a way to not have to put in my password on every change, maybe someone knows how to work around that?

You could give setuid a try. Make a shell script as root, and then: chmod u+s script.sh
You should be able to run it as a user with it's owner rights, which are root.

No go on my Arch system. I've also tried editing the sudoers config file with visudo and using sudo instead, but that still asks for a password :/

I've always set 'performance' for gaming. I have an i7 and just use an alias along the lines of 'sudo cpupower frequency-set -g performance' with the corresponding allowance in sudoers - '/usr/bin/cpupower frequency-set -g performance', so no password entering every time. Plus the same for 'powersave'.
Orkultus Mar 23, 2017
[quote=fabertawe]
Quoting: Cybolic
Quoting: HailToTheGrail
Quoting: CybolicI wish there was a way to not have to put in my password on every change, maybe someone knows how to work around that?

You could give setuid a try. Make a shell script as root, and then: chmod u+s script.sh
You should be able to run it as a user with it's owner rights, which are root.

No go on my Arch system. I've also tried editing the sudoers config file with visudo and using sudo instead, but that still asks for a password :/

That workaround is echo (password) | sudo -S /usr/bin/scale.sh performance
Orkultus Mar 23, 2017
Or you can install indicator-cpufreq, which provides a dropdown menu on your task bar to select the frequency and govern speeds of your processor.
Cybolic Mar 23, 2017
Quoting: M@yeulC
Quoting: Cybolic
Quoting: HailToTheGrail
Quoting: CybolicI wish there was a way to not have to put in my password on every change, maybe someone knows how to work around that?

You could give setuid a try. Make a shell script as root, and then: chmod u+s script.sh
You should be able to run it as a user with it's owner rights, which are root.

No go on my Arch system. I've also tried editing the sudoers config file with visudo and using sudo instead, but that still asks for a password :/

Are you sure it is owned by root?
chown root script.sh

A plasmoid to change the CPU governor doesn't seem a bad idea, I might look into that.
Yup: [cybolic:~] $ cat .local/bin/set_cpu_scheduler.sh 
#!/usr/bin/bash
exec cpupower frequency-set -rg "$1" 
[cybolic:~] $ sudo chown root .local/bin/set_cpu_scheduler.sh 
[cybolic:~] $ sudo chmod u+s .local/bin/set_cpu_scheduler.sh 
[cybolic:~] $ ls .local/bin/set_cpu_scheduler.sh -l
-rwsr-xr-x 1 root root 54 Mar 23 18:11 .local/bin/set_cpu_scheduler.sh
[cybolic:~] $ set_cpu_scheduler.sh performance
Subcommand frequency-set needs root privileges



Last edited by Cybolic on 23 March 2017 at 4:16 pm UTC
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.