irusanov / SMUDebugTool

A dedicated tool to help write/read various parameters of Ryzen-based systems, such as manual overclock, SMU, PCI, CPUID, MSR and Power Table.
GNU General Public License v3.0
69 stars 5 forks source link

Support for Zen3 / Ryzen 5000 #9

Open sp00n opened 1 year ago

sp00n commented 1 year ago

Does this support Ryzen 5000 CPUs? I'm getting mixed results, the CPU is correctly detected, but the PBO values are all 0, despite being set in the BIOS. The SMU send message also sometimes fails, then I have to do one or multiple rescans to make the 0x1 test message work again. And the Debug Report does not show any mailboxes, even if the scan process succeeded before.

It also crashes after a while when I open the SMU monitor after a scan. It displays a couple of messages and then closes without an error.

{
  "AppVersion": "1.3.2.0",
  "OSVersion": "Microsoft Windows 10 Enterprise LTSC",
  "CpuName": "AMD Ryzen 9 5900X 12-Core Processor",
  "CodeName": "Vermeer",
  "CpuId": "00A20F10",
  "Model": 33,
  "ExtendedModel": 32,
  "PackageType": "AM4 (2)",
  "FusedCoreCount": 12,
  "PhysicalCoreCount": 16,
  "NodesPerProcessor": 0,
  "Threads": 24,
  "SMT": true,
  "CCDCount": 2,
  "CCXCount": 2,
  "NumCoresInCCX": 6,
  "MbVendor": "Micro-Star International Co., Ltd.",
  "MbName": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
  "BiosVersion": "1.50",
  "SmuVersion": "56.44.0",
  "SmuTableVersion": 3672068,
  "PatchLevel": "0A201009",
  "Mailboxes": []
}

image

image

image

irusanov commented 1 year ago

Perhaps it's because of the older version. My current version is 1.3.4, but I haven't released it.

irusanov commented 1 year ago

Other possibility is the latest bios for your board removed the "read" command.

The mailbox scanning function does not work properly from some time with the new AGESA updates rolled out to vendors. It might even lock the SMU with a restart needed. It is a brute-force method anyway, so better avoid using that function.

Here's a fresh build from yesterday if you're not afraid to try. SMUDebugTool_v1.3.4_20230621.zip

sp00n commented 1 year ago

I've built a version yesterday from the current master, trying out your version now, but there doesn't seem to be much of a difference between these two.

The debug report now shows the mailboxes correctly, and it also doesn't seem to crash anymore while monitoring the mailboxes. The PBO values all still read 0 though. Is this maybe by design? I've set CO values in the BIOS, but those are not reflected in the values. When I enter a value it does seem to apply though, the voltage goes slightly down. But when I close and re-open the program, the values are again back to 0, while the voltage hasn't changed. So the CO values still seem to be applied, they're just not read. Hitting Apply while the values still read 0 after a fresh program start also increases the voltage again.

I hadn't actually tried this with the current 1.3.2 release, because I thought it was broken altogether.

{
  "AppVersion": "1.3.4.0",
  "OSVersion": "Microsoft Windows 10 Enterprise LTSC",
  "CpuName": "AMD Ryzen 9 5900X 12-Core Processor",
  "CodeName": "Vermeer",
  "CpuId": "00A20F10",
  "Model": 33,
  "ExtendedModel": 32,
  "PackageType": "AM4 (2)",
  "FusedCoreCount": 12,
  "PhysicalCoreCount": 16,
  "NodesPerProcessor": 1,
  "Threads": 24,
  "SMT": true,
  "CCDCount": 2,
  "CCXCount": 2,
  "NumCoresInCCX": 6,
  "MbVendor": "Micro-Star International Co., Ltd.",
  "MbName": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
  "BiosVersion": "1.50",
  "SmuVersion": "56.44.0",
  "SmuTableVersion": 3672068,
  "PatchLevel": "0A201009",
  "Mailboxes": [
    {
      "MsgAddress": "0x03B10524",
      "RspAddress": "0x03B10570",
      "ArgAddress": "0x03B10A40"
    },
    {
      "MsgAddress": "0x03B10528",
      "RspAddress": "0x03B10574",
      "ArgAddress": "0x03B10A60"
    },
    {
      "MsgAddress": "0x03B1052C",
      "RspAddress": "0x03B10578",
      "ArgAddress": "0x03B10A80"
    },
    {
      "MsgAddress": "0x03B10530",
      "RspAddress": "0x03B1057C",
      "ArgAddress": "0x03B109C4"
    },
    {
      "MsgAddress": "0x03B10534",
      "RspAddress": "0x03B10980",
      "ArgAddress": "0x03B109E0"
    }
  ]
}
irusanov commented 1 year ago

If I remember correctly, the GET command was not working for Vermeer.

This is the MP1 command ID to get the margin, leaving the argument to the default 0 should return it for the first core.

Mp1Smu.SMU_MSG_GetDldoPsmMargin = 0x48

If that doesn't work, then there might be another method, but I have no access to a Vermeer system right now.

