sibradzic / amdgpu-clocks

Simple script to control power states of amdgpu driven GPUs
GNU General Public License v2.0
390 stars 43 forks source link

OD_VDDGFX_OFFSET does not work #55

Closed hostingnuggets closed 11 months ago

hostingnuggets commented 1 year ago

Hello, I have a Nitro 6700XT GPU on Ubuntu 22.04 LTS (5.15.0-25-generic kernel) and I am trying to undervolt it by -150mV but as far as I understand it does not do anything.

Here is by amdgpu-custom-state file:

OD_SCLK:
1: 1800Mhz
OD_MCLK:
1: 1000MHz
OD_VDDGFX_OFFSET:
-150mV
FORCE_PERF_LEVEL: manual

When running the amdgpu-clocks command there are no error messages and all other parameters get applied correctly (for example the CPU clock) but the undervolting simply does not seem to work.

I checked the hwmon/hwmon3/in0_input file of that specific GPU before and after running the script but the value does not change and stays at 843.

I am using version 22.20.50200 of the amdgpu drivers and applied the amdgpu.ppfeaturemask=0xffffffff kernel parameter at boot.

Am I doing something wrong? Or is this a bug maybe?

sibradzic commented 1 year ago

Hi @hostingnuggets , thanks for reporting.

On my 6600XT here I see no issue with setting OD_VDDGFX_OFFSET. I don't think the hwmon is a correct indicator when it comes to checking if voltage offset is correctly applied or not. What does your /sys/class/drm/card0/device/pp_od_clk_voltage (assuming your card is card0) say after amdgpu-clocks applies the custom state?

Also, Ubuntu 22.04 + amdgpu (pro?) is not something I would feel too comfortable using for tuning the power/voltage settings of 6xx0 card. I strongly suggest you try something more recent like 23.04 with more recent vanilla kernel & linux-firmware or even some rolling distro.

hostingnuggets commented 1 year ago

Hi @sibradzic, thank you very much for taking the time for answering me. You are totally right I checked the /sys/class/drm/card1/device/pp_od_clk_voltage file after running your script and the change is correctly applied as you can see below:

OD_VDDGFX_OFFSET:
-150mV

I just thought this change would be reflect in that hwmon file I mention. My goal is actually to set the core voltage of my GPU to exactly 675mV. Maybe I am using the wrong parameter or even tool for that purpose. Would it maybe be possible with your other tool https://github.com/sibradzic/upp ?

sibradzic commented 1 year ago

I don't think you can force the voltage to a fixed value. A negative OD_VDDGFX_OFFSET will normally decrease the voltage value on the frequency-voltage curve, so that the card would use less power altogether, but it is still going to be a curve, meaning voltage ain't gonna be at fixed value at different frequencies. Using upp it may be possible to "flatten" the aforementioned curve, but I have never tried that. I think the best course of action in your case would be to use negative voltage offset + some conservative power limit, which would result in your card never exceeding certain voltage threshold.