ryzen_monitor icon indicating copy to clipboard operation
ryzen_monitor copied to clipboard

5700G support

Open reagentoo opened this issue 3 years ago • 14 comments

Hi, I used the previous topic to extract useful information from my 5700G: https://github.com/hattedsquirrel/ryzen_monitor/issues/1#issuecomment-778781799 https://github.com/hattedsquirrel/ryzen_monitor/issues/1#issuecomment-779422196

According to this descriptions, I first made a dump without load, then with it: https://gist.github.com/reagentoo/35297f3a30f8130628a7dcd34d2112dc https://gist.github.com/reagentoo/888d9d108deb7174ffde2bfa04acfc72

Please let me know if you need more information or if I can somehow speed up the reverse engineering.

reagentoo avatar Sep 06 '21 11:09 reagentoo

Hi, Devs! I also want to know, do you keep up with PM table version 400005 Asking because I haven't seen commits to pm_tables.h. I see a number of entries were added there, supposedly related to STAPM limit and such

PJVol avatar Sep 13 '21 08:09 PJVol

I added some basic support for 400005 from your dumps. But I have to admit that I'm now at a point where I'm completely blindly guessing.

hattedsquirrel avatar Oct 10 '21 12:10 hattedsquirrel

Here is a pastebin of dump data (with and without load) from my 5600G, in case it helps with fixing up any Cezanne support.

https://pastebin.com/hpLNYa4a

Cilraaz avatar Oct 11 '21 03:10 Cilraaz

I added some basic support for 400005 from your dumps. But I have to admit that I'm now at a point where I'm completely blindly guessing.

Hi. Now it currently displays only 8 threading cores out of 16 available. Although I'm certainly not sure what really should be.

