Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD GPU performance mode feedback #1

Closed
vinifmor opened this issue Oct 5, 2021 · 18 comments
Closed

AMD GPU performance mode feedback #1

vinifmor opened this issue Oct 5, 2021 · 18 comments
Labels
AMD Issue relatade to AMD hardware need feedback

Comments

@vinifmor
Copy link
Owner

vinifmor commented Oct 5, 2021

Unfortunately, I currently have no AMD GPU to test if the "performance/compute" mode is properly being set. I've coded the behavior and written unit tests though.

The code responsible to make this happen is located here.

Feedback is welcome.

@vinifmor vinifmor added help wanted Extra attention is needed AMD Issue relatade to AMD hardware need feedback labels Oct 5, 2021
@vinifmor vinifmor pinned this issue Oct 6, 2021
@vinifmor vinifmor removed the help wanted Extra attention is needed label Oct 12, 2021
@Templayer
Copy link

I do have both an AMD APU (Ryzen 7) and a dedicated AMD GPU on the same computer.

Tell me what commands etc. I should run to test if it is properly set. Extremely simply, preferably.

@vinifmor
Copy link
Owner Author

  1. First check the content of the following files:
  • /sys/bus/pci/drivers/amdgpu/0/power_dpm_force_performance_level
  • /sys/bus/pci/drivers/amdgpu/0/pp_compute_power_profile
  1. Then follow the 2 first steps of the Quick Start section and keep the media player (vlc or other application you launched) running.

  2. Check if the files contents have changed.

  3. Stop the media player.

  4. Check if the files have the original content set

(if possible, paste the contents of these files here)

@Templayer
Copy link

  1. First check the content of the following files:
  • /sys/bus/pci/drivers/amdgpu/0/power_dpm_force_performance_level
  • /sys/bus/pci/drivers/amdgpu/0/pp_compute_power_profile
  1. Then follow the 2 first steps of the Quick Start section and keep the media player (vlc or other application you launched) running.
  2. Check if the files contents have changed.
  3. Stop the media player.
  4. Check if the files have the original content set

(if possible, paste the contents of these files here)

I'm going to try that on Friday unless I forget. I've sent an email to myself about this, so I hopefully won't. :D

@Templayer
Copy link

There is no "0" folder in /sys/bus/pci/drivers/amdgpu/

(used root to check)

image

Opening the 000... 7 folder hard-froze my computer. And when I mean hard, I mean hard. Even the cooling stopped running, but the screen display was stuck on me opening that folder. D:

image

@Templayer
Copy link

Templayer commented Mar 16, 2022

Hardware info might be useful here: (also please note that I dislike MSI, but it was the only non-Intel based decent gaming laptop available in my country back then. Those had a boom shortly afterwards, to my chagrin)

