<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Modartt user forum - linux cpu throttling fix isn't persistent - why?]]></title>
		<link>https://forum.modartt.com/viewtopic.php?id=4235</link>
		<description><![CDATA[The most recent posts in linux cpu throttling fix isn't persistent - why?.]]></description>
		<lastBuildDate>Tue, 23 Feb 2016 03:06:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941843#p941843</link>
			<description><![CDATA[<p><strong>Linux CPU frequency-setting governor script (command-line program) for intel_pstate</strong></p><p><strong>For computers that run Linux and have CPUs that use--</strong><br /></p><ul><li><p>intel_pstate functionality (rather than the older ACPI cpu-frequency method and user programs)</p></li><li><p>a linux kernel version 3.9 or newer (which contains the intel_pstate driver in the kernel code)</p></li></ul><p>This is newer version of the CPU-frequency-setting script I posted earlier. I created it for my own use, rather than completely disabling CPU frequency scaling by using the &quot;intel_pstate=disable&quot; argument to the command line that launches the linux kernel at boot time. The script might be useful to other Linux users also.</p><p>This version of the CPU-frequency-setting script is more versatile, can change the intel_pstate governor to either &quot;powersave&quot; or &quot;performance (the only two governors intel_pstate currently allows), has some error detection, more command-line feedback as the script runs, etc. The instructions are in the comments section contained within the script (the lines beginning with a # at the top of the script).</p><div class="codebox"><pre><code>#! /bin/sh
#
# Author: Stephen C. Doonan, stephen.doonan@gmail.com
# Version: 1.2
# Released: February 23, 2016
#
# This shell script has been tested in the bash and dash shells
# and will probably run well in most linux environments;
# please let me know at the above email address if you
# encounter problems or have comments or suggestions.
#
# This script changes intel_pstate CPU-core governors to &quot;performance&quot; or &quot;powersave&quot;
#
# The text of this script can be copied and pasted into a new plain-text file
# (using a text editor, not a word processor).
# 
# Save the script as a file called (for example) governor-intel-pstate in your home directory,
# then in a command-line terminal, in the directory, in which this script was saved,
# execute the following commands--
#
# chmod a+x governor-intel-pstate
# sudo cp governor-intel-pstate /usr/local/bin/
#
# Then you may execute the script by typing (in a command-line terminal):
# sudo governor-intel-pstate
#
# Note that it may require a short while before the command cpufreq-info shows a
# change in the CPU frequencies, after changing the governor.


GOVERNOR_TO_USE=&quot;none&quot;


echo &quot;\n\n&quot;
echo &quot;INFORMATION&quot;
echo &quot;-------------------------------------------------------------------&quot;
echo &quot;This program sets an Intel pstate CPU-frequency governor to&quot;
echo &quot;either \&quot;powersave\&quot; or \&quot;performance\&quot;&quot;
echo &quot;It must be run as the root user or using the sudo command.&quot;
echo &quot; &quot;
echo &quot;--&gt; YOU ARE CURRENTLY RUNNING THE PROGRAM AS USER: $(whoami) ...&quot;
echo &quot;-------------------------------------------------------------------&quot;
sleep 3

if [ ! -e &quot;/sys/devices/system/cpu/intel_pstate&quot; ]
then
    echo &quot; &quot;
    echo &quot;Your CPU does not use intel_pstate or it has been disabled as a&quot;
    echo &quot;linux kernel driver or in the BIOS&quot;
    echo &quot; &quot;
    exit 1
fi

if [ ! -w &quot;/sys/devices/system/cpu/cpu0&quot; ]
then
    echo &quot; &quot;
    echo &quot;NOTE: your username, $(whoami), cannot successfully run this command.&quot; 
    echo &quot;You must be the root user or use the sudo command to execute this script.&quot;
    echo &quot; &quot;
    echo &quot;--&gt; Will attempt to run this command again using sudo, which will&quot;
    echo &quot;require your administrative password (your user password)&quot;
    echo &quot; &quot;
    echo &quot;Attempting to run command using sudo; please wait a moment ...&quot;
    echo &quot;\n\n\n\n\n&quot;
    sleep 5
    exec sudo &quot;$0&quot;
fi

echo &quot; &quot;
echo &quot;Which intel_pstate CPU governor would you like to use?&quot;
echo &quot;1 -- powersave&quot;
echo &quot;2 -- performance&quot;
echo &quot; &quot;
echo -n &quot;Which governor? (Enter 1 or 2 here): &quot;
read GOVERNOR_TO_USE

if [ $GOVERNOR_TO_USE = 1 -o $GOVERNOR_TO_USE = 2 ]
then

    case $GOVERNOR_TO_USE in
        1 ) echo &quot;\nUSE GOVERNOR: powersave\n&quot; ; GOVERNOR_TO_USE=&quot;powersave&quot; ;;
        2 ) echo &quot;\nUSE GOVERNOR: performance\n&quot; ; GOVERNOR_TO_USE=&quot;performance&quot; ;;
    esac
    
    sleep 1
    CPU_NUM=1
    for GOVERNOR in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
    do
        echo &quot;Changing governor for CPU&quot; $CPU_NUM &quot;to&quot; $GOVERNOR_TO_USE
        echo -n &quot;$GOVERNOR_TO_USE&quot; &gt; $GOVERNOR
        CPU_NUM=$((CPU_NUM+1))
    done
    echo &quot; &quot;
    echo &quot;DONE: Governor changed to $GOVERNOR_TO_USE for each CPU&quot;
    echo &quot; &quot;
    sleep 1
    echo &quot;--&gt; Note that there may be a slight delay before the&quot;
    echo &quot;governor begins to affect the frequencies of each CPU&quot;
    echo &quot; &quot;

else
    echo &quot;\n\n&quot;
    echo &quot;ERROR&quot;
    echo &quot;-------------------------------------------------------------------&quot; 
    echo &quot;You typed: $GOVERNOR_TO_USE&quot;
    echo &quot;Please type number 1 (for powersave) or number 2 (for performance)&quot;
    echo &quot;-------------------------------------------------------------------&quot;
    echo &quot; &quot;
    exit 1
fi
exit 0</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Stephen_Doonan)]]></author>
			<pubDate>Tue, 23 Feb 2016 03:06:39 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941843#p941843</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941842#p941842</link>
			<description><![CDATA[<div class="quotebox"><cite>groovy wrote:</cite><blockquote><div class="quotebox"><cite>markmarz wrote:</cite><blockquote><p>that, in combination with disabling the ondemand daemon, has nailed it!</p></blockquote></div><p>I&#039;m glad to hear, thanks for your feedback!</p><p>Btw, the &quot;performance&quot; scaling_governor of intel_pstate even makes use of the Burst Frequency modes of a CPU if you compare my powertop output to the <a href="http://ark.intel.com/products/81073/Intel-Celeron-Processor-N2930-2M-Cache-up-to-2_16-GHz">specs</a> of the N2930:</p><p>Processor Base Frequency&nbsp; &nbsp; 1.83 GHz<br />Burst Frequency&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.16 GHz</p></blockquote></div><p>Good to know, thanks!</p>]]></description>
			<author><![CDATA[null@example.com (markmarz)]]></author>
			<pubDate>Mon, 22 Feb 2016 22:36:56 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941842#p941842</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941841#p941841</link>
			<description><![CDATA[<div class="quotebox"><cite>SteveLy wrote:</cite><blockquote><div class="quotebox"><cite>markmarz wrote:</cite><blockquote><p>I can&#039;t execute the cpufreq-set command as detailed earlier.</p></blockquote></div><p>I wasn&#039;t clear on why that was (other than maybe specifying a higher fixed frequency than the system can handle), since you started the thread stating that you were using cpufreq-set to begin with.</p><p>Glad you found a good solution in any case. I&#039;ll bookmark this thread for future reference in case I need to tinker with different computers in the future.</p></blockquote></div><p>You&#039;re right, this works:<br /></p><div class="codebox"><pre><code>sudo cpufreq-set -c 0 -g performance</code></pre></div><p>but this fails:<br /></p><div class="codebox"><pre><code>sudo cpufreq-set -c 0 -f 1.60GHz</code></pre></div><p>The error messages cover a lot of possibilities, including trying to set a specific frequency, which I think is key on my system. I abandoned digging further once groovy pointed out this technique doesn&#039;t work with intel_pstate anyway. </p><p>Glad to know this thread might be helpful to others - that&#039;s always in mind.</p>]]></description>
			<author><![CDATA[null@example.com (markmarz)]]></author>
			<pubDate>Mon, 22 Feb 2016 22:31:38 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941841#p941841</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941840#p941840</link>
			<description><![CDATA[<p>Steve (SteveLy)-- for some reason, your script--</p><div class="codebox"><pre><code>for i in 0 1 2 3; do sudo cpufreq-set -c $i -f 1.60GHz; done</code></pre></div><p>--produced an error message on my LinuxMint 17.3 (64-bit Cinnamon desktop edition) with Intel Core i7-3930K CPU @ 3.20GHz x 6. The following was repeated on standard output of the command-line linux terminal four times--</p><div class="codebox"><pre><code>Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn&#039;t loaded?</code></pre></div><p>--even a simple--</p><div class="codebox"><pre><code>sudo cpufreq-set -c 0 -f 3.1GHz</code></pre></div><p>--produced the same error message.</p><p>SO, I decided to resort to memory about shell scripting (from a long time ago; forgot how to increment a variable by one for each repetition of a loop and had to look it up), and wrote the following script so that I could enable the intel_pstate driver in the linux kernal by default (by removing &quot;intel_pstate=disable&quot; from the GRUB commandline for the kernel), and could instead change the intel_pstate governor at will after logging into the GUI desktop. The intel_pstate driver evidently allows only two CPU-frequency governors: powersave or performance</p><div class="codebox"><pre><code>#! /bin/sh
# script to change intel_pstate CPU-core governors to &quot;performance&quot; instead of &quot;powersave&quot;
# save script as (for example) performance-governor in home directory,
# then in command-line terminal, in the directory
# in which this script was saved, execute the following--
#
# sudo cp performance-governor /usr/local/bin/
# cd /usr/local/bin
# sudo chmod a+x performance-governor
#
# execute the script by typing (in command-line terminal):
# sudo performance-governor

CPU_NUM=1
for GOVERNOR in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
    do
        echo &quot;Changing governor for CPU &quot; $CPU_NUM &quot; to performance&quot;
        echo -n &quot;performance&quot; &gt; $GOVERNOR
        CPU_NUM=$((CPU_NUM+1))
    done</code></pre></div><p>This script when executed displays in the command-line terminal&#039;s standard output:</p><div class="codebox"><pre><code>Changing governor for CPU  1  to performance
Changing governor for CPU  2  to performance
Changing governor for CPU  3  to performance
Changing governor for CPU  4  to performance
Changing governor for CPU  5  to performance
Changing governor for CPU  6  to performance</code></pre></div><p>After running the script, the command cpufreq-info now includes (for each CPU core)--</p><div class="codebox"><pre><code>  current policy: frequency should be within 1.20 GHz and 3.80 GHz.
                  The governor &quot;performance&quot; may decide which speed to use</code></pre></div><p>--whereas before running the script, cpufreq-info included for each CPU: &quot;The governor &quot;powersave&quot; may decide which speed to use&quot;</p><p><strong>This script works without having to disable the &quot;ondemand&quot; script</strong> in /etc/init.d/ (or the symbolic link to it in the directory for a specific linux runlevel). Instead, the ondemand script typically sets the CPU-core governors to either &quot;ondemand&quot; (for pre intel_pstate CPUs) or &quot;powersave&quot; (for intel_pstate CPUs), and the script above merely changes the text in the scaling_governor file for each CPU (in /sys/devices/system/cpu/cpu*/cpufreq/) to &quot;performance&quot;, even if it was already set to performance</p><p>I haven&#039;t exercised these command-line scripting muscles in years! It was kind of fun.<br /><i class="far fa-smile smiley"></i></p><p><strong>Note added later: a more versatile and complete form of this script appears later in this discussion thread.</strong></p>]]></description>
			<author><![CDATA[null@example.com (Stephen_Doonan)]]></author>
			<pubDate>Mon, 22 Feb 2016 22:26:02 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941840#p941840</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941839#p941839</link>
			<description><![CDATA[<div class="quotebox"><cite>markmarz wrote:</cite><blockquote><p>I can&#039;t execute the cpufreq-set command as detailed earlier.</p></blockquote></div><p>I wasn&#039;t clear on why that was (other than maybe specifying a higher fixed frequency than the system can handle), since you started the thread stating that you were using cpufreq-set to begin with.</p><p>Glad you found a good solution in any case. I&#039;ll bookmark this thread for future reference in case I need to tinker with different computers in the future.</p>]]></description>
			<author><![CDATA[null@example.com (SteveLy)]]></author>
			<pubDate>Mon, 22 Feb 2016 21:41:51 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941839#p941839</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941838#p941838</link>
			<description><![CDATA[<div class="quotebox"><cite>SteveLy wrote:</cite><blockquote><p>Clearly my script is not suited to your system. I did not create it with any knowledge about other systems; I just looked to automate what I was doing manually previously.</p></blockquote></div><p>Of course! I learned something in this thread, thanks to you and everyone else.</p><p>I can&#039;t execute the cpufreq-set command as detailed earlier. For right now I&#039;m just using the performance governor and it&#039;s sticky, which was my main objective. Haven&#039;t noticed any problems when playing, but if I do I&#039;ll experiment. Probably I&#039;ll check out Stephen&#039;s approach to disable the governor.</p>]]></description>
			<author><![CDATA[null@example.com (markmarz)]]></author>
			<pubDate>Mon, 22 Feb 2016 20:23:16 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941838#p941838</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941837#p941837</link>
			<description><![CDATA[<div class="quotebox"><cite>markmarz wrote:</cite><blockquote><p>that, in combination with disabling the ondemand daemon, has nailed it!</p></blockquote></div><p>I&#039;m glad to hear, thanks for your feedback!</p><p>Btw, the &quot;performance&quot; scaling_governor of intel_pstate even makes use of the Burst Frequency modes of a CPU if you compare my powertop output to the <a href="http://ark.intel.com/products/81073/Intel-Celeron-Processor-N2930-2M-Cache-up-to-2_16-GHz">specs</a> of the N2930:</p><p>Processor Base Frequency&nbsp; &nbsp; 1.83 GHz<br />Burst Frequency&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.16 GHz</p>]]></description>
			<author><![CDATA[null@example.com (groovy)]]></author>
			<pubDate>Mon, 22 Feb 2016 20:23:03 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941837#p941837</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941836#p941836</link>
			<description><![CDATA[<div class="quotebox"><cite>Stephen_Doonan wrote:</cite><blockquote><div class="quotebox"><cite>markmarz wrote:</cite><blockquote><div class="quotebox"><cite>Stephen_Doonan wrote:</cite><blockquote><p>I have had the same problem: not being able to control the CPU frequencies, which (until I found a solution) always seemed to fall back to a lower than specification clock frequency. ...</p></blockquote></div><p>... Not sure your approach of essentially disabling new technology in order to use old technology is really the best way to go. Unless there&#039;s something I&#039;m missing of course .. maybe there&#039;s some advantage to the old way I don&#039;t see? Have you concluded that performance governor with intel_pstate isn&#039;t really forcing max frequency?</p></blockquote></div><p>Well, in my case I&#039;m not using the older ACPI method to regulate CPU frequencies (I&#039;m not even sure I could do so with the recent Intel multicore CPU I have, which includes the intel_pstate functionality; perhaps ACPI commands are ignored, although that&#039;s only a guess); I merely disabled the CPU frequency scaling that is automatic when the CPU includes the intel_pstate functionality, and the linux kernel recognizes that fact during bootup. This causes my CPU cores to operate at &quot;performance&quot; settings (manufacturer specified, but not overclocked frequencies) all the time. On my desktop computer, this works fine (so far). The primary advantage I see in disabling the intel_pstate CPU-frequency-lowering kernel driver is that I don&#039;t need to issue the commands to cause the intel_pstate governor to use the &quot;performance&quot; setting every time I login or reboot the computer; intel_pstate is permanently disabled, as long as I leave intel_pstate=disabled appended to the linux kernel command line.</p><p>I imagine that on a laptop computer, it might be preferable for the user to regulate the CPU governors as needed or prudent, or to have them automatically regulated (scaled) rather than the &quot;brute force&quot; approach of disabling the intel_pstate frequency-scaling completely. <i class="far fa-smile smiley"></i><br />---</p></blockquote></div><p>Gotcha, thanks for the clarification.</p>]]></description>
			<author><![CDATA[null@example.com (markmarz)]]></author>
			<pubDate>Mon, 22 Feb 2016 20:16:56 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941836#p941836</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941835#p941835</link>
			<description><![CDATA[<p>Clearly my script is not suited to your system. I did not create it with any knowledge about other systems; I just looked to automate what I was doing manually previously.</p><p>Just try cpufreq-set manually, e.g.:</p><div class="codebox"><pre><code>sudo cpufreq-set -c 0 -f 1.60GHz
sudo cpufreq-set -c 1 -f 1.60GHz
...</code></pre></div><p>or more succinctly:<br /></p><div class="codebox"><pre><code>for i in 0 1 2 3; do sudo cpufreq-set -c $i -f 1.60GHz; done</code></pre></div><p>and see if that works. I suspect 2.70 GHz is overclocking your system, since your lower limit is only at 500 MHz. For me the lower limit is 1.0 GHz, upper is 1.8 GHz and the latter is what the &quot;performance&quot; setting also yields. In your case I&#039;d just go with 1.6 GHz fixed frequency and see how that goes.</p><p>I suspect (but I don&#039;t know) that anything (much) faster than that can only be maintained for short bursts and that&#039;s why you see the system running at 1.60 GHz in &quot;performance&quot; mode. Like I mentioned before, the frequency switching/throttling seems to intrude on real-time audio when it happens, so perhaps at a fixed 1.60 GHz (or whatever your CPU can maintain indefinitely) you will get better real-time audio performance than by letting the system briefly go up to &quot;turbo&quot; speeds when it feels like it.</p><p>I am just guessing though. I&#039;m not familiar with Intel NUC or any other relatively recent hardware. Sounds like groovy may be a lot more knowledgeable about such things.</p>]]></description>
			<author><![CDATA[null@example.com (SteveLy)]]></author>
			<pubDate>Mon, 22 Feb 2016 19:46:20 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941835#p941835</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941834#p941834</link>
			<description><![CDATA[<div class="quotebox"><cite>markmarz wrote:</cite><blockquote><div class="quotebox"><cite>Stephen_Doonan wrote:</cite><blockquote><p>I have had the same problem: not being able to control the CPU frequencies, which (until I found a solution) always seemed to fall back to a lower than specification clock frequency. ...</p></blockquote></div><p>... Not sure your approach of essentially disabling new technology in order to use old technology is really the best way to go. Unless there&#039;s something I&#039;m missing of course .. maybe there&#039;s some advantage to the old way I don&#039;t see? Have you concluded that performance governor with intel_pstate isn&#039;t really forcing max frequency?</p></blockquote></div><p>Well, in my case I&#039;m not using the older ACPI method to regulate CPU frequencies (I&#039;m not even sure I could do so with the recent Intel multicore CPU I have, which includes the intel_pstate functionality; perhaps ACPI commands are ignored, although that&#039;s only a guess); I merely disabled the CPU frequency scaling that is automatic when the CPU includes the intel_pstate functionality, and the linux kernel recognizes that fact during bootup. This causes my CPU cores to operate at &quot;performance&quot; settings (manufacturer specified, but not overclocked frequencies) all the time. On my desktop computer, this works fine (so far). The primary advantage I see in disabling the intel_pstate CPU-frequency-lowering kernel driver is that I don&#039;t need to issue the commands to cause the intel_pstate governor to use the &quot;performance&quot; setting every time I login or reboot the computer; intel_pstate is permanently disabled, as long as I leave intel_pstate=disabled appended to the linux kernel command line.</p><p>I imagine that on a laptop computer, it might be preferable for the user to regulate the CPU governors as needed or prudent, or to have them automatically regulated (scaled) rather than the &quot;brute force&quot; approach of disabling the intel_pstate frequency-scaling completely. <i class="far fa-smile smiley"></i><br />---</p>]]></description>
			<author><![CDATA[null@example.com (Stephen_Doonan)]]></author>
			<pubDate>Mon, 22 Feb 2016 19:37:18 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941834#p941834</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941833#p941833</link>
			<description><![CDATA[<div class="quotebox"><cite>Stephen_Doonan wrote:</cite><blockquote><p>I have had the same problem: not being able to control the CPU frequencies, which (until I found a solution) always seemed to fall back to a lower than specification clock frequency. ...</p></blockquote></div><p>Thanks for the very informative post, Stephen.</p><p>I think I&#039;ve got performance mode working now thanks to all the help I&#039;ve gotten on this thread. Not sure your approach of essentially disabling new technology in order to use old technology is really the best way to go. Unless there&#039;s something I&#039;m missing of course .. maybe there&#039;s some advantage to the old way I don&#039;t see? Have you concluded that performance governor with intel_pstate isn&#039;t really forcing max frequency?</p>]]></description>
			<author><![CDATA[null@example.com (markmarz)]]></author>
			<pubDate>Mon, 22 Feb 2016 19:25:20 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941833#p941833</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941832#p941832</link>
			<description><![CDATA[<div class="quotebox"><cite>groovy wrote:</cite><blockquote><p>Boild down it is easy as this with intel_pstate scaling_driver:</p><div class="codebox"><pre><code>echo performance &gt; /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance &gt; /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo performance &gt; /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo performance &gt; /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor</code></pre></div><p>... then you get the best performance of your 4 intel cpu-cores.</p><p>If you like to watch the frequency of your cores in realtime I recommend the tool &#039;powertop&#039;. Playing Pianoteq it outputs something like that on my Intel N2930 netbook:<br /></p><div class="codebox"><pre><code>            Package |             Core    |            CPU 0
                    |                     | Actual    2.1 GHz
Idle       100.0%   | Idle       100.0%   | Idle       100.0%

                    |             Core    |            CPU 1
                    |                     | Actual    2.1 GHz
                    | Idle       100.0%   | Idle       100.0%

                    |             Core    |            CPU 2
                    |                     | Actual    2.2 GHz
                    | Idle       100.0%   | Idle       100.0%

                    |             Core    |            CPU 3
                    |                     | Actual    2.2 GHz
                    | Idle       100.0%   | Idle       100.0%</code></pre></div><p>cheers!</p></blockquote></div><p>Thanks groovy, I&#039;ll check out powertop, sounds like fun. </p><p>The code you suggest is exactly what the script I posted does; that, in combination with disabling the ondemand daemon, has nailed it! Thanks for your help.</p>]]></description>
			<author><![CDATA[null@example.com (markmarz)]]></author>
			<pubDate>Mon, 22 Feb 2016 19:06:49 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941832#p941832</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941831#p941831</link>
			<description><![CDATA[<p>I&#039;m using Linux Mint 17.3, Cinnamon edition</p><p>I have had the same problem: not being able to control the CPU frequencies, which (until I found a solution) always seemed to fall back to a lower than specification clock frequency. Here is what I have learned so far (as faulty as my learning or understanding may be; if someone more technically-minded notices a mistake, please correct any misinformation I&#039;m about to provide).</p><p>CPU frequencies used to be set or controlled by various programs or utilities which relied on interaction with the ACPI interface standard between software and hardware. But newer Intel CPUs, including the multicore CPUs, use an internal monitoring and CPU-frequency-scaling method called intel_pstate.</p><p>Since linux kernel 3.9 (I currently use a 4.2 low-latency kernel), an intel-pstate driver has been included in the kernel (not necessarily as a loadable/unloadable module, but directly within the kernel itself), and when launching linux (when the computer boots) if it notices that the CPU in one&#039;s computer is one of the newer CPUs with intel_pstate, that functionality supersedes and replaces any older ACPI approach to setting or controlling CPU frequencies, causing all those user-operated CPU frequency setting programs or utilites to fail or cease to have any effect.</p><p>The solution I&#039;m currently using, suggested by various linux users on the Internet, is to disable the kernel intel_pstate driver at boot time, by editing the GRUB bootloader configuration file (/etc/defalt/grub) as the root user or using sudo, to change the line reading--</p><p>GRUB_CMDLINE_LINUX_DEFAULT=</p><p>--to--</p><p>GRUB_CMDLINE_LINUX_DEFAULT=&quot;intel_pstate=disable&quot;</p><p>Then it is necessary to run (as root or using sudo) the command update-grub, so that your changes to /etc/default/grub will be written to the files in the /boot directory. Then, upon rebooting the computer, the intel_pstate CPU monitor/governor driver should be disabled and the CPUs (all of the cores) should run at the manufacturer specified clock-frequency.</p><p>On my system, in addition to adding intel_pstate=disable to the kernel commandline, I added threadirqs to that commandline--</p><p>GRUB_CMDLINE_LINUX_DEFAULT=&quot;intel_pstate=disable threadirqs&quot;</p><p>--based on some recommendations or comments I found on the Internet, although I&#039;m not sure if that helps or not. I also installed the rtirq package, which (once configured) gives a higher priority (in terms of interacting with the CPU) to the IRQs (interrupt requests used by the computer motherboard and CPU) assigned to one&#039;s soundcard.</p><p>I hope this information helps and is not misleading. Someone please correct the information if an error is found.</p>]]></description>
			<author><![CDATA[null@example.com (Stephen_Doonan)]]></author>
			<pubDate>Mon, 22 Feb 2016 19:00:58 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941831#p941831</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941830#p941830</link>
			<description><![CDATA[<p>Boild down it is easy as this with intel_pstate scaling_driver:</p><div class="codebox"><pre><code>echo performance &gt; /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance &gt; /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo performance &gt; /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo performance &gt; /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor</code></pre></div><p>... then you get the best performance of your 4 intel cpu-cores.</p><p>If you like to watch the frequency of your cores in realtime I recommend the tool &#039;powertop&#039;. Playing Pianoteq it outputs something like that on my Intel N2930 netbook:<br /></p><div class="codebox"><pre><code>            Package |             Core    |            CPU 0
                    |                     | Actual    2.1 GHz
Idle       100.0%   | Idle       100.0%   | Idle       100.0%

                    |             Core    |            CPU 1
                    |                     | Actual    2.1 GHz
                    | Idle       100.0%   | Idle       100.0%

                    |             Core    |            CPU 2
                    |                     | Actual    2.2 GHz
                    | Idle       100.0%   | Idle       100.0%

                    |             Core    |            CPU 3
                    |                     | Actual    2.2 GHz
                    | Idle       100.0%   | Idle       100.0%</code></pre></div><p>cheers!</p>]]></description>
			<author><![CDATA[null@example.com (groovy)]]></author>
			<pubDate>Mon, 22 Feb 2016 18:10:16 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941830#p941830</guid>
		</item>
		<item>
			<title><![CDATA[Re: linux cpu throttling fix isn't persistent - why?]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=941829#p941829</link>
			<description><![CDATA[<div class="quotebox"><cite>SteveLy wrote:</cite><blockquote><p>My thought is not to use my script without checking out what it does on your system (I&#039;ll describe how to do that safely below). On my Linux Mint 17.2 on a Dell D620 it runs the cores at max non-turbo no-over-clocking frequency. When I said &quot;going flat out&quot; I meant without overclocking, which I am not a fan of in general. On my laptop running CPUs at max normal speed does not cause any issues (there is no excessive heat or CPU fan activity).</p><p>To see if my script would work in the way I intended it to on your machine (i.e., with no overclocking), run this first in a terminal:</p><div class="codebox"><pre><code>cpufreq-info | grep limits | head -n1 | cut -f2 -d- | sed &#039;s/ //g&#039;</code></pre></div></blockquote></div><p>I had done that earlier in order to find the maximum frequency, outputs &quot;2.70GHz&quot;.</p><div class="quotebox"><blockquote><div class="codebox"><pre><code>cpufreq-info | grep analyz | tail -n1 | cut -f 3 -d&#039; &#039; | cut -f1 -d:</code></pre></div><p>which should output an integer that is one less than the number of (virtual) cores, i.e., 3, if you have a CPU capable of 4 threads. (I believe I have two physical cores and 4 virtual CPUs, just like your NUC I suspect, so that&#039;s the result I get.)</p></blockquote></div><p>Yep, it outputs 3, I have 4 cores.</p><div class="quotebox"><blockquote><p>If all that checks out my script should work for you. But it sounds like other posters might have better ideas worth exploring.</p></blockquote></div><p>Unfortunately your script doesn&#039;t work on my setup (even when I run as root) and I suppose never will because of the <strong>cpufreq-set</strong> command called out by <strong>groovy</strong>:</p><div class="codebox"><pre><code>Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn&#039;t loaded?</code></pre></div><p>If I&#039;m putting together properly what groovy has said, then the script I first posted (which sets scaling_governor) should work. Which it does, if I can believe its output. The problem is, it&#039;s not sticky. Or it wasn&#039;t. I&#039;m beginning to think disabling the ondemand daemon per <strong>spfenwick</strong> did the trick. So far I&#039;m in performance mode and it seems to be sticking.</p><p>BTW cpufreq-info is still telling me I&#039;m on base frequency, but since that command goes with cpufreq-set, I&#039;m thinking I shouldn&#039;t believe it.<br /></p><div class="codebox"><pre><code>nuc5 mark # cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 500 MHz - 2.70 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 500 MHz and 2.70 GHz.
                  The governor &quot;performance&quot; may decide which speed to use
                  within this range.
  current CPU frequency is 1.60 GHz (asserted by call to hardware).
analyzing CPU 1:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 1
  CPUs which need to have their frequency coordinated by software: 1
  maximum transition latency: 0.97 ms.
  hardware limits: 500 MHz - 2.70 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 500 MHz and 2.70 GHz.
                  The governor &quot;performance&quot; may decide which speed to use
                  within this range.
  current CPU frequency is 1.60 GHz (asserted by call to hardware).
analyzing CPU 2:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 2
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency: 0.97 ms.
  hardware limits: 500 MHz - 2.70 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 500 MHz and 2.70 GHz.
                  The governor &quot;performance&quot; may decide which speed to use
                  within this range.
  current CPU frequency is 1.60 GHz (asserted by call to hardware).
analyzing CPU 3:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 3
  CPUs which need to have their frequency coordinated by software: 3
  maximum transition latency: 0.97 ms.
  hardware limits: 500 MHz - 2.70 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 500 MHz and 2.70 GHz.
                  The governor &quot;performance&quot; may decide which speed to use
                  within this range.
  current CPU frequency is 1.60 GHz (asserted by call to hardware).
nuc5 mark # </code></pre></div><p>Thanks,<br />Mark</p>]]></description>
			<author><![CDATA[null@example.com (markmarz)]]></author>
			<pubDate>Mon, 22 Feb 2016 16:49:48 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=941829#p941829</guid>
		</item>
	</channel>
</rss>
