All of lore.kernel.org
 help / color / mirror / Atom feed
* Voltage control on Southern Island GPU using radeon driver
@ 2021-08-23  1:56 Evans Jahja
  2021-08-23  6:25 ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Evans Jahja @ 2021-08-23  1:56 UTC (permalink / raw)
  To: amd-gfx

[-- Attachment #1: Type: text/plain, Size: 2297 bytes --]

Hi, I have a HAINAN GPU below:

lspci -nn
0a:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI]
Sun LE [Radeon HD 8550M / R5 M230] [1002:666f]

I run linux 5.13.12 on Arch on a Lenovo B40-70 laptop.

I'm trying to understand more on how voltage control works and how I can
modify the voltage for doing overvoltage / undervoltage on my GPU. The
reason is I am observing how running programs under high GPU load (glmark2)
would lead to crashes when I use dpm=1 in either radeon or amdgpu driver,
which seems to happen when I am reaching power level 4 (sclk 900MHz), while
a lighter program like glxgears could run and switch power levels  between
0,1,2 without issue under both drivers. I believe my laptop might be
faulty, but I would like to take this opportunity to try fixing it from the
driver's side so that it can run anyway, however limited.

Right now, I have managed to increase the performance of my GPU by manually
overwriting the sclk to 630MHz in all performance_levels in radeon_pm.c,
which surprises me as overriding the clock was not possible for me to do
previously via sysfs.

I've managed to tweak both sclk and mclk (or so I believe), but I still
cannot tweak the voltage (vddc). The reason is, if I increase the sclk to
650MHz, the lockup will happen again. Changing the pl->vddc  variable does
not seem to do anything. After various tracing with printk, I understand
that on my system:

pi->voltage_control = radeon_atom_is_voltage_gpio(rdev,
SET_VOLTAGE_TYPE_ASIC_VDDC,
   VOLTAGE_OBJ_GPIO_LUT)

this returns false, while:

si_pi->voltage_control_svi2 =
radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC,
   VOLTAGE_OBJ_SVID2);

This returns true, so I believe my system is using SVI2 somehow to set the
voltage. Having no experience with SVI2, I read online and found out that
SVI2 is a voltage regulator that uses Data / Clock pins to clock-in 8 bits
of information and convert it to some voltage value between OFF, 0.5V ->
1.5V, offering fine control based on some look up table.

My questions are as follows:
Is it possible for me to modify my system so that I can manually adjust the
voltage to my GPU?

Thank you very much in advance. This is the first time I deal with kernel
drivers, so any guidance on the matter helps a lot.

- Evans

[-- Attachment #2: Type: text/html, Size: 2733 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Voltage control on Southern Island GPU using radeon driver
  2021-08-23  1:56 Voltage control on Southern Island GPU using radeon driver Evans Jahja
@ 2021-08-23  6:25 ` Christian König
  2021-08-23  7:11   ` Feng, Kenneth
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2021-08-23  6:25 UTC (permalink / raw)
  To: Evans Jahja, amd-gfx

Hi Evans,

in general the voltage tables are stored in the atombios and the best 
advice I can give you is to first double check if there isn't an updated 
BIOS for your hardware.

But Alex is the expert on power management, especially for those older 
hardware generations. Maybe he has another idea what to try.

Regards,
Christian.

Am 23.08.21 um 03:56 schrieb Evans Jahja:
> Hi, I have a HAINAN GPU below:
>
> lspci -nn
> 0a:00.0 Display controller [0380]: Advanced Micro Devices, Inc. 
> [AMD/ATI] Sun LE [Radeon HD 8550M / R5 M230] [1002:666f]
>
> I run linux 5.13.12 on Arch on a Lenovo B40-70 laptop.
>
> I'm trying to understand more on how voltage control works and how I 
> can modify the voltage for doing overvoltage / undervoltage on my GPU. 
> The reason is I am observing how running programs under high GPU load 
> (glmark2) would lead to crashes when I use dpm=1 in either radeon or 
> amdgpu driver, which seems to happen when I am reaching power level 4 
> (sclk 900MHz), while a lighter program like glxgears could run and 
> switch power levels  between 0,1,2 without issue under both drivers. I 
> believe my laptop might be faulty, but I would like to take this 
> opportunity to try fixing it from the driver's side so that it can run 
> anyway, however limited.
>
> Right now, I have managed to increase the performance of my GPU by 
> manually overwriting the sclk to 630MHz in all performance_levels in 
> radeon_pm.c, which surprises me as overriding the clock was not 
> possible for me to do previously via sysfs.
>
> I've managed to tweak both sclk and mclk (or so I believe), but I 
> still cannot tweak the voltage (vddc). The reason is, if I increase 
> the sclk to 650MHz, the lockup will happen again. Changing the 
> pl->vddc  variable does not seem to do anything. After various tracing 
> with printk, I understand that on my system:
>
> pi->voltage_control = radeon_atom_is_voltage_gpio(rdev, 
> SET_VOLTAGE_TYPE_ASIC_VDDC,
>    VOLTAGE_OBJ_GPIO_LUT)
>
> this returns false, while:
>
> si_pi->voltage_control_svi2 =
> radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC,
>    VOLTAGE_OBJ_SVID2);
>
> This returns true, so I believe my system is using SVI2 somehow to set 
> the voltage. Having no experience with SVI2, I read online and found 
> out that SVI2 is a voltage regulator that uses Data / Clock pins to 
> clock-in 8 bits of information and convert it to some voltage value 
> between OFF, 0.5V -> 1.5V, offering fine control based on some look up 
> table.
>
> My questions are as follows:
> Is it possible for me to modify my system so that I can manually 
> adjust the voltage to my GPU?
>
> Thank you very much in advance. This is the first time I deal with 
> kernel drivers, so any guidance on the matter helps a lot.
>
> - Evans
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Voltage control on Southern Island GPU using radeon driver
  2021-08-23  6:25 ` Christian König
@ 2021-08-23  7:11   ` Feng, Kenneth
  0 siblings, 0 replies; 3+ messages in thread