without load (ryzen_monitor)
Warning: Support for this PM table version is expermiental. Can't trust anything.
╭───────────────────────────────────────────────┬────────────────────────────────────────────────╮
│                                     CPU Model │         AMD Ryzen 7 5700G with Radeon Graphics │
│                           Processor Code Name │                                        Cezanne │
│                                         Cores │                                              8 │
│                                     Core CCDs │                                              0 │
│                                 Cores Per CCD │                                              8 │
│                                SMU FW Version │                                       v64.50.0 │
│                                MP1 IF Version │                                            v12 │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭─────────┬────────────┬──────────┬─────────┬──────────┬─────────────┬─────────────┬─────────────╮
│  Core 0 │    224 MHz |  0.299 W |   nan V |  33.95 C | C0:  11.9 % | C1:  52.5 % | C6:  35.5 % │
│  Core 1 │    158 MHz |  0.153 W |   nan V |  33.16 C | C0:   7.8 % | C1:  15.3 % | C6:  76.9 % │
│  Core 2 │    873 MHz |  1.003 W |   nan V |  35.73 C | C0:  24.2 % | C1:   7.1 % | C6:  68.7 % │
│  Core 3 │    276 MHz |  0.370 W |   nan V |  33.48 C | C0:  14.6 % | C1:  85.4 % | C6:   0.0 % │
│  Core 4 │    191 MHz |  0.179 W |   nan V |  34.06 C | C0:   7.8 % | C1:   7.7 % | C6:  84.5 % │
│  Core 5 │    250 MHz |  0.253 W |   nan V |  33.43 C | C0:  11.2 % | C1:  16.4 % | C6:  72.4 % │
│  Core 6 │    212 MHz |  0.198 W |   nan V |  33.78 C | C0:  11.0 % | C1:  22.3 % | C6:  66.8 % │
│  Core 7 │    195 MHz |  0.204 W |   nan V |  33.28 C | C0:  10.3 % | C1:  19.6 % | C6:  70.1 % │
╰─────────┴────────────┴──────────┴─────────┴──────────┴─────────────┴─────────────┴─────────────╯
╭── Core Statistics (Calculated) ───────────────┬────────────────────────────────────────────────╮
│              Highest Effective Core Frequency │                                        873 MHz │
│                      Highest Core Temperature │                                        35.73 C │
│                          Highest Core Voltage │                                        0.000 V │
│                          Average Core Voltage │                                          nan V │
│                              Average Core CC6 │                                          inf % │
│                          Total Core Power Sum │                                        2.658 W │
├── Reported by SMU ────────────────────────────┼────────────────────────────────────────────────┤
│                             Peak Core Voltage │                                        0.922 V │
│                                   Package CC6 │                                          nan % │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Electrical & Thermal Constraints ───────────┬────────────────────────────────────────────────╮
│                              Peak Temperature │                                         0.99 C │
│                               SoC Temperature │                                          nan C │
│                               GFX Temperature │                                        33.52 C │
│                         Voltage from Core VRM │               0.918 V |   1.462 V |    62.76 % │
│                                           PPT │               5.506 W |      88 W |     6.26 % │
│                                       PPT APU │               5.506 W |      88 W |     6.26 % │
│                                     TDC Value │               0.518 A |      65 A |     0.80 % │
│                           TDC Value, SoC only │               2.244 A |      50 A |     4.49 % │
│                                           EDC │               4.411 A |      95 A |     4.64 % │
│                                 EDC, SoC only │               6.991 A |      75 A |     9.32 % │
│                                           THM │               36.00 C |      95 C |    37.89 % │
│                                       THM SoC │               34.11 C |      95 C |    35.90 % │
│                                       THM GFX │               33.52 C |      95 C |    35.28 % │
│                                           FIT │                 273   |    2192   |    12.47 % │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Memory Interface ───────────────────────────┬────────────────────────────────────────────────╮
│                                  Coupled Mode │                                            OFF │
│                        Fabric Clock (Average) │                                        nan MHz │
│                                  Fabric Clock │                                        nan MHz │
│                                  Uncore Clock │                                        nan MHz │
│                                  Memory Clock │                                        nan MHz │
│                                     cLDO_VDDM │                                       1.2624 V │
│                                     cLDO_VDDP │                                       0.3570 V │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Graphics Subsystem──────────────────────────┬────────────────────────────────────────────────╮
│                                   GFX Voltage │                                       0.7441 V │
│                               GFX Temperature │                                        33.52 C │
│                    GFX Clock Real | Effective │                            442 MHz |    68 MHz │
│                                      GFX Busy │                                       185.21 % │
│                     GFX EDC Limit | Residency │                          69.767 A |     0.00 % │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Power Consumption ──────────────────────────┬────────────────────────────────────────────────╮
│                          Total Core Power Sum │                                        2.658 W │
│                               VDDCR_SOC Power │                                        2.322 W │
│                               GMI2_VDDG Power │                                          nan W │
│                                L3 Logic Power │                                        0.314 W │
│                                 L3 VDDM Power │                                        0.278 W │
│                                               │                                                │
│                               VDDIO_MEM Power │                                        1.898 W │
│                           IOD_VDDIO_MEM Power │                                        0.060 W │
│                                DDR_VDDP Power │                                        0.227 W │
│                                   VDD18 Power │                                          nan W │
├── Additional Reports ─────────────────────────┼────────────────────────────────────────────────┤
│                              SoC Power (SVI2) │               0.996 V |   2.322 A |    2.322 W │
│                             Core Power (SVI2) │               0.922 V |   2.197 A |    3.113 W │
│                              Core Power (SMU) │                                        3.113 W │
│                            Socket Power (SMU) │                                        7.977 W │
│                           Package Power (SMU) │                                        0.000 W │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
without load (sensors)
amdgpu-pci-0600
Adapter: PCI adapter
vddgfx:      743.00 mV 
vddnb:       993.00 mV 
edge:         +33.0°C  
power1:      1000.00 uW 

nct6798-isa-0290
Adapter: ISA adapter
in0:                      368.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                        1.01 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                        3.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                        3.38 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                        1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                      912.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                      240.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                        3.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                        3.30 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                      912.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                     312.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                       1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                       1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                     352.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                     256.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                      533 RPM  (min =    0 RPM)
fan2:                      762 RPM  (min =    0 RPM)
fan3:                      510 RPM  (min =    0 RPM)
fan4:                      507 RPM  (min =    0 RPM)
fan5:                        0 RPM  (min =    0 RPM)
fan6:                        0 RPM  (min =    0 RPM)
fan7:                      537 RPM  (min =    0 RPM)
SYSTIN:                    +31.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
CPUTIN:                    +30.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                   +88.0°C    sensor = thermistor
AUXTIN1:                   +48.0°C    sensor = thermistor
AUXTIN2:                   -59.0°C    sensor = thermistor
AUXTIN3:                   +81.0°C    sensor = thermistor
PECI Agent 0 Calibration:  +30.0°C  
PCH_CHIP_CPU_MAX_TEMP:      +0.0°C  
PCH_CHIP_TEMP:              +0.0°C  
PCH_CPU_TEMP:               +0.0°C  
intrusion0:               ALARM
intrusion1:               ALARM
beep_enable:              disabled

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

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:            N/A  