PS: You can see discovered commands in the Core project

For example, specific Zen3 commands that extend the Zen2 set of commands: https://github.com/irusanov/ZenStates-Core/blob/c61e048aa14b68f9ebf96deeed698a2d621df654/SMU.cs#L353

You can also use the rest of the Zen2 commands in addition to the specific Zen3 commands: https://github.com/irusanov/ZenStates-Core/blob/c61e048aa14b68f9ebf96deeed698a2d621df654/SMU.cs#L302

HSMP commands: https://github.com/irusanov/ZenStates-Core/blob/c61e048aa14b68f9ebf96deeed698a2d621df654/Mailbox/HSMPMailbox.cs#L52

sp00n commented 1 year ago

Sending 48 returns an Unknown Command.

(Trying out the addresses between 48 and 35 seems to have put my CPU into some sort of power saving mode, it's going really slow now with sub 500 MHz :relieved:)

image image

irusanov commented 1 year ago

So it's what I remember - command for getting the CO value for a core is not available. Perhaps it was added in some of the newer AGESA/SMU versions, but I can't really tell. This was the case for my 5600X as well. I still have it, just no access to the system (which is not even assembled anymore)

sp00n commented 1 year ago

(Trying out the addresses between 48 and 35 seems to have put my CPU into some sort of power saving mode, it's going really slow now with sub 500 MHz 😌)

So I guess it was 0x3B, 0x3C and/or 0x3D, which define the TDC, EDC and PPT power limits. Calling them with 0 does set the limit to 0, forcing the CPU into a low power stage. And it seems you cannot set them to a higher value after doing so, luckily a Windows restart fixes this, the settings are not permanently written to the BIOS.

Is there some safe way to test these addresses without risking to permanently damaging the processor?

Some other maybe interesting results, I did stop at that point.

0x3A with arg 0 returns:

HEX: 0x226, 0x0, 0x0, 0x0, 0x0, 0x0
DEC: 550, 0, 0, 0, 0, 0
BIN: 1000100110, 0, 0, 0, 0, 0

0x39 with arg 0 returns:

HEX: 0xE75, 0x0, 0x0, 0x0, 0x0, 0x0
DEC: 3701, 0, 0, 0, 0, 0
BIN: 111001110101, 0, 0, 0, 0, 0

The original max CPU frequency?

0x38 with arg 0 returns:

HEX: 0xFF000000, 0x0, 0x0, 0x0, 0x0, 0x0
DEC: 4278190080, 0, 0, 0, 0, 0
BIN: 11111111000000000000000000000000, 0, 0, 0, 0, 0
irusanov commented 1 year ago

I haven't managed to kill/damage a retail SKU, but I'd still advise against trying unknown commands.

sp00n commented 1 year ago

Just as an info, my BIOS is rather old, from November 2020. The AGESA seems to be ComboAM4v2PI 1.1.0.0

E7C84AMS 151

sp00n commented 1 year ago

And another FYI, I updated the BIOS now, which includes AGESA ComboAM4v2PI 1.2.0.A, and the PBO tab now correctly displays the CO values from the BIOS. The 0x48 also returns a value. So I guess it was a version after 1.1.0.0 that (re-) added the command.

image

{
  "AppVersion": "1.3.4.0",
  "OSVersion": "Microsoft Windows 10 Enterprise LTSC",
  "CpuName": "AMD Ryzen 9 5900X 12-Core Processor",
  "CodeName": "Vermeer",
  "CpuId": "00A20F10",
  "Model": 33,
  "ExtendedModel": 32,
  "PackageType": "AM4 (2)",
  "FusedCoreCount": 12,
  "PhysicalCoreCount": 16,
  "NodesPerProcessor": 1,
  "Threads": 24,
  "SMT": true,
  "CCDCount": 2,
  "CCXCount": 2,
  "NumCoresInCCX": 6,
  "MbVendor": "Micro-Star International Co., Ltd.",
  "MbName": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
  "BiosVersion": "1.D0",
  "SmuVersion": "56.76.0",
  "SmuTableVersion": 3672069,
  "PatchLevel": "0A201025",
  "Mailboxes": [
    {
      "MsgAddress": "0x03B10524",
      "RspAddress": "0x03B10570",
      "ArgAddress": "0x03B10A40"
    },
    {
      "MsgAddress": "0x03B10528",
      "RspAddress": "0x03B10574",
      "ArgAddress": "0x03B10A60"
    },
    {
      "MsgAddress": "0x03B1052C",
      "RspAddress": "0x03B10578",
      "ArgAddress": "0x03B10A80"
    },
    {
      "MsgAddress": "0x03B10530",
      "RspAddress": "0x03B1057C",
      "ArgAddress": "0x03B109C4"
    },
    {
      "MsgAddress": "0x03B10534",
      "RspAddress": "0x03B10980",
      "ArgAddress": "0x03B109E0"
    }
  ]
}
irusanov commented 1 year ago

Thanks for confirming the command is available in newer bioses.