System:
Kernel: 5.4.0-104-generic x86_64 bits: 64 compiler: gcc v: 9.3.0
Desktop: Cinnamon 5.2.7 Distro: Linux Mint 20.3 Una
base: Ubuntu 20.04 focal
Machine:
Type: Laptop System: Micro-Star product: Bravo 17 A4DDR v: REV:1.0
serial:
Mobo: Micro-Star model: MS-17FK v: REV:1.0 serial:
UEFI: American Megatrends v: E17FKAMS.113 date: 05/18/2020
Battery:
ID-1: BAT1 charge: 44.9 Wh condition: 47.8/51.3 Wh (93%)
model: MSI Corp. MS-17FK status: Unknown
CPU:
Topology: 8-Core model: AMD Ryzen 7 4800H with Radeon Graphics bits: 64
type: MT MCP arch: Zen rev: 1 L2 cache: 4096 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
bogomips: 92630
Speed: 1397 MHz min/max: 1400/2900 MHz Core speeds (MHz): 1: 1397 2: 1398
3: 1238 4: 1337 5: 1390 6: 1240 7: 1444 8: 1557 9: 1397 10: 1396 11: 1397
12: 1396 13: 1397 14: 1397 15: 1248 16: 1374
Graphics:
Device-1: AMD Navi 14 [Radeon RX 5500/5500M / Pro 5500M]
vendor: Micro-Star MSI driver: amdgpu v: kernel bus ID: 03:00.0
Device-2: AMD Renoir vendor: Micro-Star MSI driver: amdgpu v: kernel
bus ID: 07:00.0
Display: server: X.Org 1.20.13 driver: amdgpu,ati
unloaded: fbdev,modesetting,radeon,vesa
resolution: 1920x1080~120Hz, 2560x1440~60Hz
OpenGL: renderer: AMD RENOIR (DRM 3.35.0 5.4.0-104-generic LLVM 12.0.0)
v: 4.6 Mesa 21.2.6 direct render: Yes
Audio:
Device-1: AMD Navi 10 HDMI Audio vendor: Micro-Star MSI
driver: snd_hda_intel v: kernel bus ID: 03:00.1
Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor
vendor: Micro-Star MSI driver: N/A bus ID: 07:00.5
Device-3: AMD Family 17h HD Audio vendor: Micro-Star MSI
driver: snd_hda_intel v: kernel bus ID: 07:00.6
Device-4: C-Media Audio Adapter (Unitek Y-247A) type: USB
driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-2.3:4
Sound Server: ALSA v: k5.4.0-104-generic
Network:
Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel bus ID: 04:00.0
IF: wlp4s0 state: up mac:
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: Micro-Star MSI driver: r8169 v: kernel port: f000 bus ID: 05:00.0
IF: enp5s0 state: up speed: 100 Mbps duplex: full mac:
Device-3: D-Link type: USB driver: rtl8xxxu bus ID: 3-1.4:7
IF: wlx60634ce25ee4 state: down mac:
Drives:
Local Storage: total: 942.70 GiB used: 518.24 GiB (55.0%)
ID-1: /dev/nvme0n1 vendor: Toshiba model: N/A size: 476.94 GiB
ID-2: /dev/sda vendor: Western Digital model: WD5000LPLX-22ZNTT0
size: 465.76 GiB temp: 35 C
Partition:
ID-1: / size: 137.76 GiB used: 77.72 GiB (56.4%) fs: ext4
dev: /dev/nvme0n1p5
ID-2: /home size: 136.49 GiB used: 96.29 GiB (70.6%) fs: ext4
dev: /dev/nvme0n1p6
Sensors:
System Temperatures: cpu: 64.2 C mobo: N/A
Fan Speeds (RPM): N/A
GPU: device: amdgpu temp: 0 C device: amdgpu temp: 63 C fan: 65535
Info:
Processes: 495 Uptime: 12m Memory: 38.65 GiB used: 4.37 GiB (11.3%)
Init: systemd runlevel: 5 Compilers: gcc: 9.4.0 Shell: bash v: 5.0.17
inxi: 3.0.38

Renoir is the APU, Navi is the dedicated GPU.

@vinifmor
Copy link
Owner Author

Sorry, I should've mentioned that the "0" could be different for every device. It is basic the device id. Please, try a cat command instead of opening through the graphical interface.

e.g: cat /sys/bus/pci/drivers/amdgpu/0.0.0.7.../power_dpm_force_performance_level

@Templayer
Copy link

Templayer commented Mar 22, 2022

I'll be editing this comment after posting the first data, just in the case of a crash or something. Last time I wasn't prepared for the total freeze that happened.

image

Looks like that pp thing you have mentioned either has a typo, or I don't have it.

Applying guapow and results:

image

The PP files do not exist (yet again).

Also, I wonder - if I'm already using guapow to optimize things, wouldn't any changes be already applied? I'll give you the logs.

guapow logs 22.3.2022.txt

@Templayer
Copy link

@vinifmor The last comment was appended/edited.

@vinifmor
Copy link
Owner Author

@Templayer , thanks for the feedback. I will have a look on the missing file.

About the optimizations: you should define the changes. For instance: if you want more CPU priority for a process, you can request a negative nice value (cpu.nice=-1). If you want your CPU in maximum performance when target process launches, you can use cpu.performance. The project's README file has all the current possibilities.

Example: GUAPOW_CONFIG="cpu.performance proc.nice=-1" guapow vlc

You can also create optimization profiles and auto optimizing with the watcher service.

@Templayer
Copy link

Templayer commented Mar 22, 2022

@Templayer , thanks for the feedback. I will have a look on the missing file.

About the optimizations: you should define the changes. For instance: if you want more CPU priority for a process, you can request a negative nice value (cpu.nice=-1). If you want your CPU in maximum performance when target process launches, you can use cpu.performance. The project's README file has all the current possibilities.

Example: GUAPOW_CONFIG="cpu.performance proc.nice=-1" guapow vlc

You can also create optimization profiles and auto optimizing with the watcher service.

Yeap, I've read the tutorials/documentation. I haven't yet had the needs for the cpu.nice (I can set that from the process manager in Linux Mint) or cpu.performance (I think it's already at that? I think I had that set up - if I'm not on battery power, that is).

For now, I'm just running the default optimization in the watcher for some bigger processes (as you can see from the logs that I've attached in my previous to the last comment) - Brave (a browser derived from Chrome), Java (IntelliJ Idea + the applications that I'm developing), Wine (i.e. anything that runs under it), Cinnamon, SMPlayer,...

Then follow the 2 first steps of the Quick Start section and keep the media player (vlc or other application you launched) running.

Also, the Quick Start section doesn't contain anything about GPU in those two first steps. It only contains cpu.performance. Maybe I should've done the steps provided, but with GPU settings instead? (should have been told in this case, because I'm a bit clueless).

Actually, if I don't set up a profile and just go with default everything, and then just add application names to the map for the watcher, the logs are logging optimization for said applications (well, for some of them) - what is happening there? I couldn't find default optimizations in the documentation. I might just be very drowsy, though. Goddamn sleep-deprivation! :D

I had to edit this comment like a bazillion times because I keep forgetting stuff or make typos.

@vinifmor
Copy link
Owner Author

There is no default profile indeed. But you can generate some pre-defined templates with guapow-cli. For instance: guapow-cli gen-profile media or guapow-cli gen-profile game

@Templayer
Copy link

Nifty, I'll try that out eventually.

Then follow the 2 first steps of the Quick Start section and keep the media player (vlc or other application you launched) running.

Also, the Quick Start section doesn't contain anything about GPU in those two first steps. It only contains cpu.performance. Maybe I should've done the steps provided, but with GPU settings instead? (should have been told in this case, because I'm a bit clueless).

What about this? As far as I know, the first two steps just change cpu to performance mode and it doesn't do anything with the GPU, which is what we are trying to test in this Issue?

@vinifmor
Copy link
Owner Author

You're right. I forgot to mention that. You just need to add the gpu.performance property to the config/profile.

@Templayer
Copy link

Shouldn't launching an application via the steps provided just with gpu.performance instead of cpu.performance be enough? I don't quite see the reason for creating a profile for that. Yet.

@Templayer
Copy link

@vinifmor
I don't think it's working. Unless I'm doing something wrong.

image

(without closing vlc)

image

@Templayer
Copy link

Oh, your software thinks I have Nvidia GPUs!

bře 24 10:50:13 JB-PC guapow-opt[1391]: New request: pid: 81041, command: vlc, user_name: jboksa1, created_at: 2022-03-24 10:50:13.818521, config: gpu.performance proc.nice=-1
bře 24 10:50:13 JB-PC guapow-opt[1391]: Nvidia GPUs cannot be managed: 'nvidia-settings' is not installed
bře 24 10:50:13 JB-PC guapow-opt[1391]: Process 81041 nice level changed to '-1' (request=81041)

@vinifmor
Copy link
Owner Author

It is problably not working because the other AMD files is not available.

In relation to Nvidia: it is just checking if you have the drivers and required software installed.

@vinifmor
Copy link
Owner Author

you can bypass the checks by setting your GPU model on the optimizer configuration file

@vinifmor vinifmor mentioned this issue Jun 8, 2022
Merged
@vinifmor vinifmor closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMD Issue relatade to AMD hardware need feedback
Projects
None yet
Development

No branches or pull requests

2 participants