I also tested under load on each odd threading core. I uses cgroups to load balance the kernels when building packages on my system:

  cpuset {
    cpuset.cpus = 1,3,5,7,9,11,13,15;
  }
with load (ryzen_monitor)
Warning: Support for this PM table version is expermiental. Can't trust anything.
╭───────────────────────────────────────────────┬────────────────────────────────────────────────╮
│                                     CPU Model │         AMD Ryzen 7 5700G with Radeon Graphics │
│                           Processor Code Name │                                        Cezanne │
│                                         Cores │                                              8 │
│                                     Core CCDs │                                              0 │
│                                 Cores Per CCD │                                              8 │
│                                SMU FW Version │                                       v64.50.0 │
│                                MP1 IF Version │                                            v12 │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭─────────┬────────────┬──────────┬─────────┬──────────┬─────────────┬─────────────┬─────────────╮
│  Core 0 │    513 MHz |  0.957 W |   nan V |  40.94 C | C0:  14.5 % | C1:  77.3 % | C6:   8.2 % │
│  Core 1 │   4417 MHz |  7.734 W |   nan V |  58.40 C | C0: 100.0 % | C1:   0.0 % | C6:   0.0 % │
│  Core 2 │    533 MHz |  0.916 W |   nan V |  41.41 C | C0:  14.9 % | C1:  62.0 % | C6:  23.1 % │
│  Core 3 │   4417 MHz |  7.846 W |   nan V |  61.91 C | C0: 100.0 % | C1:   0.0 % | C6:   0.0 % │
│  Core 4 │    423 MHz |  0.796 W |   nan V |  41.18 C | C0:  11.7 % | C1:  60.5 % | C6:  27.7 % │
│  Core 5 │   4417 MHz |  8.269 W |   nan V |  63.49 C | C0: 100.0 % | C1:   0.0 % | C6:   0.0 % │
│  Core 6 │    494 MHz |  0.847 W |   nan V |  40.67 C | C0:  13.9 % | C1:  63.5 % | C6:  22.6 % │
│  Core 7 │   4417 MHz |  8.342 W |   nan V |  61.33 C | C0: 100.0 % | C1:   0.0 % | C6:   0.0 % │
╰─────────┴────────────┴──────────┴─────────┴──────────┴─────────────┴─────────────┴─────────────╯
╭── Core Statistics (Calculated) ───────────────┬────────────────────────────────────────────────╮
│              Highest Effective Core Frequency │                                       4417 MHz │
│                      Highest Core Temperature │                                        63.49 C │
│                          Highest Core Voltage │                                        0.000 V │
│                          Average Core Voltage │                                          nan V │
│                              Average Core CC6 │                                          inf % │
│                          Total Core Power Sum │                                       35.707 W │
├── Reported by SMU ────────────────────────────┼────────────────────────────────────────────────┤
│                             Peak Core Voltage │                                        1.364 V │
│                                   Package CC6 │                                          nan % │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Electrical & Thermal Constraints ───────────┬────────────────────────────────────────────────╮
│                              Peak Temperature │                                         4.55 C │
│                               SoC Temperature │                                          nan C │
│                               GFX Temperature │                                        39.61 C │
│                         Voltage from Core VRM │               1.402 V |   1.400 V |   100.13 % │
│                                           PPT │              46.421 W |      88 W |    52.75 % │
│                                       PPT APU │              46.421 W |      88 W |    52.75 % │
│                                     TDC Value │              29.893 A |      65 A |    45.99 % │
│                           TDC Value, SoC only │               2.815 A |      50 A |     5.63 % │
│                                           EDC │              54.032 A |      95 A |    56.88 % │
│                                 EDC, SoC only │               5.974 A |      75 A |     7.96 % │
│                                           THM │               64.51 C |      95 C |    67.91 % │
│                                       THM SoC │               39.80 C |      95 C |    41.89 % │
│                                       THM GFX │               39.61 C |      95 C |    41.69 % │
│                                           FIT │                 657   |     652   |   100.76 % │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Memory Interface ───────────────────────────┬────────────────────────────────────────────────╮
│                                  Coupled Mode │                                            OFF │
│                        Fabric Clock (Average) │                                        nan MHz │
│                                  Fabric Clock │                                        nan MHz │
│                                  Uncore Clock │                                        nan MHz │
│                                  Memory Clock │                                        nan MHz │
│                                     cLDO_VDDM │                                       1.9077 V │
│                                     cLDO_VDDP │                                       0.3551 V │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Graphics Subsystem──────────────────────────┬────────────────────────────────────────────────╮
│                                   GFX Voltage │                                       0.7398 V │
│                               GFX Temperature │                                        39.61 C │
│                    GFX Clock Real | Effective │                            410 MHz |    15 MHz │
│                                      GFX Busy │                                        42.46 % │
│                     GFX EDC Limit | Residency │                          69.946 A |     0.00 % │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
╭── Power Consumption ──────────────────────────┬────────────────────────────────────────────────╮
│                          Total Core Power Sum │                                       35.707 W │
│                               VDDCR_SOC Power │                                        2.498 W │
│                               GMI2_VDDG Power │                                          nan W │
│                                L3 Logic Power │                                        1.620 W │
│                                 L3 VDDM Power │                                        0.370 W │
│                                               │                                                │
│                               VDDIO_MEM Power │                                        2.632 W │
│                           IOD_VDDIO_MEM Power │                                        0.060 W │
│                                DDR_VDDP Power │                                        0.226 W │
│                                   VDD18 Power │                                          nan W │
├── Additional Reports ─────────────────────────┼────────────────────────────────────────────────┤
│                              SoC Power (SVI2) │               0.999 V |   2.497 A |    2.498 W │
│                             Core Power (SVI2) │               1.364 V |  29.655 A |   40.457 W │
│                              Core Power (SMU) │                                       40.457 W │
│                            Socket Power (SMU) │                                       46.231 W │
│                           Package Power (SMU) │                                        0.000 W │
╰───────────────────────────────────────────────┴────────────────────────────────────────────────╯
with load (sensors)
amdgpu-pci-0600
Adapter: PCI adapter
vddgfx:        1.36 V  
vddnb:         1.08 V  
edge:         +41.0°C  
power1:       12.00 mW 

