role/host_vars: properly prefix vars

This commit is contained in:
Josh Lay 2024-08-27 06:54:55 -05:00
parent d07e6ca2fb
commit da32dcc252
No known key found for this signature in database
GPG key ID: 47AA304B2243B579
5 changed files with 41 additions and 47 deletions

View file

@ -57,12 +57,12 @@
mode: '0644'
when: vars[item] is defined
with_items:
- gpu_clock_min
- gpu_clock_max
- gpumem_clock_static
- gpu_power_multi_def
- gpu_power_multi_oc
- gpu_mv_offset
- tuned_amdgpu_clock_min
- tuned_amdgpu_clock_max
- tuned_amdgpu_memclock_static
- tuned_amdgpu_power_multi_def
- tuned_amdgpu_power_multi_oc
- tuned_amdgpu_mv_offset
become: true
- name: Create custom profile directories

View file

@ -41,7 +41,7 @@ function amdgpu_profile_reset() {
echo 'r' | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
# adjust power limit using multiplier against board capability
POWER_LIM_DEFAULT=$(/usr/bin/awk -v m="$POWER_CAP" -v n="${TUNED_gpu_power_multi_def}" 'BEGIN {printf "%.0f", (m*n)}')
POWER_LIM_DEFAULT=$(/usr/bin/awk -v m="$POWER_CAP" -v n="${TUNED_tuned_amdgpu_power_multi_def}" 'BEGIN {printf "%.0f", (m*n)}')
echo "$POWER_LIM_DEFAULT" | tee "${HWMON_DIR}/power1_cap"
# extract the power-saving profile ID number
@ -56,13 +56,13 @@ function amdgpu_profile_reset() {
}
function amdgpu_profile_overclock() {
echo "s 0 ${TUNED_gpu_clock_min}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
echo "s 1 ${TUNED_gpu_clock_max}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
echo "m 1 ${TUNED_gpumem_clock_static}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
echo "s 0 ${TUNED_tuned_amdgpu_clock_min}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
echo "s 1 ${TUNED_tuned_amdgpu_clock_max}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
echo "m 1 ${TUNED_tuned_amdgpu_memclock_static}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
# under/over-voltage is considered optional or less likely to be defined, checked before use
if [[ -n ${TUNED_gpu_mv_offset} ]]; then
echo "vo ${TUNED_gpu_mv_offset}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
if [[ -n ${TUNED_tuned_amdgpu_mv_offset} ]]; then
echo "vo ${TUNED_tuned_amdgpu_mv_offset}" | tee /sys/class/drm/"${CARD}"/device/pp_od_clk_voltage
fi
# commit the changes
@ -74,7 +74,7 @@ function amdgpu_profile_overclock() {
echo 'manual' | tee /sys/class/drm/"${CARD}"/device/power_dpm_force_performance_level
# adjust power limit using multiplier against board capability
POWER_LIM_OC=$(/usr/bin/awk -v m="$POWER_CAP" -v n="${TUNED_gpu_power_multi_oc}" 'BEGIN {printf "%.0f", (m*n)}')
POWER_LIM_OC=$(/usr/bin/awk -v m="$POWER_CAP" -v n="${TUNED_tuned_amdgpu_power_multi_oc}" 'BEGIN {printf "%.0f", (m*n)}')
echo "$POWER_LIM_OC" | tee "${HWMON_DIR}/power1_cap"
# avoid display flickering, force OC'd memory to highest clock

View file

@ -14,8 +14,8 @@ include=/etc/tuned/amdgpu-profile-vars.conf
type=script
script={{ (tuned_amdgpu_profile_dir, 'amdgpu-clock.sh') | ansible.builtin.path_join }}
{# call the state-managing script with the selected profile, item.0, as an argument #}
{% if plugins is defined %}
{% for section, options in plugins.items() %}
{% if tuned_amdgpu_plugins is defined %}
{% for section, options in tuned_amdgpu_plugins.items() %}
{#+ give each plugin section some space +#}
[{{ section }}]
{% for key, value in options.items() %}