From f20e479c59d7a1e4cd9dfaaed886821f7523ebd6 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Thu, 5 May 2022 21:48:35 -0500 Subject: [PATCH] provide a multiplier to reduce AMDGPU power cap --- playbook.yml | 6 +++++- templates/tuned.conf.j2 | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/playbook.yml b/playbook.yml index e66522e..bf33ae6 100644 --- a/playbook.yml +++ b/playbook.yml @@ -2,6 +2,10 @@ - hosts: localhost become: yes vars: + power_max_multi: 0.90 # should not exceed 1.0, must be a float. note: driver seems to do its own rounding + power_max: "{{ power_max_b64['content'] | b64decode }}" + power_cap_float: "{{ power_max |float * power_max_multi }}" + power_cap: "{{ power_cap_float |int }}" card: card0 # default to card0 base_profiles: # standard tuned profiles available on Fedora, should dynamically discover? - balanced @@ -37,7 +41,7 @@ - name: get max power capability for {{ card }} slurp: src: "{{ hwmon.files.0.path }}" - register: power_max + register: power_max_b64 - name: ensure tuned is installed package: name: tuned diff --git a/templates/tuned.conf.j2 b/templates/tuned.conf.j2 index 4ff034e..23655fa 100644 --- a/templates/tuned.conf.j2 +++ b/templates/tuned.conf.j2 @@ -5,7 +5,8 @@ summary={{ item.1 }} + TCP/RAID tweaks + AMDGPU pp_power_profile_mode = {{ item. [sysfs] /sys/class/drm/{{ card }}/device/power_dpm_force_performance_level = manual /sys/class/drm/{{ card }}/device/pp_power_profile_mode = {{ item.0.value }} -/sys/class/drm/{{ card }}/device/hwmon/hwmon9/power1_cap = {{ power_max['content'] | b64decode }} +# limit to {{ power_max_multi * 100.0 |int }}% of the max power cap, nearest (higher) whole number +/sys/class/drm/{{ card }}/device/hwmon/hwmon9/power1_cap = {{ power_cap }} [sysctl] net.core.default_qdisc=fq