From: Feng, Kenneth @ 2021-08-23  7:11 UTC (permalink / raw)
  To: Koenig, Christian, Evans Jahja, amd-gfx

[AMD Official Use Only]

Hi Evans
I'm sorry but I don't suggest you manually control the standalone voltage because it's predefined with the clock value.
A decrease of voltage could hit the hardware critical path. You may need to change the clock and voltage together, we call it dpm level change.
Thanks.
 

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Christian König
Sent: Monday, August 23, 2021 2:26 PM
To: Evans Jahja <evansjahja13@gmail.com>; amd-gfx@lists.freedesktop.org
Subject: Re: Voltage control on Southern Island GPU using radeon driver

[CAUTION: External Email]

Hi Evans,

in general the voltage tables are stored in the atombios and the best advice I can give you is to first double check if there isn't an updated BIOS for your hardware.

But Alex is the expert on power management, especially for those older hardware generations. Maybe he has another idea what to try.

Regards,
Christian.

Am 23.08.21 um 03:56 schrieb Evans Jahja:
> Hi, I have a HAINAN GPU below:
>
> lspci -nn
> 0a:00.0 Display controller [0380]: Advanced Micro Devices, Inc.
> [AMD/ATI] Sun LE [Radeon HD 8550M / R5 M230] [1002:666f]
>
> I run linux 5.13.12 on Arch on a Lenovo B40-70 laptop.
>
> I'm trying to understand more on how voltage control works and how I 
> can modify the voltage for doing overvoltage / undervoltage on my GPU.
> The reason is I am observing how running programs under high GPU load
> (glmark2) would lead to crashes when I use dpm=1 in either radeon or 
> amdgpu driver, which seems to happen when I am reaching power level 4 
> (sclk 900MHz), while a lighter program like glxgears could run and 
> switch power levels  between 0,1,2 without issue under both drivers. I 
> believe my laptop might be faulty, but I would like to take this 
> opportunity to try fixing it from the driver's side so that it can run 
> anyway, however limited.
>
> Right now, I have managed to increase the performance of my GPU by 
> manually overwriting the sclk to 630MHz in all performance_levels in 
> radeon_pm.c, which surprises me as overriding the clock was not 
> possible for me to do previously via sysfs.
>
> I've managed to tweak both sclk and mclk (or so I believe), but I 
> still cannot tweak the voltage (vddc). The reason is, if I increase 
> the sclk to 650MHz, the lockup will happen again. Changing the
> pl->vddc  variable does not seem to do anything. After various tracing
> with printk, I understand that on my system:
>
> pi->voltage_control = radeon_atom_is_voltage_gpio(rdev,
> SET_VOLTAGE_TYPE_ASIC_VDDC,
>    VOLTAGE_OBJ_GPIO_LUT)
>
> this returns false, while:
>
> si_pi->voltage_control_svi2 =
> radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC,
>    VOLTAGE_OBJ_SVID2);
>
> This returns true, so I believe my system is using SVI2 somehow to set 
> the voltage. Having no experience with SVI2, I read online and found 
> out that SVI2 is a voltage regulator that uses Data / Clock pins to 
> clock-in 8 bits of information and convert it to some voltage value 
> between OFF, 0.5V -> 1.5V, offering fine control based on some look up 
> table.
>
> My questions are as follows:
> Is it possible for me to modify my system so that I can manually 
> adjust the voltage to my GPU?
>
> Thank you very much in advance. This is the first time I deal with 
> kernel drivers, so any guidance on the matter helps a lot.
>
> - Evans
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-23  7:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23  1:56 Voltage control on Southern Island GPU using radeon driver Evans Jahja
2021-08-23  6:25 ` Christian König
2021-08-23  7:11   ` Feng, Kenneth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.