Skip to content

Commit

Permalink
Enable Debian 11 and Ubuntu 22.04 support in Chrome Remote Desktop mo…
Browse files Browse the repository at this point in the history
…dule
  • Loading branch information
tpdownes authored and mr0re1 committed May 4, 2023
1 parent f700bfc commit dce79b2
Showing 1 changed file with 37 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,28 @@
- name: Ensure nvidia grid drivers and other binaries are installed
hosts: localhost
become: true
vars:
packages:
bullseye:
- build-essential
- gdebi-core
- mesa-utils
- gdm3
jammy:
- build-essential
- gdebi-core
- mesa-utils
- gdm3
- gcc-12 # must match compiler used to build kernel on latest Ubuntu 22
- pkg-config # observed to be necessary for GRID driver installation on latest Ubuntu 22
- libglvnd-dev # observed to be necessary for GRID driver installation on latest Ubuntu 22
tasks:
- name: Fail if using wrong OS
ansible.builtin.assert:
that:
- ansible_os_family in ["Debian", "Ubuntu"]
- ansible_distribution_release in ["bullseye", "jammy"]

- name: Check if GRID driver installed
ansible.builtin.command: which nvidia-smi
register: nvidiasmi_result
Expand All @@ -28,17 +49,13 @@
register: uname_result
changed_when: false

- name: Set all packages
ansible.builtin.set_fact:
all_packages: '{{ packages[ansible_distribution_release] + ["linux-headers-" + uname_result.stdout] }}'

- name: Install binaries for GRID drivers
ansible.builtin.apt:
name:
- linux-headers-{{ uname_result.stdout }}
- build-essential
- gdebi-core
- mesa-utils
- gdm3
- gcc-12
- pkg-config
- libglvnd-dev
name: "{{ all_packages }}"
state: present
update_cache: true
register: apt_result
Expand All @@ -47,6 +64,7 @@
until: apt_result is success

- name: Install GRID driver if not existing
when: nvidiasmi_result is failed
block:
- name: Download GPU driver
ansible.builtin.get_url:
Expand All @@ -61,10 +79,14 @@

- name: Install GPU driver
ansible.builtin.shell: |
#jinja2: trim_blocks: "True"
{% if ansible_distribution_release == "jammy" %}
CC=gcc-12 /tmp/NVIDIA-Linux-x86_64-510.85.02-grid.run --silent
{% else %}
/tmp/NVIDIA-Linux-x86_64-510.85.02-grid.run --silent
{% endif %}
register: result
changed_when: result.rc == 0
when: nvidiasmi_result is failed

- name: Download VirtualGL driver
ansible.builtin.get_url:
Expand All @@ -86,7 +108,11 @@
changed_when: false

- name: Extract PCI ID
ansible.builtin.shell: echo "{{ gpu_info.stdout }}" | grep "PCI BusID " | head -n 1 | cut -d':' -f2-99 | xargs
ansible.builtin.shell: |
set -o pipefail
echo "{{ gpu_info.stdout }}" | grep "PCI BusID " | head -n 1 | cut -d':' -f2-99 | xargs
args:
executable: /bin/bash
register: pci_id
changed_when: false

Expand Down

0 comments on commit dce79b2

Please sign in to comment.