Results 1 to 3 of 3

Thread: Patch for ati gpu.freq

  1. #1
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default 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. #2

    Default

    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.

  3. #3
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •