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

PAC not working with new AMDGPU 20.10 package #70

Closed csecht closed 4 years ago

csecht commented 4 years ago

I just downloaded the newly released AMDGPU package, installed the OpenCL component to my Ubuntu 18.04.4 system and found that amdgpu-pac --execute could not read to the drm files for my two cards.

~/Desktop/Link to amdgpu-utils-2.7.0$ ./amdgpu-pac --execute
AMD Wattman features enabled: 0xfffd7fff
amdgpu version: 20.10-1048554
2 AMD GPUs detected, 2 may be compatible, checking...
2 are confirmed compatible.

Batch file completed: /home/craig/amdgpu-utils-2.7.0/pac_writer_98a5934db0234fcdbd9a29b32088dc3d.sh
Writing 2 changes to GPU /sys/class/drm/card1/device/
+ sudo sh -c echo '0 6' >  /sys/class/drm/card1/device/pp_dpm_sclk
[sudo] password for craig: 
sh: echo: I/O error
+ sudo sh -c echo '0  2' >  /sys/class/drm/card1/device/pp_dpm_mclk
sh: echo: I/O error
PAC execution complete.
Batch file completed: /home/craig/amdgpu-utils-2.7.0/pac_writer_9e1b20dd96a94012b1539767fdc6dba1.sh
Writing 2 changes to GPU /sys/class/drm/card2/device/
+ sudo sh -c echo '0  6' >  /sys/class/drm/card2/device/pp_dpm_sclk
sh: echo: I/O error
+ sudo sh -c echo '0  2' >  /sys/class/drm/card2/device/pp_dpm_mclk
sh: echo: I/O error
PAC execution complete.

My earlier post pointed out that PAC doesn't work at all with the latest Master, so I used the Master that was current several days ago. The older Master executes, but doesn't seem to have write permissions, so it's something with the AMDGPU upgrade. (My older startup PAC scripts to set parameters automatically on reboot no longer work either.) Luckily the default GPU run conditions are okay for now.

csecht commented 4 years ago

Nevermind. The problem was that I entered my edits to the p-state masks as "0, 6" for sckl and "0, 2" for mclk, instead of as "0,6" and "0,2". So perhaps, for unaware folks like me, an error check could be included in the amdgpu-pac module to scrub spaces where they should be in the entry fields.

Ricks-Lab commented 4 years ago

Is your error in setting sclk/mclk masking? I just tried on my RX-Vega64 system with no issues. Were there any issues with your installation?

Detected GPUs: AMD: 2
AMD: amdgpu version: 20.10-1048554
AMD: Wattman features enabled: 0xfffd7fff
Warning: Error reading parameter: mem_loading, disabling for this GPU: 0
Warning: Error reading parameter: mem_loading, disabling for this GPU: 1
2 total GPUs, 2 rw, 0 r-only, 0 w-only

# Write Delta mode.
Batch file completed: /home/rick/PyDev/amdgpu-utils/pac_writer_cccff56ffe2b42b985f3612725b60ef7.sh
Writing 1 changes to GPU /sys/class/drm/card0/device
+ sudo sh -c echo 'manual' >  /sys/class/drm/card0/device/power_dpm_force_performance_level
[sudo] password for rick: 
+ sudo sh -c echo '210000000' >  /sys/class/drm/card0/device/hwmon/hwmon5/power1_cap
PAC execution complete.
# Write Delta mode.
Batch file completed: /home/rick/PyDev/amdgpu-utils/pac_writer_abbca705725e4db69b5274054d261cf5.sh
Writing 2 changes to GPU /sys/class/drm/card0/device
+ sudo sh -c echo '5' >  /sys/class/drm/card0/device/pp_power_profile_mode
+ sudo sh -c echo '4 5 6' >  /sys/class/drm/card0/device/pp_dpm_sclk
PAC execution complete.
# Write Delta mode.
Batch file completed: /home/rick/PyDev/amdgpu-utils/pac_writer_8349abaf268c4ab383abb3585413f8fa.sh
Writing 2 changes to GPU /sys/class/drm/card0/device
+ sudo sh -c echo '4 5 6' >  /sys/class/drm/card0/device/pp_dpm_sclk
+ sudo sh -c echo '2 3' >  /sys/class/drm/card0/device/pp_dpm_mclk
csecht commented 4 years ago

We crossed posts in the mail. Your post came in as I posted mine. See my last comment.

Ricks-Lab commented 4 years ago

Nevermind. The problem was that I entered my edits to the p-state masks as "0, 6" for sckl and "0, 2" for mclk, instead of as "0,6" and "0,2". So perhaps, for unaware folks like me, an error check could be included in the amdgpu-pac module to scrub spaces where they should be in the entry fields.

Perhaps I can strip out spaces.

csecht commented 4 years ago

Thanks. LOL

Ricks-Lab commented 4 years ago

Completed the change.

Ricks-Lab commented 4 years ago

I made some more changes to print better messages when invalid entries are made and implemented more robust checking of pstate masks.