nct6798-isa-0290
Adapter: ISA adapter
in0:                      680.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                        1.01 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                        3.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                        3.38 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                        1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                      912.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                      240.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                        3.41 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                        3.30 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                      912.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                     312.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                       1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                       1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                     344.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                     248.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                      900 RPM  (min =    0 RPM)
fan2:                     1277 RPM  (min =    0 RPM)
fan3:                      817 RPM  (min =    0 RPM)
fan4:                      828 RPM  (min =    0 RPM)
fan5:                        0 RPM  (min =    0 RPM)
fan6:                        0 RPM  (min =    0 RPM)
fan7:                      886 RPM  (min =    0 RPM)
SYSTIN:                    +31.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
CPUTIN:                    +34.5°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                   +89.0°C    sensor = thermistor
AUXTIN1:                   +47.0°C    sensor = thermistor
AUXTIN2:                   -59.0°C    sensor = thermistor
AUXTIN3:                   +81.0°C    sensor = thermistor
PECI Agent 0 Calibration:  +53.5°C  
PCH_CHIP_CPU_MAX_TEMP:      +0.0°C  
PCH_CHIP_TEMP:              +0.0°C  
PCH_CPU_TEMP:               +0.0°C  
intrusion0:               ALARM
intrusion1:               ALARM
beep_enable:              disabled

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

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:            N/A  
system monitor

system_monitor

Btw, regarding the memory clock: it is set to 3200Mhz in the bios.

reagentoo avatar Oct 11 '21 10:10 reagentoo

That is what I have for Cezanne. Sorry, no extended PM table support in ZenTimings. Size of the table is probably not correct. 0x000012 is just a faux version I have for generic (default) table if the detected version does not match any of the other tables.

// version, size, FCLK, UCLK, MCLK, VDDCR_SOC, CLDO_VDDP, CLDO_VDDG_IOD, CLDO_VDDG_CCD, Cores Power Offset

