Announcement

Collapse
No announcement yet.

Patch for ati gpu.freq

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Patch for ati gpu.freq

    Applies to master and trondheim-12.

    Fixes which frequencies are read and corrects a bug in stock3d parser which always returns no data.

    Code:
    diff --git a/pts-core/functions/pts-functions_system_graphics.php b/pts-core/functions/pts-functions_system_graphics.php
    index 4b16d8e..f36d1e4 100644
    --- a/pts-core/functions/pts-functions_system_graphics.php
    +++ b/pts-core/functions/pts-functions_system_graphics.php
    @@ -23,7 +23,7 @@
    
     function graphics_frequency_string()
     {
    -       $freq = graphics_processor_frequency();
    +       $freq = graphics_processor_stock_frequency();
            $freq_string = $freq[0] . '/' . $freq[1];
    
            if($freq_string == "0/0")
    @@ -186,7 +186,7 @@ function graphics_processor_frequency()
            $mem_freq = 0;
    
            $nv_freq = read_nvidia_extension("GPUCurrentClockFreqs");
    -       $ati_freq = read_ati_extension("Stock3DFrequencies");
    +       $ati_freq = read_ati_extension("Current3DFrequencies");
    
            if(!empty($nv_freq)) // NVIDIA GPU
            {
    diff --git a/pts-core/functions/pts-functions_system_parsing.php b/pts-core/functions/pts-functions_system_parsing.php
    index fa0d899..e53cfe1 100644
    --- a/pts-core/functions/pts-functions_system_parsing.php
    +++ b/pts-core/functions/pts-functions_system_parsing.php
    @@ -198,12 +198,12 @@ function read_ati_extension($attribute)
            else if("Stock3DFrequencies" == $attribute)
            {
                            $info = shell_exec("aticonfig --pplib-cmd \"get clock\" 2>&1");
    -                       if(($pos = strpos($info, "Engine")) > 0)
    +                       if(($pos = strpos($info, "ngine")) > 0)
                            {
    -                               $core_info = substr($info, strpos($info, "-") + 2);
    +                               $core_info = substr($info, strpos($info, "-") + 1);
                                    $core_info = substr($core_info, 0, strpos($core_info, " "));
                                    $mem_info = substr($info, strpos($info, "Memory Clock"));
    -                               $mem_info = substr($mem_info, strpos($mem_info, "-") + 2);
    +                               $mem_info = substr($mem_info, strpos($mem_info, "-") + 1);
                                    $mem_info = trim(substr($mem_info, 0, strpos($mem_info, " ")));
                                    $ati_info = $core_info . "," . $mem_info;
                            }

  • #2
    Found in git with one exception... In graphics_frequency_string() you change graphics_processor_frequency() to graphics_processor_stock_frequency(). What's your reasoning behind this? graphics_frequency_string() is used as part of the display within the PTS Results Viewer for showing the frequency the card operated at. If it's overclocked, that should be shown there.
    Michael Larabel
    https://www.michaellarabel.com/

    Comment


    • #3
      If you use graphics_processor_frequency on (new) ATI cards it will always report the current frequency, which is not particularly useful for system-info as you'll get the idle frequencies (i.e. when powerplay is enabled). If this interferes with nvidia clock reporting then this is a problem, and I'll have to think of some other way of making sure the correct frequencies are returned reliably.

      Comment

      Working...
      X