Skip to content

Commit

Permalink
nvidia: allow detection of older generation cards
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Sep 22, 2024
1 parent 82732da commit 87a61cf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions roles/nvidia/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@

- name: Fetch Nvidia card info
ansible.builtin.shell: |
if [ `lspci | grep -c -E '.*VGA.*NVIDIA'` -eq 1 ]; then
lspci -s $(lspci | grep -E '.*VGA.*NVIDIA' | cut -d' ' -f 1)
else
echo ""
fi
if [ `lspci | grep -c -E '.*VGA.*NVIDIA|.*3D controller.*NVIDIA'` -eq 1 ]; then
lspci -s $(lspci | grep -E '.*VGA.*NVIDIA|.*3D controller.*NVIDIA' | cut -d' ' -f 1)
else
echo ""
fi
register: lspci_resp
changed_when: false

- name: Fail if no GPU was detected
ansible.builtin.fail:
Expand Down

0 comments on commit 87a61cf

Please sign in to comment.