<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The sample code for capping power consumption by RAPL interface/driver in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/The-sample-code-for-capping-power-consumption-by-RAPL-interface/m-p/1065065#M5205</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to use RAPL for capping the power consumption but couldn't find any sample codes to do that. Codes from google/this forum are just using RAPL for measuring power/energy. Could anyone give me an example/demo code how to use RAPL for capping the power consumption of CPU?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Kevin&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2017 02:19:43 GMT</pubDate>
    <dc:creator>Kevin</dc:creator>
    <dc:date>2017-01-10T02:19:43Z</dc:date>
    <item>
      <title>The sample code for capping power consumption by RAPL interface/driver</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/The-sample-code-for-capping-power-consumption-by-RAPL-interface/m-p/1065065#M5205</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to use RAPL for capping the power consumption but couldn't find any sample codes to do that. Codes from google/this forum are just using RAPL for measuring power/energy. Could anyone give me an example/demo code how to use RAPL for capping the power consumption of CPU?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 02:19:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/The-sample-code-for-capping-power-consumption-by-RAPL-interface/m-p/1065065#M5205</guid>
      <dc:creator>Kevin</dc:creator>
      <dc:date>2017-01-10T02:19:43Z</dc:date>
    </item>
    <item>
      <title>Power capping on intel</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/The-sample-code-for-capping-power-consumption-by-RAPL-interface/m-p/1065066#M5206</link>
      <description>&lt;P&gt;Power capping on intel processors is all about writing correct values into a Model Specific Resistor (MSR).&lt;/P&gt;

&lt;P&gt;A very nice article on how to read and write MSRs can be found at&amp;nbsp;&lt;A href="http://www.mindfruit.co.uk/2012/11/a-linux-kernel-module-for.html"&gt;http://www.mindfruit.co.uk/2012/11/a-linux-kernel-module-for.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Next, the MSR addresses and the associated explanation can be found in section 14.9 (Chapter 14) of Software Developer Manual (vol 3b part 2) of Haswell. It also has the explanation for how to convert Watt value to bits and also the time interval in bits.&lt;/P&gt;

&lt;P&gt;The other easy way is to install the intel_rapl kernel module available at&amp;nbsp;&lt;A href="https://github.com/torvalds/linux/blob/master/drivers/powercap/intel_rapl.c"&gt;https://github.com/torvalds/linux/blob/master/drivers/powercap/intel_rapl.c&lt;/A&gt;. With this you can set power cap in watts for different domains.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 06:11:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/The-sample-code-for-capping-power-consumption-by-RAPL-interface/m-p/1065066#M5206</guid>
      <dc:creator>sbhal1</dc:creator>
      <dc:date>2017-02-03T06:11:05Z</dc:date>
    </item>
  </channel>
</rss>

