diff --git a/playbook.yml b/playbook.yml index 47f3e99..4a5a82d 100644 --- a/playbook.yml +++ b/playbook.yml @@ -42,7 +42,7 @@ when: (fed_ppdtuned_swap is not defined) or ('tuned' not in ansible_facts.packages) - name: determine GPU device in drm subsystem shell: - cmd: grep -ls ^connected /sys/class/drm/*/status | grep -o card[0-9] | sort | uniq | tail -1 + cmd: grep -ls ^connected /sys/class/drm/*/status | grep -o card[0-9] | sort | uniq | sort -h | tail -1 executable: /bin/bash changed_when: false register: card diff --git a/templates/amdgpu-clock.sh.j2 b/templates/amdgpu-clock.sh.j2 index 918eb5a..9be91f4 100644 --- a/templates/amdgpu-clock.sh.j2 +++ b/templates/amdgpu-clock.sh.j2 @@ -16,7 +16,7 @@ {# done this way to avoid issues with the card number possibly shifting after playbook run #} # dynamically determine the connected GPU using the DRM subsystem -CARD=$(/usr/bin/grep -ls ^connected /sys/class/drm/*/status | /usr/bin/grep -o 'card[0-9]' | /usr/bin/sort | /usr/bin/uniq | /usr/bin/tail -1) +CARD=$(/usr/bin/grep -ls ^connected /sys/class/drm/*/status | /usr/bin/grep -o 'card[0-9]' | /usr/bin/sort | /usr/bin/uniq | /usr/bin/sort -h | /usr/bin/tail -1) {# begin the templated script for 'default' profiles to reset state #} {% if 'default' in item.0.key %}