Last active
September 10, 2019 19:58
-
-
Save nottux/f59fe53ae9eacd1c8c09b21202df638d to your computer and use it in GitHub Desktop.
dpm utilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{sudo password here} {device number here} {.wav file here} {temperature degree here} {screenshot directory} | |
To watch temperature: | |
#old_one: | |
while true;do a=$(echo {sudo password here}|sudo -S cat /sys/kernel/debug/dri/{device number here}/amdgpu_pm_info|grep Temperature|tr -d ' GPUTmpratueC:');echo $a;cat /sys/class/drm/card{device number here}/device/power_dpm_force_performance_level;if [ $a -gt {temperature degree here} -a $a -ne 511 ];then aplay --device=pulse {.wav file here};else echo cool;fi;sleep 5;done | |
#New one: | |
while true;do a=$(echo {sudo password here}|sudo -S cat /sys/kernel/debug/dri/{device number here}/amdgpu_pm_info|grep Temperature|tr -d ' GPUTmpratueC:');echo $a;cat /sys/class/drm/card{device number here}/device/power_dpm_force_performance_level;if [ $a -gt {temperature degree here} -a $a -ne 511 -a $(cat /sys/class/drm/card{device number here}/device/power_dpm_force_performance_level) != auto ];then echo {sudo password here}|sudo -S su -c 'echo auto>/sys/class/drm/card{device number here}/device/power_dpm_force_performance_level';aplay --device=pulse {.wav file here};echo gpu set to auto;else echo cool;fi;sleep 5;done | |
To change dpm: | |
sh -c "echo {sudo password here}|sudo -S su -c 'if [ $(cat /sys/class/drm/card{device number here}/device/power_dpm_force_performance_level) != "high" ];then echo high>/sys/class/drm/card{device number here}/device/power_dpm_force_performance_level;else echo low>/sys/class/drm/card{device number here}/device/power_dpm_force_performance_level;fi'" | |
To change dpm to auto: | |
sh -c "echo {sudo password here}|sudo -S su -c 'if [ $(cat /sys/class/drm/card{device number here}/device/power_dpm_force_performance_level) != "auto" ];then echo auto>/sys/class/drm/card{device number here}/device/power_dpm_force_performance_level;fi'" | |
To set governer to "performance": | |
echo {sudo password here}|sudo -S su -c 'echo performance|tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor' | |
To enable boosting: | |
echo {sudo password here}|sudo -S su -c 'echo 1|tee /sys/devices/system/cpu/cpufreq/boost' | |
To take screenshot with scrot (requires date and scrot): | |
sh -c 'scrot /dev/shm/scrotshot.png;mv /dev/shm/scrotshot.png {screenshot directory}/$(date +%Y-%m-%d_%H:%M:%S:%N).png' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
added
-a $a -ne 511
to remove accidental beep after exiting a vulkan application