<?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 Power Gadget: PG_Shutdown when UsePMU=false still affects SW using PMU? in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/Power-Gadget-PG-Shutdown-when-UsePMU-false-still-affects-SW/m-p/1341318#M7985</link>
    <description>&lt;P&gt;CC&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/680"&gt;@Patrick_K_Intel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Greetings, and thanks again for your help earlier this week.&lt;/P&gt;
&lt;P&gt;I'm using Intel Power Gadget 3.7.0 on macOS.&lt;/P&gt;
&lt;P&gt;I have software using `PowerGadgetLib.h` which (depending on its condiguration) calls `PG_UsePMU(false)` before reading any samples. I can start and stop multiple instances of the software without issue when all of them set `PG_UsePMU(false)`. However, if any software is using the Power Gadget API without setting `PG_UsePMU(false)`, it starts getting errors as soon as any software calls `PG_Shutdown`, even when the software shutting down has set `PG_UsePMU(false)`. The instance that is using the PMU gets an error when calling `PG_ReadSample`: "ERROR: EnergyDriver_executeCommands [via readSample] returned 0xe00002bc".&lt;/P&gt;
&lt;P&gt;Is `PG_Shutdown` performing PMU operations regardless of `UsePMU`? I'd think it should only do so if the PMU was actually used. Similarly, if `PG_Initialize` also operates on the PMUs, perhaps a global `UsePMU` configuration is needed that can be set prior to initialization (which is required to call `PG_GetNumPackages` prior to calling `PG_UsePMU`).&lt;/P&gt;
&lt;P&gt;For example, the problem appears when running the Intel Power Gadget application in the background while also starting/stopping software that uses the Power Gadget API with `PG_UsePMU(false)`. Power Gadget silently fails to collect more samples after the other software calls `PG_Shutdown`. I presume that Power Gadget is using the PMU, and I don't see an option to disable its use. It would be nice if a user could run Power Gadget at the same time that other software is using its API with `PG_UsePMU(false)`.&lt;/P&gt;
&lt;P&gt;I suppose the questions are then:&lt;BR /&gt;What is the intended behavior?&lt;BR /&gt;Can the library be fixed/adjusted/extended to better support 1 PMU client alongside multiple non-PMU clients?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;-Connor&lt;/P&gt;</description>
    <pubDate>Fri, 03 Dec 2021 17:54:09 GMT</pubDate>
    <dc:creator>connorimes</dc:creator>
    <dc:date>2021-12-03T17:54:09Z</dc:date>
    <item>
      <title>Power Gadget: PG_Shutdown when UsePMU=false still affects SW using PMU?</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Power-Gadget-PG-Shutdown-when-UsePMU-false-still-affects-SW/m-p/1341318#M7985</link>
      <description>&lt;P&gt;CC&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/680"&gt;@Patrick_K_Intel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Greetings, and thanks again for your help earlier this week.&lt;/P&gt;
&lt;P&gt;I'm using Intel Power Gadget 3.7.0 on macOS.&lt;/P&gt;
&lt;P&gt;I have software using `PowerGadgetLib.h` which (depending on its condiguration) calls `PG_UsePMU(false)` before reading any samples. I can start and stop multiple instances of the software without issue when all of them set `PG_UsePMU(false)`. However, if any software is using the Power Gadget API without setting `PG_UsePMU(false)`, it starts getting errors as soon as any software calls `PG_Shutdown`, even when the software shutting down has set `PG_UsePMU(false)`. The instance that is using the PMU gets an error when calling `PG_ReadSample`: "ERROR: EnergyDriver_executeCommands [via readSample] returned 0xe00002bc".&lt;/P&gt;
&lt;P&gt;Is `PG_Shutdown` performing PMU operations regardless of `UsePMU`? I'd think it should only do so if the PMU was actually used. Similarly, if `PG_Initialize` also operates on the PMUs, perhaps a global `UsePMU` configuration is needed that can be set prior to initialization (which is required to call `PG_GetNumPackages` prior to calling `PG_UsePMU`).&lt;/P&gt;
&lt;P&gt;For example, the problem appears when running the Intel Power Gadget application in the background while also starting/stopping software that uses the Power Gadget API with `PG_UsePMU(false)`. Power Gadget silently fails to collect more samples after the other software calls `PG_Shutdown`. I presume that Power Gadget is using the PMU, and I don't see an option to disable its use. It would be nice if a user could run Power Gadget at the same time that other software is using its API with `PG_UsePMU(false)`.&lt;/P&gt;
&lt;P&gt;I suppose the questions are then:&lt;BR /&gt;What is the intended behavior?&lt;BR /&gt;Can the library be fixed/adjusted/extended to better support 1 PMU client alongside multiple non-PMU clients?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;-Connor&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 17:54:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Power-Gadget-PG-Shutdown-when-UsePMU-false-still-affects-SW/m-p/1341318#M7985</guid>
      <dc:creator>connorimes</dc:creator>
      <dc:date>2021-12-03T17:54:09Z</dc:date>
    </item>
  </channel>
</rss>

