How to get current CPUPower governor












12















I want to get the current CPUPower governor.



When I type cpupower frequency-info I get a lot of information. I just want to get the governor, just like "ondemand" with no more information, to use its value in a program.










share|improve this question





























    12















    I want to get the current CPUPower governor.



    When I type cpupower frequency-info I get a lot of information. I just want to get the governor, just like "ondemand" with no more information, to use its value in a program.










    share|improve this question



























      12












      12








      12








      I want to get the current CPUPower governor.



      When I type cpupower frequency-info I get a lot of information. I just want to get the governor, just like "ondemand" with no more information, to use its value in a program.










      share|improve this question
















      I want to get the current CPUPower governor.



      When I type cpupower frequency-info I get a lot of information. I just want to get the governor, just like "ondemand" with no more information, to use its value in a program.







      linux power-management






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 20 '18 at 3:48









      Jeff Schaller

      43.4k1160140




      43.4k1160140










      asked Feb 3 '15 at 16:35









      user3379482user3379482

      2551211




      2551211






















          2 Answers
          2






          active

          oldest

          votes


















          21














          The current governor can be obtained as follows:



          cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


          Note that cpu* will give you the scaling governor of all your cores and not just e.g. cpu0.



          This solution might be system dependent, though. I'm not 100% sure this is portable.






          share|improve this answer





















          • 1





            Working in Fedora 23! With cpupower frequency-info --governors you can see the governors and with cpupower frequency-info --governor <gov> you can set it.

            – Facundo Victor
            May 23 '16 at 18:21





















          1














          In the latest Fedora release (26 alpha) on my Ryzen 7 system, I did this:



          Fedora 26 alpha didn't have cpupower installed - so get it:



          dnf install kernel-tools


          This installs /etc/sysconfig/cpupower which should set performance level by default (edit the first line if you want a different level):



          CPUPOWER_START_OPTS="frequency-set -g performance"
          CPUPOWER_STOP_OPTS="frequency-set -g ondemand"


          Now the critical bit - enable and start the cpupower service



          systemctl enable --now cpupower


          Confirm that performance level is set:



          cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


          Reboot and repeat that cat command to confirm still performance






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f182696%2fhow-to-get-current-cpupower-governor%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            21














            The current governor can be obtained as follows:



            cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


            Note that cpu* will give you the scaling governor of all your cores and not just e.g. cpu0.



            This solution might be system dependent, though. I'm not 100% sure this is portable.






            share|improve this answer





















            • 1





              Working in Fedora 23! With cpupower frequency-info --governors you can see the governors and with cpupower frequency-info --governor <gov> you can set it.

              – Facundo Victor
              May 23 '16 at 18:21


















            21














            The current governor can be obtained as follows:



            cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


            Note that cpu* will give you the scaling governor of all your cores and not just e.g. cpu0.



            This solution might be system dependent, though. I'm not 100% sure this is portable.






            share|improve this answer





















            • 1





              Working in Fedora 23! With cpupower frequency-info --governors you can see the governors and with cpupower frequency-info --governor <gov> you can set it.

              – Facundo Victor
              May 23 '16 at 18:21
















            21












            21








            21







            The current governor can be obtained as follows:



            cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


            Note that cpu* will give you the scaling governor of all your cores and not just e.g. cpu0.



            This solution might be system dependent, though. I'm not 100% sure this is portable.






            share|improve this answer















            The current governor can be obtained as follows:



            cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


            Note that cpu* will give you the scaling governor of all your cores and not just e.g. cpu0.



            This solution might be system dependent, though. I'm not 100% sure this is portable.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 22 at 22:07









            Community

            1




            1










            answered Feb 3 '15 at 16:44









            MarcoMarco

            25.4k783120




            25.4k783120








            • 1





              Working in Fedora 23! With cpupower frequency-info --governors you can see the governors and with cpupower frequency-info --governor <gov> you can set it.

              – Facundo Victor
              May 23 '16 at 18:21
















            • 1





              Working in Fedora 23! With cpupower frequency-info --governors you can see the governors and with cpupower frequency-info --governor <gov> you can set it.

              – Facundo Victor
              May 23 '16 at 18:21










            1




            1





            Working in Fedora 23! With cpupower frequency-info --governors you can see the governors and with cpupower frequency-info --governor <gov> you can set it.

            – Facundo Victor
            May 23 '16 at 18:21







            Working in Fedora 23! With cpupower frequency-info --governors you can see the governors and with cpupower frequency-info --governor <gov> you can set it.

            – Facundo Victor
            May 23 '16 at 18:21















            1














            In the latest Fedora release (26 alpha) on my Ryzen 7 system, I did this:



            Fedora 26 alpha didn't have cpupower installed - so get it:



            dnf install kernel-tools


            This installs /etc/sysconfig/cpupower which should set performance level by default (edit the first line if you want a different level):



            CPUPOWER_START_OPTS="frequency-set -g performance"
            CPUPOWER_STOP_OPTS="frequency-set -g ondemand"


            Now the critical bit - enable and start the cpupower service



            systemctl enable --now cpupower


            Confirm that performance level is set:



            cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


            Reboot and repeat that cat command to confirm still performance






            share|improve this answer






























              1














              In the latest Fedora release (26 alpha) on my Ryzen 7 system, I did this:



              Fedora 26 alpha didn't have cpupower installed - so get it:



              dnf install kernel-tools


              This installs /etc/sysconfig/cpupower which should set performance level by default (edit the first line if you want a different level):



              CPUPOWER_START_OPTS="frequency-set -g performance"
              CPUPOWER_STOP_OPTS="frequency-set -g ondemand"


              Now the critical bit - enable and start the cpupower service



              systemctl enable --now cpupower


              Confirm that performance level is set:



              cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


              Reboot and repeat that cat command to confirm still performance






              share|improve this answer




























                1












                1








                1







                In the latest Fedora release (26 alpha) on my Ryzen 7 system, I did this:



                Fedora 26 alpha didn't have cpupower installed - so get it:



                dnf install kernel-tools


                This installs /etc/sysconfig/cpupower which should set performance level by default (edit the first line if you want a different level):



                CPUPOWER_START_OPTS="frequency-set -g performance"
                CPUPOWER_STOP_OPTS="frequency-set -g ondemand"


                Now the critical bit - enable and start the cpupower service



                systemctl enable --now cpupower


                Confirm that performance level is set:



                cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


                Reboot and repeat that cat command to confirm still performance






                share|improve this answer















                In the latest Fedora release (26 alpha) on my Ryzen 7 system, I did this:



                Fedora 26 alpha didn't have cpupower installed - so get it:



                dnf install kernel-tools


                This installs /etc/sysconfig/cpupower which should set performance level by default (edit the first line if you want a different level):



                CPUPOWER_START_OPTS="frequency-set -g performance"
                CPUPOWER_STOP_OPTS="frequency-set -g ondemand"


                Now the critical bit - enable and start the cpupower service



                systemctl enable --now cpupower


                Confirm that performance level is set:



                cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


                Reboot and repeat that cat command to confirm still performance







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 20 '17 at 6:42









                jasonwryan

                50.4k14135189




                50.4k14135189










                answered May 20 '17 at 6:36









                user237862user237862

                111




                111






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f182696%2fhow-to-get-current-cpupower-governor%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                    is 'sed' thread safe

                    How to make a Squid Proxy server?