From 7b4adb2336413ca7bed330b8516f8cb9e346b923 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Sat, 29 Jan 2022 23:02:26 -0600 Subject: [PATCH] Pushing local updates/improvements with verbosity Add more base dist `tuned` profiles, remove unused amdgpu power targets Add a handler to restart tuned on profile/template changes Replace underscores in generated profile paths with dashes, improved interpretation/ordering with `tuned-switcher` Rename `play.yml` -> `playbook.yml` Extend comments to include potential todos RE: automatic discovery --- play.yml => playbook.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) rename play.yml => playbook.yml (61%) diff --git a/play.yml b/playbook.yml similarity index 61% rename from play.yml rename to playbook.yml index 9f61fc5..af4fe34 100644 --- a/play.yml +++ b/playbook.yml @@ -3,18 +3,27 @@ become: yes vars: card: card0 # default to card0 - base_profiles: # standard tuned profiles available on Fedora + base_profiles: # standard tuned profiles available on Fedora, should dynamically discover? + - balanced - desktop + - latency-performance - network-latency + - network-throughput - powersave + - virtual-host amdgpu_profiles: # statically defined mapping of the contents in /sys/class/drm/{{ card }}/device/pp_power_profile_mode - - { name: 'bootup_default', value: 0 } - - { name: '3D_fullscreen', value: 1 } +# - { name: 'bootup_default', value: 0 } +# - { name: '3D_fullscreen', value: 1 } - { name: 'powersaving', value: 2 } - { name: 'video', value: 3 } - { name: 'VR', value: 4 } - - { name: 'compute', value: 5 } - - { name: 'custom', value: 6 } +# - { name: 'compute', value: 5 } +# - { name: 'custom', value: 6 } + handlers: + - name: restart tuned + ansible.builtin.service: + name: tuned + state: restarted tasks: - name: ensure tuned is installed package: @@ -23,7 +32,7 @@ - name: create custom profile directories file: state: directory - path: /etc/tuned/{{ item.1 }}_amdgpu_{{ item.0.name }} + path: /etc/tuned/{{ item.1 }}-amdgpu-{{ item.0.name }} mode: "0755" with_nested: - "{{ amdgpu_profiles }}" @@ -31,10 +40,11 @@ - name: template custom tuned profiles template: src: templates/tuned.conf.j2 - dest: /etc/tuned/{{ item.1 }}_amdgpu_{{ item.0.name }}/tuned.conf + dest: /etc/tuned/{{ item.1 }}-amdgpu-{{ item.0.name }}/tuned.conf owner: root group: root mode: "0644" with_nested: - "{{ amdgpu_profiles }}" - - "{{ base_profiles }}" \ No newline at end of file + - "{{ base_profiles }}" + notify: restart tuned