Ricks-Lab / gpu-utils

A set of utilities for monitoring and customizing GPU performance
GNU General Public License v3.0
136 stars 23 forks source link

Ryzen 5 3400G #82

Closed MINIXJR closed 4 years ago

MINIXJR commented 4 years ago

Should this tool also work with Ryzen 5 3400G (Picasso)? Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Picasso driver: amdgpu v: kernel Display: server: X.Org 1.20.8 driver: amdgpu resolution: 3840x2160~60Hz It just see nothing :-( amdgpu-ls AMD Wattman features enabled: 0xfffd7fff amdgpu version: UNKNOWN No AMD GPUs detected, exiting...

apt show ricks-amdgpu-utils Package: ricks-amdgpu-utils Version: 2.6.0-1

KeithMyers commented 4 years ago

Maybe Rick hasn't input the new PCI ID's for this card. Or you aren't running a distro recent enough to cover the new PCI ID's. See news at Phoronix.com all the time about new AMD PCI ID's being added to the upstream kernel changelogs. The "Renoir" APU's won't get support till kernel 5.8 for example. Lots of new AMD support in that kerenl. Temp reporting via k10temp, power reporting via hwmon and RAPL, CPPC Freq support etc. etc. https://www.phoronix.com/scan.php?page=article&item=amd-ryzen5-3400g&num=1

csecht commented 4 years ago

@MINIXJR , it looks like you are running version 2.6.0. Try downloading the new 3.2.0 release from git (not sure whether the ricks-amdgpu-utils distribution has been updated). I don't know whether the amdgpu driver package allows manipulation of APU graphics parameters.

Ricks-Lab commented 4 years ago

I did resolve several issues in dealing with integrated Picasso GPU in this thread. I suggest to manually install the latest version of amdgpu-utils. There have been many changes since v2.6. It took a lot of time to get the first version to be available as a package. Hopefully updating will be quicker. I will reach out to @smoe for help.

As Keith mentioned, there are likely pending kernel changes, so even with v3.2, you may see the integrated GPU classified as Unsupported. Installing amdgpu drivers may overcome this.

MINIXJR commented 4 years ago

Hello together, thank you for your quick response! As mentioned, I have purged the Ubuntu package and installed now from GIT. Also I have updated the pci.ids (My IDs are included) The output of amdgpu-ls look now like: `./amdgpu-ls Detected GPUs: AMD: 1 amdgpu/rocm version: UNKNOWN AMD: Wattman features enabled: 0xfffd7fff Warning: Error reading parameter: fan_pwm_range, disabling for this GPU: 0 Warning: Error reading parameter: pwm_mode, disabling for this GPU: 0 Warning: Error reading parameter: fan_pwm, disabling for this GPU: 0 1 total GPUs, 0 rw, 1 r-only, 0 w-only

Card Number: 0 Vendor: AMD Readable: True Writable: False Compute: False GPU UID: None Device ID: {'device': '0x15d8', 'subsystem_device': '0x15d8', 'subsystem_vendor': '0x1002', 'vendor': '0x1002'} Decoded Device ID: Picasso Card Model: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c8) Display Card Model: Picasso PCIe ID: 0a:00.0 Link Speed: 8 GT/s Link Width: 16 ################################################## Driver: amdgpu Compute Platform: None GPU Frequency/Voltage Control Type: Legacy HWmon: /sys/class/drm/card0/device/hwmon/hwmon1 Card Path: /sys/class/drm/card0/device System Card Path: /sys/devices/pci0000:00/0000:00:08.1/0000:0a:00.0 ################################################## Fan PWM Mode: [None, 'UNK'] Current Fan PWM (%): None Fan PWM Range (%): [None, None] ################################################## Current Temps (C): {'edge': 39.0} Critical Temps (C): {'edge': 80.0} Power DPM Force Performance Level: auto ` For me the most important information would be to see if the GPU is decoding a video or not and the load %. Is there any chance to get this information?

Ricks-Lab commented 4 years ago

I have not worked closely with an APU yet. Currently, your GPU is being classified as Legacy, but possibly it has more readable parameters than a real legacy GPU. If you run with debug option and post the log file, I can check if more parameters are readable.

MINIXJR commented 4 years ago

... and here it is. debug_gpu-utils_20200615-114341.log

Ricks-Lab commented 4 years ago

I have pushed a version to the 'extended' branch that should work better. Let me know.

What I really need is a way to know for sure that the GPU being used is an integrated APU. Perhaps one of the files in card path would give a clue. Unfortunately, I don't have a laptop running linux... Can you examine the files in Card Path: /sys/class/drm/card0/device to see? You can cat each one an let me know if anything looks relevant. Google search has not provided any clues yet.

MINIXJR commented 4 years ago

This is the result with the 'extended' branch: `Detected GPUs: AMD: 1 amdgpu/rocm version: UNKNOWN AMD: Wattman features enabled: 0xfffd7fff Warning: Error reading parameter: loading, disabling for this GPU: 0 Warning: Error reading parameter: mem_loading, disabling for this GPU: 0 Warning: Error reading parameter: power_cap_range, disabling for this GPU: 0 Warning: Error reading parameter: power, disabling for this GPU: 0 Warning: Error reading parameter: power_cap, disabling for this GPU: 0 Warning: Error reading parameter: voltages, disabling for this GPU: 0 1 total GPUs, 0 rw, 1 r-only, 0 w-only

Error getting p-states: /sys/class/drm/card0/device/pp_od_clk_voltage Card Number: 0 Vendor: AMD Readable: False Writable: False Compute: False Device ID: {'device': '0x15d8', 'subsystem_device': '0x15d8', 'subsystem_vendor': '0x1002', 'vendor': '0x1002'} Decoded Device ID: Picasso Card Model: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c8) PCIe ID: 0a:00.0 Driver: amdgpu GPU Frequency/Voltage Control Type: APU HWmon: /sys/class/drm/card0/device/hwmon/hwmon1 Card Path: /sys/class/drm/card0/device System Card Path: /sys/devices/pci0000:00/0000:00:08.1/0000:0a:00.0 Enclosed the information from the card path. for f in $(find /sys/class/drm/card0/device/ -type f);do cat $f > /tmp/${f////__};done` card0.tar.gz

Ricks-Lab commented 4 years ago

Can you give the latest on 'extended' branch a try when you have a chance? I found that the reading the p-states for APU was disabling reading. Getting rid of these error should make real issues more clear.

MINIXJR commented 4 years ago

Here is the update. `./amdgpu-ls Detected GPUs: AMD: 1 amdgpu/rocm version: UNKNOWN AMD: Wattman features enabled: 0xfffd7fff Warning: Error reading parameter: loading, disabling for this GPU: 0 Warning: Error reading parameter: mem_loading, disabling for this GPU: 0 Warning: Error reading parameter: power_cap_range, disabling for this GPU: 0 Warning: Error reading parameter: power, disabling for this GPU: 0 Warning: Error reading parameter: power_cap, disabling for this GPU: 0 Warning: Error reading parameter: voltages, disabling for this GPU: 0 1 total GPUs, 0 rw, 1 r-only, 0 w-only

Card Number: 0 Vendor: AMD Readable: True Writable: False Compute: False GPU UID: None Device ID: {'device': '0x15d8', 'subsystem_device': '0x15d8', 'subsystem_vendor': '0x1002', 'vendor': '0x1002'} Decoded Device ID: Picasso Card Model: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c8) Display Card Model: Picasso PCIe ID: 0a:00.0 Link Speed: 8 GT/s Link Width: 16 ################################################## Driver: amdgpu vBIOS Version: 113-PICASSO-115 Compute Platform: None GPU Frequency/Voltage Control Type: APU HWmon: /sys/class/drm/card0/device/hwmon/hwmon1 Card Path: /sys/class/drm/card0/device System Card Path: /sys/devices/pci0000:00/0000:00:08.1/0000:0a:00.0 ################################################## Current Power (W): None Power Cap (W): None Power Cap Range (W): [None, None] Fan Enable: None Fan PWM Mode: [None, 'UNK'] Fan Target Speed (rpm): None Current Fan Speed (rpm): None Current Fan PWM (%): None Fan Speed Range (rpm): [None, None] Fan PWM Range (%): [None, None] ################################################## Current GPU Loading (%): None Current Memory Loading (%): None Current GTT Memory Usage (%): 1.122 Current GTT Memory Used (GB): 0.034 Total GTT Memory (GB): 3.000 Current VRAM Usage (%): 21.656 Current VRAM Used (GB): 0.433 Total VRAM (GB): 2.000 Current Temps (C): {'edge': 38.0} Critical Temps (C): {'edge': 80.0} Current Voltages (V): None Vddc Range: ['', ''] Current Clk Frequencies (MHz): {'sclk': 269.0} Current SCLK P-State: [1, '254Mhz'] SCLK Range: ['', ''] Current MCLK P-State: [3, '1067Mhz'] MCLK Range: ['', ''] Power Profile Mode: 0-BOOTUP_DEFAULT Power DPM Force Performance Level: auto`

Ricks-Lab commented 4 years ago

I have updated a new version to eliminated fields that are definitely not applicable for APU. Still need to investigate the parameters with warning messages. I will work on some debug logger statements to provide more insight.

MINIXJR commented 4 years ago

`Detected GPUs: AMD: 1 amdgpu/rocm version: UNKNOWN AMD: Wattman features enabled: 0xfffd7fff Warning: Error reading parameter: loading, disabling for this GPU: 0 Warning: Error reading parameter: mem_loading, disabling for this GPU: 0 Warning: Error reading parameter: power_cap_range, disabling for this GPU: 0 Warning: Error reading parameter: power, disabling for this GPU: 0 Warning: Error reading parameter: power_cap, disabling for this GPU: 0 Warning: Error reading parameter: voltages, disabling for this GPU: 0 1 total GPUs, 0 rw, 1 r-only, 0 w-only

Card Number: 0 Vendor: AMD Readable: True Writable: False Compute: False GPU UID: None Device ID: {'device': '0x15d8', 'subsystem_device': '0x15d8', 'subsystem_vendor': '0x1002', 'vendor': '0x1002'} Decoded Device ID: Picasso Card Model: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c8) Display Card Model: Picasso PCIe ID: 0a:00.0 Link Speed: 8 GT/s Link Width: 16 ################################################## Driver: amdgpu vBIOS Version: 113-PICASSO-115 Compute Platform: None GPU Frequency/Voltage Control Type: APU HWmon: /sys/class/drm/card0/device/hwmon/hwmon1 Card Path: /sys/class/drm/card0/device System Card Path: /sys/devices/pci0000:00/0000:00:08.1/0000:0a:00.0 ################################################## Current Power (W): None Power Cap (W): None ################################################## Current GPU Loading (%): None Current Memory Loading (%): None Current GTT Memory Usage (%): 0.469 Current GTT Memory Used (GB): 0.014 Total GTT Memory (GB): 3.000 Current VRAM Usage (%): 8.058 Current VRAM Used (GB): 0.161 Total VRAM (GB): 2.000 Current Temps (C): {'edge': 36.0} Critical Temps (C): {'edge': 80.0} Current Voltages (V): None Current Clk Frequencies (MHz): {'sclk': 200.0} Current SCLK P-State: [0, '200Mhz'] Current MCLK P-State: [2, '933Mhz'] Power Profile Mode: 0-BOOTUP_DEFAULT Power DPM Force Performance Level: auto `

Ricks-Lab commented 4 years ago

Here is what I have found for the sensors with warnings:

Warning: Error reading parameter: loading, disabling for this GPU: 0

The gpu_busy_percent sensor file exists but contains no information.

Warning: Error reading parameter: mem_loading, disabling for this GPU: 0

The mem_busy_percent file doesn't exist

Warning: Error reading parameter: power_cap_range, disabling for this GPU: 0 Warning: Error reading parameter: power, disabling for this GPU: 0 Warning: Error reading parameter: power_cap, disabling for this GPU: 0

All power sensors are missing from HWMON directory.

Warning: Error reading parameter: voltages, disabling for this GPU: 0

Voltage sensors exist, but are empty.

Maybe loading the amdgpu driver package would resolve some of these issues, but it looks like one is not available for 20.04 yet.

KeithMyers commented 4 years ago

I think a much newer kernel is needed to get the power sensors into HWMON from what I have read. If you want to try out a newer kernel implementing the AMD Energy Driver updates into HWMON, Phoronix.com provided a link to a compiled version for those that don't want to compile their own. https://www.phoronix.com/misc/linux-image-5.7.0-rc6-amd-energy_5.7.0-rc6-amd-energy-1_amd64.deb https://www.phoronix.com/scan.php?page=news_item&px=AMD-Energy-Driver-Working-Well

Ricks-Lab commented 4 years ago

I think the newer kernel is required for full functionality without installing the amdgpu driver package, but I thought the capability could also be provided with the driver package.

KeithMyers commented 4 years ago

Could be, I get the power readings from Zen+ Threadripper and Zen 2 3950X from the out of tree Zenpower driver. https://github.com/ocerman/zenpower

Ricks-Lab commented 4 years ago

I just noticed that amdgpu 20.20 for Ubuntu 20.04 was released a few days ago. Can you try the utilities with it installed?

MINIXJR commented 4 years ago

Ok, I have updated the kernel, next stop the driver. You talk about this!?: https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-20 Enclosed the files from /sys/... . card0_5.7-rc6.tar.gz cat_error_5.7-rc6.txt `Detected GPUs: AMD: 1 amdgpu/rocm version: UNKNOWN AMD: Wattman features enabled: 0xfffd7fff Warning: Error reading parameter: loading, disabling for this GPU: 0 Warning: Error reading parameter: mem_loading, disabling for this GPU: 0 Warning: Error reading parameter: power_cap_range, disabling for this GPU: 0 Warning: Error reading parameter: power, disabling for this GPU: 0 Warning: Error reading parameter: power_cap, disabling for this GPU: 0 Warning: Error reading parameter: voltages, disabling for this GPU: 0 1 total GPUs, 0 rw, 1 r-only, 0 w-only

Card Number: 0 Vendor: AMD Readable: True Writable: False Compute: False GPU UID: None Device ID: {'device': '0x15d8', 'subsystem_device': '0x15d8', 'subsystem_vendor': '0x1002', 'vendor': '0x1002'} Decoded Device ID: Picasso Card Model: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c8) Display Card Model: Picasso PCIe ID: 0a:00.0 Link Speed: 8.0 GT/s PCIe Link Width: 16 ################################################## Driver: amdgpu vBIOS Version: 113-PICASSO-115 Compute Platform: None GPU Frequency/Voltage Control Type: APU HWmon: /sys/class/drm/card0/device/hwmon/hwmon0 Card Path: /sys/class/drm/card0/device System Card Path: /sys/devices/pci0000:00/0000:00:08.1/0000:0a:00.0 ################################################## Current Power (W): None Power Cap (W): None ################################################## Current GPU Loading (%): None Current Memory Loading (%): None Current GTT Memory Usage (%): 0.894 Current GTT Memory Used (GB): 0.027 Total GTT Memory (GB): 3.000 Current VRAM Usage (%): 29.239 Current VRAM Used (GB): 0.585 Total VRAM (GB): 2.000 Current Temps (C): {'edge': 38.0} Critical Temps (C): {'edge': 80.0} Current Voltages (V): None Current Clk Frequencies (MHz): {'sclk': 300.0} Current SCLK P-State: [1, '269Mhz'] Current MCLK P-State: [3, '1067Mhz'] Power Profile Mode: 0-BOOTUP_DEFAULT Power DPM Force Performance Level: auto`

MINIXJR commented 4 years ago

I have installed the driver, unfortunately dkms build amdgpu not with kernel 5.7, so I'm back on 5.6. `Detected GPUs: AMD: 1 AMD: amdgpu version: 20.20-1089974 AMD: Wattman features enabled: 0xfffd7fff Warning: Error reading parameter: loading, disabling for this GPU: 0 Warning: Error reading parameter: mem_loading, disabling for this GPU: 0 Warning: Error reading parameter: power_cap_range, disabling for this GPU: 0 Warning: Error reading parameter: power, disabling for this GPU: 0 Warning: Error reading parameter: power_cap, disabling for this GPU: 0 Warning: Error reading parameter: voltages, disabling for this GPU: 0 1 total GPUs, 0 rw, 1 r-only, 0 w-only

Card Number: 0 Vendor: AMD Readable: True Writable: False Compute: True GPU UID: None Device ID: {'device': '0x15d8', 'subsystem_device': '0x15d8', 'subsystem_vendor': '0x1002', 'vendor': '0x1002'} Decoded Device ID: Picasso Card Model: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c8) Display Card Model: Picasso PCIe ID: 0a:00.0 Link Speed: 8 GT/s Link Width: 16 ################################################## Driver: amdgpu vBIOS Version: 113-PICASSO-115 Compute Platform: OpenCL 2.0 AMD-APP (3110.6) GPU Frequency/Voltage Control Type: APU HWmon: /sys/class/drm/card0/device/hwmon/hwmon1 Card Path: /sys/class/drm/card0/device System Card Path: /sys/devices/pci0000:00/0000:00:08.1/0000:0a:00.0 ################################################## Current Power (W): None Power Cap (W): None ################################################## Current GPU Loading (%): None Current Memory Loading (%): None Current GTT Memory Usage (%): 0.338 Current GTT Memory Used (GB): 0.046 Total GTT Memory (GB): 13.679 Current VRAM Usage (%): 25.036 Current VRAM Used (GB): 0.501 Total VRAM (GB): 2.000 Current Temps (C): {'edge': 38.0} Critical Temps (C): {'edge': 80.0} Current Voltages (V): None Current Clk Frequencies (MHz): {'sclk': 225.0} Current SCLK P-State: [1, '210Mhz'] Current MCLK P-State: [3, '1067Mhz'] Power Profile Mode: 0-BOOTUP_DEFAULT Power DPM Force Performance Level: auto`

MINIXJR commented 4 years ago

After I did some testing yesterday, I uninstalled the driver again. Unfortunately other things don't work as expected now, va-api and vdpau. So I am back to the free version: https://github.com/M-Bab/linux-kernel-amdgpu-binaries. @Ricks-Lab , should we close the issue and wait for improvements within the kernel and the driver, or do you still have ideas?

Ricks-Lab commented 4 years ago

After I did some testing yesterday, I uninstalled the driver again. Unfortunately other things don't work as expected now, va-api and vdpau. So I am back to the free version: https://github.com/M-Bab/linux-kernel-amdgpu-binaries. @Ricks-Lab , should we close the issue and wait for improvements within the kernel and the driver, or do you still have ideas?

Thanks for checking it out. I agree we should close and revisit when the kernel is updated. I will leave the feature as is, since we anticipate how it will work with new kernel. Thanks for your engagement in the project!

MINIXJR commented 4 years ago

OK, thank you for your support. Do not hesitate to contact me if you need me for testing.