Announcement

Collapse
No announcement yet.

Underclocking/undervolting the RX 470 with AMDGPU-PRO : success

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

  • #11
    I try to control gpu momery clock
    use this Code:
    echo 10 > /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/pp_mclk_od
    But not work for RX480
    and it reduce to 300hz
    0: 300Mhz *
    1: 2200Mhz

    what shall I do

    Comment


    • #12
      Originally posted by el101 View Post
      Great working, thank you cde1. With this guide, my RX480 and R9 nano both work stable.
      RX480 working at 1100@800mv
      R9 nano working at 850@950mv
      Just a little question.
      I wonder you could help me how to raise GPU menery frequency.
      Thanks a lot.
      Hi,

      Thank you for the kind words. However please note this patch probably has no effect on your R9 Nano, since it only modifies the SMC for Polaris 10.

      Originally posted by el101 View Post
      I try to control gpu momery clock
      use this Code:
      echo 10 > /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/pp_mclk_od
      But not work for RX480
      and it reduce to 300hz
      0: 300Mhz *
      1: 2200Mhz

      what shall I do
      Actually only 0 and 1 values above will work ; I don't think 10 would work, it's not in the list. But isn't 2200 already an overclock from the stock 2000? What you need is to force a specific memory clock. The easiest way would be to use PolarisBiosEditor in Windows, set the desired maximum memory clock then flash it, the amdgpu-pro driver will I think automatically use it. Alternatively you should be able to force this new memory clock with
      Code:
      echo 1 > /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/pp_mclk_od

      Comment


      • #13
        I have tried to find the polaris10_smc.c file, but if I open the directory, there are only the files below:

        :/usr/src/amdgpu-pro-16.40-348864/amd/powerplay/smumgr$ ls -l
        total 152
        -rw-r--r-- 1 root root 24986 Okt 25 03:01 cz_smumgr.c
        -rw-r--r-- 1 root root 3532 Okt 25 03:01 cz_smumgr.h
        -rw-r--r-- 1 root root 33047 Okt 25 03:01 fiji_smumgr.c
        -rw-r--r-- 1 root root 2063 Okt 25 03:01 fiji_smumgr.h
        -rw-r--r-- 1 root root 306 Okt 25 03:01 Makefile
        -rw-r--r-- 1 root root 33460 Okt 25 03:01 polaris10_smumgr.c
        -rw-r--r-- 1 root root 2371 Okt 25 03:01 polaris10_smumgr.h
        -rw-r--r-- 1 root root 6670 Okt 25 03:01 smumgr.c
        -rw-r--r-- 1 root root 22908 Okt 25 03:01 tonga_smumgr.c
        -rw-r--r-- 1 root root 1952 Okt 25 03:01 tonga_smumgr.h

        Ubuntu version:
        Distributor ID: Ubuntu
        Description: Ubuntu 16.04.1 LTS
        Release: 16.04
        Codename: xenial

        Do I need another version of amdgpu-pro?

        Comment


        • #14
          Hi,cde1.

          Thank you for reply my question.


          Originally posted by cde1 View Post

          Thank you for the kind words. However please note this patch probably has no effect on your R9 Nano, since it only modifies the SMC for Polaris 10.
          With your genius idea, I edited fiji_smc.c like your polaris10_sm.c and for making it stable, I tried many times.
          Finally, I edited line 114 like this
          Code:
                                 *voltage = (*voltage & 0xFFFF0000) + 950*VOLTAGE_SCALE;
          edited line 773 like this.
          Code:
                          dpm_table->sclk_table.dpm_levels[i].value -= (15 * clk) / 100;
          And it work fine.

          And for these days I edited polaris10_sm.c like this
          line 114
          Code:
                                  *voltage = (*voltage & 0xFFFF0000) + 800*VOLTAGE_SCALE;
          line 773
          Code:
                          dpm_table->sclk_table.dpm_levels[i].value -= (3 * clk) / 100;
          Code:
          0: 282Mhz
          1: 572Mhz
          2: 856Mhz
          3: 1013Mhz
          4: 1077Mhz
          5: 1120Mhz
          6: 1162Mhz
          7: 1228Mhz *
          It work fine, but I don't know whether it undervolt, I will test it in next days.
          Originally posted by cde1
          Actually only 0 and 1 values above will work ; I don't think 10 would work, it's not in the list. But isn't 2200 already an overclock from the stock 2000? What you need is to force a specific memory clock. The easiest way would be to use PolarisBiosEditor in Windows, set the desired maximum memory clock then flash it, the amdgpu-pro driver will I think automatically use it. Alternatively you should be able to force this new memory clock with
          Code:
          echo 1 > /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/pp_mclk_od
          Thank you for your suggestion.
          I wander how to controlling max memory clock like you controlling max core clock. My gpu bios cannot be flashed, I got the cheap one. lol
          This command will change gpu max memory clock from 2000 to 2200.
          Code:
          echo 10 > /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/pp_mclk_od
          But when I use it, memory clock lock at the lowest option.

          In windows, some software like wattman & SAPPHIRE TriXX OC Utility can control max memory clock.
          In linux, the memory clock control option is somewhere in the AMDGPU-PRO drivers, like core clock and volt control option you find, I think.
          I want to find and edit it, make it into linux kernel. It will work fine.
          I wander how to...
          Last edited by el101; 04 February 2017, 12:07 PM.

          Comment


          • #15
            So my best guess is that by modifying the function polaris10_populate_all_memory_levels() in a manner similar to polaris10_populate_all_graphic_levels() you should be able to change the memory clocks. First try to printk() the value of i and dpm_table->mclk_table.dpm_levels[i].value to see what to alter, then try to change this value based on your overclocking goal, right after the ASSERT but before the call to polaris10_populate_single_memory_level().

            Regarding power consumption, what I found is that my patch is not perfect: it seems wattman in Windows, with the same clock/voltages, leads to lower consumption compared to Linux. I'm thinking the reason for this is that the memory, which I underclock in wattman to 820mV, is not underclocked in Linux. So I'm going to do more tests.

            Comment


            • #16
              Originally posted by cde1 View Post
              So my best guess is that by modifying the function polaris10_populate_all_memory_levels() in a manner similar to polaris10_populate_all_graphic_levels() you should be able to change the memory clocks. First try to printk() the value of i and dpm_table->mclk_table.dpm_levels[i].value to see what to alter, then try to change this value based on your overclock[[ing goal, right after the ASSERT but before the call to polaris10_populate_single_memory_level().
              Thank you for your reply and suggestions.
              I add 2 line in code
              Code:
                              printk(KERN_ALERT "\ndpm_table->mclk_table.dpm_levels[i].value=%d",dpm_table->mclk_table.dpm_levels[i].value);
                              printk(KERN_ALERT "\ni=%d",i);
              You are absolutely right.

              This is result
              Code:
              dpm_table->mclk_table.dpm_levels[i].value=30000
              i=0
              dpm_table->mclk_table.dpm_levels[i].value=200000
              i=1
              Then I try to change it. And finnally, it worked.

              Code:
              0: 306Mhz 
              1: 2020Mhz *
              I will do more tests.

              Thanks again!
              Last edited by el101; 07 February 2017, 01:02 AM.

              Comment


              • #17
                Originally posted by domti View Post
                I have tried to find the polaris10_smc.c file, but if I open the directory, there are only the files below:
                ...

                Do I need another version of amdgpu-pro?
                The version of amdgpu-pro-16.40 was the issue. I have upgraded to 16.50 and now I have the needed files. Thx @ cde1 for the instructions.

                Comment


                • #18
                  Hi, el101. I do some research these days. And mod roms with hex tools. Some cards work in undervoltage status, some not. So I rewrite some drivers for those cards.
                  I update my kernel to 4.10.0-041000-generic for mod rom.
                  when I remake drivers it errors.
                  Code:
                  cd /usr/src/amdgpu-pro-16.60-379184
                  ./pre-build.sh 4.10.0-041000-generic
                  make KERNELRELEASE=4.10.0-041000-generic -C /lib/modules/4.10.0-041000-generic/build M=/usr/src/amdgpu-pro-16.60-379184
                  find /lib/modules/4.10.0-041000-generic -name amdgpu.ko -exec rm -v {} \;
                  cp /usr/src/amdgpu-pro-16.60-379184/amd/amdgpu/amdgpu.ko /lib/modules/4.10.0-041000-generic/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko
                  depmod -a
                  update-initramfs -u
                  How to remake with kernel 4.10.0-041000-generic.
                  Please help.



                  Comment


                  • #19
                    The current 16.60 amdgpu-pro driver is not compatible with kernel 4.10 afaik. You must wait for a new driver which according to Bridgman shouldn't be too far off.

                    Comment


                    • #20
                      We try to put a driver out every 2 months, but I'm not sure the next release will support 4.10 though...
                      Test signature

                      Comment

                      Working...
                      X