zenpower icon indicating copy to clipboard operation
zenpower copied to clipboard

Support for 19h family

Open tiburcillo opened this issue 4 years ago • 119 comments

Would it be a lot of work to add support for the Zen3 family? I love zenpower on my 2700x, would be cool if my 5600x would also be supported.

Thanks, t

tiburcillo avatar Nov 28 '20 22:11 tiburcillo

I was also wondering about this.

Currently doesn't work with 5000 series, which isn't that surprising, but I was still hoping it would, since k10temp is just flatout useless with Ryzen 5000 as well.

It worked perfectly with the 3800X on this same motherboard (X570 Taichi) which has the Nuvaton SuperIO chip.

gardotd426 avatar Dec 07 '20 14:12 gardotd426

Would be absolutly great, if this works with the 5000 series!

JaffoS1 avatar Dec 07 '20 19:12 JaffoS1

k10temp supports Zen3 from kernel >=5.10.

abucodonosor avatar Dec 21 '20 19:12 abucodonosor

k10temp supports Zen3 from kernel >=5.10.

Yeah. It gives Tdie and Tctl temps. That's literally it.

zenpower gives detailed voltage and power draw readings. None of that is available in k10temp.

This is literally all you get for CPU in k10temp on 5.10 for Zen 3:

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +32.8°C
Tdie:         +32.8°C

Pretty lackluster. There's a reason we're asking for zenpower support. I made my above comment while running 5.10, so I was already well aware of how well it "works" with 5.10.

gardotd426 avatar Dec 21 '20 20:12 gardotd426

Oh no, Vcore or Isoc etc for ZEN3 in 5.10?

Well, I can try to add that support but I'm not really familiar with that code. I can look at what 5.10 did and add the IDs, and then change the logic in zenpower_probe().. However, I cannot guarantee that is accurate or will work.

Give me some minutes to figure that :)

abucodonosor avatar Dec 21 '20 22:12 abucodonosor

@gardotd426

Are you willing to test this patch?

https://crazy.dev.frugalware.org/ZEN3-test.patch

abucodonosor avatar Dec 21 '20 22:12 abucodonosor

Yep. Tested it, no dice.

From skimming zenpower.c, it seems there's a lot of other areas where support would need to be added, just adding those few lines wouldn't seem to be enough (granted, my knowledge of how zenpower works is limited so this might not be the case).

But yeah, I get the exact same output as before.

zenpower-pci-00c3
Adapter: PCI adapter
Tdie:         +73.5°C  (high = +95.0°C)
Tctl:         +73.5°C

And that much worked without the patch, too (meaning that replacing k10temp w/zenpower gave me the same info just named as zenpower instead of k10temp).

gardotd426 avatar Dec 21 '20 22:12 gardotd426

No, there is not much else, it just means the PLANE address is wrong for ZEN3 or the model IDs or both, and that includes the kernel itself. Someone with ZEN3 HW should report to lkml I guess.

There is no support whatso ever for fam 19h in zenpower before the patch, what means it got defaults and it seems to get defaults even now with fam19h added.

Btw are you sure you rmmod zenpower before loading the patched one?

abucodonosor avatar Dec 21 '20 22:12 abucodonosor

@gardotd426

I think I missed something.. in my patch change data->zen3 = true; to data->zen2 = true, just to test something, the address and calculation look the same on both zen2 & zen3 so it should not really matter.

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

I'm sure I loaded the right zenpower because I didn't even have it installed before this patch, I'd uninstalled it because it was useless, and was using k10temp. I rmmod-ed k10temp and loaded zenpower after installing. I'll try editing the patch and running again.

gardotd426 avatar Dec 21 '20 23:12 gardotd426

Same result, unfortunately. If I knew exactly what was missing I'd bug the guys @ lkml

gardotd426 avatar Dec 21 '20 23:12 gardotd426

@gardotd426

k10temp should have Vcore etc. I'll try to find out myself the right offsets for ZEN3, bc I think there is something missing even in mainline.

Unfortunately, I don't have a ZEN3 box yet, prices for a 5950x are way too insane right now :)

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

Hahah yeah trust me I get it, I was going for the 5900X but you can't buy one anywhere (and I refuse to encourage scalpers), and the only way I could even get the 5800X @ MSRP was through a Newegg combo deal (they aren't selling them individually hardly at all) w/ a 500GB Samsung 980 Pro even though all three of my NVME slots are already taken up with 1GB NVMEs, so I just sold the 980 Pro on ebay for like 10 bucks less than I paid for it.

I still might get a 5900X later for the cores, but a 5800X is perfectly fine and in gaming it's pretty much the same as the 5900X and it definitely doesn't bottleneck my RTX 3090.

If you need help or testing or anything like that I'm happy to do it

gardotd426 avatar Dec 21 '20 23:12 gardotd426

@gardotd426

Out of curiosity, what does the kernel report on the CPU?

Something like this should tell:

dmesg | grep CPU0: | grep smpboot

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

Output for 5900X: [ 0.111779] smpboot: CPU0: AMD Ryzen 9 5900X 12-Core Processor (family: 0x19, model: 0x21, stepping: 0x0)

hattedsquirrel avatar Dec 21 '20 23:12 hattedsquirrel

