35 lines
1.2 KiB
Django/Jinja
35 lines
1.2 KiB
Django/Jinja
#!/bin/bash
|
|
# script for tuned AMDGPU clock control
|
|
# clocks in 3D usage are dynamic based on need/usage
|
|
#
|
|
# this sets the minimums / maximums
|
|
#
|
|
# rendered by Ansible with environment-appropriate values:
|
|
# card #, eg: card0
|
|
# min/max GPU clocks
|
|
|
|
# send a reset for a clean slate
|
|
# echo 'r' | tee /sys/class/drm/{{ card }}/device/pp_od_clk_voltage
|
|
|
|
# set manual control mode
|
|
echo 'manual' | tee /sys/class/drm/{{ card }}/device/power_dpm_force_performance_level
|
|
|
|
# set the minimum GPU clock
|
|
echo 's 0 {{ gpu_clock_min }}' | tee /sys/class/drm/{{ card }}/device/pp_od_clk_voltage
|
|
|
|
# set the maximum GPU clock
|
|
echo 's 1 {{ gpu_clock_max }}' | tee /sys/class/drm/{{ card }}/device/pp_od_clk_voltage
|
|
|
|
# set the maximum GPU *memory* clock
|
|
echo 'm 1 {{ gpumem_clock_max }}' | tee /sys/class/drm/{{ card }}/device/pp_od_clk_voltage
|
|
|
|
{% if gpu_mv_offset is defined %}
|
|
# offset GPU voltage {{ gpu_mv_offset }}mV
|
|
echo 'vo {{ gpu_mv_offset }}' | tee /sys/class/drm/{{ card }}/device/pp_od_clk_voltage
|
|
{% endif %}
|
|
|
|
# commit the changes
|
|
echo 'c' | tee /sys/class/drm/{{ card }}/device/pp_od_clk_voltage
|
|
|
|
# force GPU memory into highest profile
|
|
echo '3' | tee /sys/class/drm/{{ card }}/device/pp_dpm_mclk
|