From 4f33aad200bc4f096327b2feb54878d18524d9e4 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Mon, 31 Jan 2022 19:18:10 -0600 Subject: [PATCH] find amdgpu hwmon file for max power limit --- playbook.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/playbook.yml b/playbook.yml index af4fe34..c921db8 100644 --- a/playbook.yml +++ b/playbook.yml @@ -25,6 +25,22 @@ name: tuned state: restarted tasks: + - name: find hwmon/max power capability file for {{ card }} + find: + paths: /sys/class/drm/{{ card }}/device/hwmon + file_type: file + recurse: yes + use_regex: yes + patterns: + - '^power1_cap_max$' + register: hwmon + - name: print hwmon + debug: + msg: "{{ hwmon }}" + - name: get max power capability for {{ card }} + slurp: + src: "{{ hwmon.files.0.path }}" + register: power_max - name: ensure tuned is installed package: name: tuned