properly select the highest connected GPU
This commit is contained in:
parent
70e756e01a
commit
471e055ca5
2 changed files with 2 additions and 2 deletions
|
@ -42,7 +42,7 @@
|
||||||
when: (fed_ppdtuned_swap is not defined) or ('tuned' not in ansible_facts.packages)
|
when: (fed_ppdtuned_swap is not defined) or ('tuned' not in ansible_facts.packages)
|
||||||
- name: determine GPU device in drm subsystem
|
- name: determine GPU device in drm subsystem
|
||||||
shell:
|
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
|
executable: /bin/bash
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: card
|
register: card
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
{# done this way to avoid issues with the card number possibly shifting after playbook run #}
|
{# done this way to avoid issues with the card number possibly shifting after playbook run #}
|
||||||
# dynamically determine the connected GPU using the DRM subsystem
|
# 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 #}
|
{# begin the templated script for 'default' profiles to reset state #}
|
||||||
{% if 'default' in item.0.key %}
|
{% if 'default' in item.0.key %}
|
||||||
|
|
Loading…
Reference in a new issue