....
// Zen3 APU (Cezanne)
{ 0x400001, 0x8D0, 0x624, 0x628, 0x62C, 0x19C, 0x89C, -1, -1, -1 },
{ 0x400002, 0x8D0, 0x63C, 0x640, 0x644, 0x19C, 0x8B4, -1, -1, -1 },            
{ 0x400003, 0x944, 0x660, 0x664, 0x668, 0x19C, 0x8D0, -1, -1, -1 },
{ 0x400004, 0x948, 0x664, 0x668, 0x66C, 0x19C, 0x8D4, -1, -1, -1 },
{ 0x400005, 0x948, 0x664, 0x668, 0x66C, 0x19C, 0x8D4, -1, -1, -1 },
// Generic Zen3 APU
{ 0x000012, 0x948, 0x664, 0x668, 0x66C, 0x19C, 0x8D4, -1, -1, -1 },

I don't really remember if I made that up or it is based on some report. Up to the MCLK (0x66C) it seems to be the same as the 0x400004 version though.

irusanov avatar Oct 11 '21 16:10 irusanov

Hey Devs, Is there anything I can do for this issue as a non-developer ? It affects me, and while I'm not in a hurry to get it done, I would like to try and contribute.

CPU - Ryzen 5 5600G

abvee avatar Feb 18 '22 17:02 abvee

Hey Devs, Is there anything I can do for this issue as a non-developer ? It affects me, and while I'm not in a hurry to get it done, I would like to try and contribute.

CPU - Ryzen 5 5600G

All instructions of helping developers are in front of you in this issue.

reagentoo avatar Feb 18 '22 17:02 reagentoo

@hattedsquirrel

I added some basic support for 400005 from your dumps. But I have to admit that I'm now at a point where I'm completely blindly guessing.

I've made most of guesswork for you, if you don't mind :), so here are labels file and suggested pm_tables.c (didn't make pull request, since its not clear for me what github compares my fork to):

ptable.400005.txt pm_tables.c.txt

PJVol avatar Mar 06 '22 05:03 PJVol

I added the labels provided by @PJVol. Also improved the display output a bit. Core voltages are now shown. Can't really test it myself other than witht he dumps provided in this thread. Any testing is highly welcome.

@reagentoo You only see 8 cores because the PM table report the physical cores (of which there are 8), not the CPU threads.

hattedsquirrel avatar Mar 12 '22 16:03 hattedsquirrel

@reagentoo You only see 8 cores because the PM table report the physical cores (of which there are 8), not the CPU threads.

@hattedsquirrel But as you can see, I load every odd thread cpu and get a load of 100% of the physical cores. It would be logical to see ~50% utilization of each physical core. This fact confuses me a little.

reagentoo avatar Mar 12 '22 16:03 reagentoo

I'd assume CPU 0-7 are the first thread of each physical core, 8-15 are the second threads of the physical cores. So you are loading every second core with two threads. To verify you can run cat /proc/cpuinfo | grep "core id". If it goes 0-1-2-3-4-5-6-7-0-1-2-3-4-5-6-7 then it is as I said.

hattedsquirrel avatar Mar 12 '22 16:03 hattedsquirrel

To verify you can run cat /proc/cpuinfo | grep "core id". If it goes 0-1-2-3-4-5-6-7-0-1-2-3-4-5-6-7 then it is as I said.

hit

reagentoo avatar Mar 12 '22 16:03 reagentoo

Any testing is highly welcome

@hattedsquirrel Sensors showed correctly, but the output layout is weird, what's up with it?

rm-scr

PJVol avatar Mar 15 '22 16:03 PJVol

@PJVol ROC Power is behaving quite odd on 5700G.

I tried various stress tests, and it does not correlate to anything and barely fluctuates in the 0.644W - 0.690W range, this included several OpenGL stress tests and hashcat.

Any ideas what this value might represent?

I noticed that Socket Power (SMU) and Package Power (SMU) do increase with something like a pure OpenCL stress test (~15W increase from idle baseline, which sounds about right for Vega 10), but this is not accounted under ROC Power.

Edit: Does ROC mean Rest of Chip? If that's the case, does that imply that the SMU does not have a way of reporting the GPU core power usage?

Ristovski avatar Dec 09 '22 22:12 Ristovski