ZenStates icon indicating copy to clipboard operation
ZenStates copied to clipboard

4000 series compatibility?

Open Freekers opened this issue 4 years ago • 30 comments

Hi! Are there any plans for Ryzen 4000 series compatibility in the near future? Thank you!

Freekers avatar May 14 '20 18:05 Freekers

~~I made a pull request. Unfortunately I don't have a windows build environment but I do have a 4800H to test. #10~~ I don't think just patching in the CPUID will work. The latest SMUDebugTool doesn't even run on my 4800H system.

alexantone avatar May 15 '20 21:05 alexantone

I also have a 4800H. If I can help, please let me know.

Freekers avatar May 16 '20 23:05 Freekers

@Freekers @alexantone

Hi, could you try this version? I'm not going to support the old one anymore. Version 2 is not finished and I've only implemented few things for now, but it should be better when done.

Leave the manual overclock function untouched for now (it won't do anything anyway) and test if it gets detected correctly and if the P-States work. Normally you would want to set DID lower than default to enable overclock mode. FID is recalculated automatically so you have the same target frequency (or as close as possible).

ZenStates_2.0.0_debug_20200529.zip

irusanov avatar May 29 '20 03:05 irusanov

Will do as soon as I get back home on Monday!

On May 29, 2020, 06:25, at 06:25, Ivan Rusanov [email protected] wrote:

@Freekers @alexantone

Hi, could you try this version? I'm not going to support the old one anymore. Version 2 is not finished and I've only implemented few things for now, but it should be better when done.

Leave the manual overclock function untouched for now (it won't do anything anyway) and test if it gets detected correctly and if the P-States work. Normally you would want to set DID lower than default to enable overclock mode. FID is recalculated automatically so you have the same target frequency (or as close as possible).

ZenStates_2.0.0_debug_20200529.zip

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/irusanov/ZenStates/issues/9#issuecomment-635735669

alexantone avatar May 29 '20 07:05 alexantone

It looks like this:

image

Only changed things are applied, e.g. if you don't change anything in the manual overclock section it gets ignored when Apply is clicked. Not very intuitive, I believe. Wondering how I could make it more user-friendly.

irusanov avatar May 29 '20 08:05 irusanov

I'm unsure what safe voltages would be for my 4800H. What would be your recommendation?

Additionally, I can only select All Cores or Core0,1,2,3 whereas the 4800H is an 8 core CPU.

Freekers avatar May 31 '20 19:05 Freekers

The manual overclock won't work for the 4000 series, because I don't know the commands for it, also don't know if it is possible at all. You can only play with P-States for now, if they get respected by the CPU.

irusanov avatar May 31 '20 19:05 irusanov

I don't notice any difference. It seems the CPU boosts past the P0 state. Perhaps I'm doing something wrong. Let's wait for the feedback of @alexantone

Freekers avatar Jun 01 '20 10:06 Freekers

Usually on these APUs you need to change the DID to something lower than the default, then the CPU goes into OC mode, but this means it would stay at that fixed frequency. I haven't found any other method to control the frequency. Not sure if this trick works on the 4000 anymore, don't have one to test.

Changing power limits might have some effect, but they are not available in the new app yet.

irusanov avatar Jun 01 '20 12:06 irusanov

Yeah, this happens because of XFR or smth like it, that allows cores to boost higher than P0. These frequency limits are pretty obscure and probably hidden behind the SMU.

There is a way to disable the boost though, via MSR 0xC0010015 bit 25 (Core Performance Boost disable bit / Hardware Configuration Register) [1].

This will cap the upper freq to the P0 one. Unfortunatelly i get immediatevsystem crash when I try to play with the P0 parameters for Ryzen 4800H.

[1] Open source Register Reference For AMD Family 17h Processors

On Jun 1, 2020, 13:14, at 13:14, Freekers [email protected] wrote:

I don't notice any difference. It seems the CPU boosts past the P0 state. Perhaps I'm doing something wrong. Let's wait for the feedback of @alexantone

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/irusanov/ZenStates/issues/9#issuecomment-636761651

alexantone avatar Jun 01 '20 13:06 alexantone

Yes, that MSR is used for controlling the PB bit, but last time I tried it didn't work either. It just gets ignored.

irusanov avatar Jun 01 '20 18:06 irusanov

For me, on Ryzen 4800H it works when I manually set it with RWEverything with the  "Set on all CPUs" checkbox checked.

The bit does get reset by the BIOS at reboot and resume from sleep though.

BR, Alex

On Jun 1, 2020, 21:07, at 21:07, Ivan Rusanov [email protected] wrote:

Yes, that MSR is used for controlling the PB bit, but last time I tried it didn't work either. It just gets ignored.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/irusanov/ZenStates/issues/9#issuecomment-637019833

alexantone avatar Jun 02 '20 06:06 alexantone

That's a good news. It was working on the 1000 series before, then stopped after one of the AGESA updates. Currently, you can't do much on the 1800X with new bios/AGESA. Most of the old commands don't work anymore.

I'm afraid the mobile chips are also almost completely locked and not much can be changed, unfortunately :( Even though you can successfully change some parameters, they are not respected by the CPU. It's almost completely autonomous.

irusanov avatar Jun 03 '20 12:06 irusanov

It looks like this:

image

Only changed things are applied, e.g. if you don't change anything in the manual overclock section it gets ignored when Apply is clicked. Not very intuitive, I believe. Wondering how I could make it more user-friendly.

HI. My device is equipped with R5 4600H. Both Zenstates and aida64 say default voltage is 1.219v, but CPU-Z shows the core vid is up to 1.325v. defult defult_vid Then I try to undervolt and aida64 shows the same voltage as what Zenstates sets. But CPU-Z still shows a 1.325v Core VID. down down_vid Anything I can do?

yutouyes avatar Jul 23 '20 09:07 yutouyes

Probably manual OC does not work or it depends on some other option. Have you tried to use the P-States instead? Also trying the old trick of decreasing DID e.g. from 4 to 2 and then setting P0?

Attached is the latest beta build, but I don't think it will make any difference. I might get a Renoir myself to try. Can you tell me if the Manual OC mode checkbox is checked or if unchecked - does it stay checked when you enabled it and click Apply button? ZenStates_2.0.0_debug_20200801.zip

irusanov avatar Aug 03 '20 19:08 irusanov

Probably manual OC does not work or it depends on some other option. Have you tried to use the P-States instead? Also trying the old trick of decreasing DID e.g. from 4 to 2 and then setting P0?

Attached is the latest beta build, but I don't think it will make any difference. I might get a Renoir myself to try. Can you tell me if the Manual OC mode checkbox is checked or if unchecked - does it stay checked when you enabled it and click Apply button? ZenStates_2.0.0_debug_20200801.zip

I ve got a Ryzen 4800H mobile on an ASUS A15 (506IV with 309 BIOS). With your latest release I can uncheck "En" - Box to disable the manual overclock. However I tried different P-States settings with different VID and DIDs it didnt changend anything. I tried different workloud to test it, but sadly it didnt accept the settings.

I hope it helps you. I am also interested in this topic.

Xibit1990 avatar Aug 03 '20 20:08 Xibit1990

Have anyone tried if Ryzen Master work on these mobile CPUs? PS: Apparently not, but you can try this tool: https://github.com/sbski/Renoir-Mobile-Tuning It's basically a GUI wrapper for ryzenadj.

I don't think ZenStates will work on mobile, unless I get a Renoir-based laptop which I don't need. The command IDs seem to be completely different and are probably the same as on previous mobile chips. It's not advisable to run these tools on mobiles. I will have to probably add mobile CPUs to the unsupported ones, unless I get a chance to actually test anything on a real system. Otherwise it might be even dangerous for these APUs.

I have found one reasonably specced Lenovo laptop, but have to pay 700+ euro for something I don't need.

I can't find any evidence it's possible to set higher frequencies on the mobile chips, only power limits.

irusanov avatar Aug 03 '20 23:08 irusanov

Have anyone tried if Ryzen Master work on these mobile CPUs? PS: Apparently not, but you can try this tool: https://github.com/sbski/Renoir-Mobile-Tuning It's basically a GUI wrapper for ryzenadj.

I don't think ZenStates will work on mobile, unless I get a Renoir-based laptop which I don't need. The command IDs seem to be completely different and are probably the same as on previous mobile chips. It's not advisable to run these tools on mobiles. I will have to probably add mobile CPUs to the unsupported ones, unless I get a chance to actually test anything on a real system. Otherwise it might be even dangerous for these APUs.

I have found one reasonably specced Lenovo laptop, but have to pay 700+ euro for something I don't need.

I can't find any evidence it's possible to set higher frequencies on the mobile chips, only power limits.

Ryzen Master is unsupported in mobile ryzen. And the RMT as well as https://www.ryzencontroller.com/ can work in 4600H very well, but both of them lack the ability of undervolting.

yutouyes avatar Aug 04 '20 02:08 yutouyes

Probably manual OC does not work or it depends on some other option. Have you tried to use the P-States instead? Also trying the old trick of decreasing DID e.g. from 4 to 2 and then setting P0?

Yep I changed the P0 from 1.219 to lower, and nope, doesn't work. 4 to 2 doesn't play a role, either.

Can you tell me if the Manual OC mode checkbox is checked or if unchecked - does it stay checked when you enabled it and click Apply button?

By default it is unchecked. When I tried to enable OC and apply, it gave me an error. Then it returned unchecked. OC_failed

yutouyes avatar Aug 04 '20 02:08 yutouyes

@yutouyes Yes, the command for forcing manual oc mode fails. It's either unsupported or has a different ID. There also might be no support for voltage change on mobile chips which would be pity. It seems you can lower the voltage by lowering the limits, but that also kills max boost frequency and I guess people want to keep that boost, but reduce the maximum voltage.

If I get a chance to test on an actual laptop, I will try to find something useful. Until then there's nothing I can do. I'm tempted to buy a cheaper ryzen 4000 laptop, but the price (700 euro) is more than the average salary in the country and more than 2 times higher than the minimum wage. So it's not that cheap of an experiment.

The mobile variant of the app should probably have a completely different CPU tab though.

If someone feels like experimenting, then you can try the ids from this table: https://github.com/flygoat/ryzen_nb_smu and use either that tool to send the desired command and arguments or my SMUDebugTool, but I will have to release the new version with Renoir support first.

irusanov avatar Aug 04 '20 09:08 irusanov

Pushed a new release of the debug tool with Renoir support (desktop). It should start on mobile as well, but OC frequency and voltage won't work. I will have to split the detection by socket as well and add another logic if mobile is detected. You can now test SMU commands from this table: https://github.com/flygoat/ryzen_nb_smu, but keep in mind this is dangerous and you can potentially kill your CPU if something doesn't match and you execute an unknown command which e.g. sets some voltage. First 4 commands should be safe to execute though.

https://github.com/irusanov/SMUDebugTool/releases/

PS: Could someone get me a report from SMUDebugTool (v1.2.7)? Go to Info tab and click Export, then attach the generated json file found in the same directory where the app is. Thanks!

Should look like this:

{
  "AppVersion": "1.2.7.0",
  "OSVersion": "Microsoft Windows 10 Pro",
  "CpuId": "870F10",
  "CpuCodeName": "Matisse",
  "CpuName": "AMD Ryzen 9 3900X 12-Core Processor",
  "ExtendedModel": "00000071",
  "PackageType": 2,
  "CCDCount": "2",
  "CCXCount": "4",
  "NumCoresInCCX": 3,
  "FusedCoreCount": 12,
  "PhysicalCoreCount": 16,
  "Threads": 24,
  "MbVendor": "ASUSTeK COMPUTER INC.",
  "MbName": "CROSSHAIR VI HERO",
  "BiosVersion": "7803",
  "Microcode": "08701021",
  "SmuVersion": "46.62.00",
  "Mailboxes": [
    {
      "MsgAddress": "0x03B10524",
      "RspAddress": "0x03B10570",
      "ArgAddress": "0x03B10A40"
    },
    {
      "MsgAddress": "0x03B10528",
      "RspAddress": "0x03B10574",
      "ArgAddress": "0x03B10A60"
    },
    {
      "MsgAddress": "0x03B10530",
      "RspAddress": "0x03B1057C",
      "ArgAddress": "0x03B109C4"
    }
  ]
}

irusanov avatar Aug 04 '20 23:08 irusanov

@irusanov

{ "AppVersion": "1.2.7.0", "OSVersion": "Microsoft Windows 10 Pro", "CpuId": "860F01", "CpuCodeName": "Renoir", "CpuName": "AMD Ryzen 5 4600H with Radeon Graphics", "ExtendedModel": "00000060", "PackageType": 0, "CCDCount": "1", "CCXCount": "2", "NumCoresInCCX": 3, "FusedCoreCount": 6, "PhysicalCoreCount": 12, "Threads": 12, "MbVendor": "Standard", "MbName": "GK5NR0O", "BiosVersion": "N.1.10.T03STD00", "Microcode": "08600103", "SmuVersion": "55.64.00", "Mailboxes": [ { "MsgAddress": "0x03B10A20", "RspAddress": "0x03B10A80", "ArgAddress": "0x03B10A88" }, { "MsgAddress": "0x03B10A24", "RspAddress": "0x03B10A84", "ArgAddress": "0x03B10A8C" } ] }

yutouyes avatar Aug 05 '20 06:08 yutouyes

Would be nice to know if the Desktop Renoir have a different SMU Version behause our Mobile variants already have different SMU versions.

{
  "AppVersion": "1.2.9.0",
  "OSVersion": "Microsoft Windows 10 Enterprise",
  "CpuId": "860F01",
  "CpuCodeName": "Renoir",
  "CpuName": "AMD Ryzen 7 PRO 4750U with Radeon Graphics",
  "ExtendedModel": "00000060",
  "PackageType": 0,
  "CCDCount": 1,
  "CCXCount": 1,
  "NumCoresInCCX": 8,
  "FusedCoreCount": 8,
  "PhysicalCoreCount": 4,
  "Threads": 16,
  "MbVendor": "LENOVO",
  "MbName": "20UJS0D300",
  "BiosVersion": "R1CET40W(1.09 )",
  "Microcode": "08600104",
  "SmuVersion": "55.65.00",
  "Mailboxes": [
    {
      "MsgAddress": "0x03B10A20",
      "RspAddress": "0x03B10A80",
      "ArgAddress": "0x03B10A88"
    },
    {
      "MsgAddress": "0x03B10A24",
      "RspAddress": "0x03B10A84",
      "ArgAddress": "0x03B10A8C"
    }
  ]
}

Falcosc avatar Feb 22 '21 18:02 Falcosc

I have some Renoir reports from users

Desktop 4650G, SMU 55.68.00
Mobile  4700U, SMU 55.69.00
Mobile  4500U, SMU 55.71.0
Desktop 4650G, SMU 55.77.0

The detected versions might be inaccurate though, because some of the reports are from older versions of ZenTimings prior to adding support for both SMU version formats. I also need to rewrite the Mailbox detection algorithm, since it's kind of lame at the moment.

To me, mobile and desktop Renoir seem to be on the same SMU node. Generally things with Zen2 and Zen3 seem to be more consistent than with previous generations.

irusanov avatar Feb 23 '21 16:02 irusanov

Spicy!

According to the ryzen master reverse engineering result Desktop Renoir does still use other message Ids then Mobile Renoir. Or is my conclusion wrong?

Falcosc avatar Feb 23 '21 16:02 Falcosc

If you're only interested in Mobile Renoir, then you can check the Renoir Mobile Tuning: https://github.com/sbski/Renoir-Mobile-Tuning/blob/Update-1.0/renoir_tuning_utility/renoir_tuning_utility/PowerSettings.cs He's only using the MP1 commands to set limits, except for the power table (which is the only thing from SMU I use in ZenTimings). Ryzen Master is using the RSMU/PSMU, but I don't know if the commands are the same for Mobile.

irusanov avatar Feb 23 '21 17:02 irusanov

Thank you, but Renoir Mobile Tuning values are already the result of the joint effort between sbski and FlyGoat. So nothing new there :)

Edit:

I'm not sure if I'm too late, but I can confirm the message Ids from your spreadsheet to be working

msg result
0x32 sets PPT LIMIT FAST mW
0x33 sets PPT LIMIT SLOW mW
0x3A sets EDC LIMIT VDD mA
0x3B sets EDC LIMIT SOC mA
0x38 sets TDC LIMIT VDD mA
0x39 sets TDC LIMIT SOC mA
0x17 reject
0x18 ok
0x19 reject
0x1a reject
0x82 0
0xe 1600 in mhz
0x42 4200 in mhz
0xF 0x3f800000
0x3F rejected (did test following values: 0x3f800000, 0x3f700000, 0x3f900000, 0x1, 0x0)

Falcosc avatar Feb 23 '21 17:02 Falcosc

For disable prochot (0x17) you might need an argument 0x1000000, but I don't know if it works on Renoir and it's not that important anyway. It's only useful on extreme cooling and not recommended.

Zen2 (Matisse) and Zen3 (Vermeer) combine that "disable prochot" command with "enable manual overclock" (with default 0x0 argument). "Enable prochot" is also used to "disable manual oc" and switch to "auto". Setting oc mode appears to be blocked on APUs and can only control the manual OC from bios, I guess it overrides something, which is not possible at runtime.

0x19 and 0x1A should only work if you manage to enable manual oc mode first. Same for 0x1B. 0x82 - not sure if 0 means true or false (Edit: it should be "false" - value & 1)

irusanov avatar Feb 25 '21 12:02 irusanov

I did search for prochot adjustments because even with tctl, prochot gets trigger on my system. Prochot is very painful because it does apply maximum throttle which nearly freezes the system.

But I guess found the issue. Seams like tctl is to slow. Here is my contribution to this topic

--tctl-temp / THM Limit (Core, GFX, SOC)

Put your temperature target here. But be careful there is a hidden prochot failsafe thermal limit. If you do select to high values, proc-hot gets triggered and limit your CPU power below 4W, which nearly freezes the system. So your number 1 goal should be proc-hot prevention, because all the small tuning gains means nothing, if the overall system experience does suck.

For example

  • my device has a max temp of 100, if I enter 102°C only 100 gets applied.
  • I guess my prochot is around 102-105°C, you might guess you are safe with 100°C? Wrong!
  • Sustained workloads are fine, temperature get managed to stay between 99.9 to 100.3
  • Workload demand spikes are not fine, because the thermal management has a little delay around 1000ms. And this is a problem with extreme changes in workload. Even with sensor polling of only 2000ms I could get single readings of 103°C, proc-hot gets triggered and the whole system gets limited to 4W for some seconds
  • Using 97°C did fix the proc-hot issue for transient workloads

Because the prochot temperature limit is unknown you need to monitor if this limit got applied during an unexpected system slowdown. HWiNFO has a Value for this Thermal Throttling (PROCHOT EXT) and Thermal Throttling (PROCHOT CPU). Lower your thermal Limit step by step untill you don't get prochot limits anymore.

quote from Renoir Tuning Guide

Falcosc avatar Feb 25 '21 13:02 Falcosc

I did try to find out if Pstates are used at all at Renoir. Value range is fitting. For my CPU anything above 4200Mhz is out of spec and each value above don't get saved, even 4210Mhz. So looks like Pstate was found on the correct position.

However, I couldn't get PState to do anything. I did set all of them to 1000, 2000, 3000 and 3900

After setting PState values bit 21 get set (LockTscToCurrentP0: lock the TSC to the current P0 frequency)

This doesn't help either. Maybe it does prevent it from working.

So I did also try to see what's happening without it. So disable bit 21 after setting P0 and still nothing happens

Then I did repeat all these tests with bit 25 CpbDis: core performance boost disable

But the only thing which this is doing: applying the 1700Mhz Limit. Even after and during PState value changes and with or without bit 21.

Seams like the mobile CPUs do ignore the values which can be written and read from the usual PState registers.

The interesting thing is that Windows can not limit the Core frequency either. On Intel you can do it by:

  • Frequency
  • or by Percent

Both options are hidden on my AMD installation, so I did enable the GUI options

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\bc5038f7-23e0-4960-96da-33abaf5935ec
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\75b0ae3f-bce0-45a7-8c89-c9611c25e100

But one thing does work:

  • Disable Boost (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\be337238-0d82-4146-a960-4f3749d470c7)

Surprise surprise, changing this value does automatically set bit 25 according to the picklist value. Thanks for the hint @alexantone we now know who windows is doing this.

Edit: All tests were done with Cinebench R20 Single Core

Falcosc avatar Mar 16 '21 19:03 Falcosc