[ 0.109997] smpboot: CPU0: AMD Ryzen 7 5800X 8-Core Processor (family: 0x19, model: 0x21, stepping: 0x0)

gardotd426 avatar Dec 21 '20 23:12 gardotd426

I think I see the bug :)

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

?

gardotd426 avatar Dec 21 '20 23:12 gardotd426

@gardotd426

give me a moment to create some theoretical patch just to see if it starts working.

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

Alrighty

gardotd426 avatar Dec 21 '20 23:12 gardotd426

?

Somone committed with the stepping ids :) But the data want the model

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

Yeah, just tried out your idea, and it's now working. Copy and paste is broken on Firefox Wayland for some reason right now, but there's a heap of data now.

EDIT:

SVI2_Core:     1.55 V
SVI2_SoC:      1.48 V
Tdie:         +44.6°C  (high = +95.0°C)
Tctl:         +44.6°C
Tccd1:        +39.8°C
Tccd2:        +38.0°C
SVI2_P_Core:   0.00 W
SVI2_P_SoC:   17.56 W
SVI2_C_Core:   0.00 A
SVI2_C_SoC:   15.87 A

aqxa1 avatar Dec 21 '20 23:12 aqxa1

Yeah, just tried out your idea, and it's now working. Copy and paste is broken on Firefox Wayland for some reason right now, but there's a heap of data now.

What did you do?

gardotd426 avatar Dec 21 '20 23:12 gardotd426

@gardotd426

https://crazy.dev.frugalware.org/ZEN3-test2.patch

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

Yeah, just tried out your idea, and it's now working. Copy and paste is broken on Firefox Wayland for some reason right now, but there's a heap of data now.

EDIT:

SVI2_Core:     1.55 V
SVI2_SoC:      1.48 V
Tdie:         +44.6°C  (high = +95.0°C)
Tctl:         +44.6°C
Tccd1:        +39.8°C
Tccd2:        +38.0°C
SVI2_P_Core:   0.00 W
SVI2_P_SoC:   17.56 W
SVI2_C_Core:   0.00 A
SVI2_C_SoC:   15.87 A

Yes is broken in the kernel the same way.

I wondered why it pulls default code at all, that is bc the switch(...) data is wrong

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

@abucodonosor With your new patch, it now does something:

# sensors zenpower-*
zenpower-pci-00c3
Adapter: PCI adapter
SVI2_Core:     1.55 V
SVI2_SoC:    925.00 mV
Tdie:         +30.4°C  (high = +95.0°C)
Tctl:         +30.4°C
Tccd1:        +27.5°C
Tccd2:        +29.0°C
SVI2_P_Core:   0.00 W
SVI2_P_SoC:  543.90 mW
SVI2_C_Core:   0.00 A
SVI2_C_SoC:  882.00 mA

hattedsquirrel avatar Dec 21 '20 23:12 hattedsquirrel

Should we file a bug w/ the kernel?

On Mon, Dec 21, 2020 at 6:49 PM abucodonosor [email protected] wrote:

Yeah, just tried out your idea, and it's now working. Copy and paste is broken on Firefox Wayland for some reason right now, but there's a heap of data now.

EDIT:

SVI2_Core: 1.55 V

SVI2_SoC: 1.48 V

Tdie: +44.6°C (high = +95.0°C)

Tctl: +44.6°C

Tccd1: +39.8°C

Tccd2: +38.0°C

SVI2_P_Core: 0.00 W

SVI2_P_SoC: 17.56 W

SVI2_C_Core: 0.00 A

SVI2_C_SoC: 15.87 A

Yes is broken in the kernel the same way.

I wondered why it pulls default code at all, that is bc the switch(...) data is wrong

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ocerman/zenpower/issues/39#issuecomment-749258265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM5Y334YCCV5X3O2C5CACULSV7NJNANCNFSM4UGCUEKA .

gardotd426 avatar Dec 21 '20 23:12 gardotd426

@gardotd426

Yes, and the fix is simple for the kernel, this:


diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index a250481b5a97..0b4e61bf90f7 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -541,7 +541,7 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                data->is_zen = true;
 
                switch (boot_cpu_data.x86_model) {
-               case 0x0 ... 0x1:       /* Zen3 */
+               case 0x21:      /* Zen3 */
                        data->show_current = true;
                        data->svi_addr[0] = F19H_M01_SVI_TEL_PLANE0;
                        data->svi_addr[1] = F19H_M01_SVI_TEL_PLANE1;

Someone may try and confirm k10temp working too :)

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

So still some offset ( maybe ) wrong, it may be from ZEN2 code need to check but can't see what is it right now.

SVI2_P_Core: 0.00 W SVI2_C_Core: 0.00 A

Does this do something under load?

abucodonosor avatar Dec 21 '20 23:12 abucodonosor

k10temp working:

k10temp-pci-00c3
Adapter: PCI adapter
Vcore:         1.55 V
Vsoc:        975.00 mV
Tctl:         +53.2°C
Tdie:         +53.2°C
Tccd1:        +44.8°C
Tccd2:        +40.5°C
Icore:         0.00 A
Isoc:          4.96 A

Looks to be a bit less data than Zenpower, though.

aqxa1 avatar Dec 21 '20 23:12 aqxa1