Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Ensure "linux-modules-extra" package is installed on Ubuntu.
Browse files Browse the repository at this point in the history
Set "xilinx_xrt_ensure_compatible_kernel" to "false" by default.
  • Loading branch information
JGoutin committed Feb 17, 2022
1 parent f609bac commit 793f110
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The role requires to be run as root on the target host.
* **xilinx_xrt_platforms**: List of FPGA platforms. If specified, install related deployment target platform packages.
Supported values in the list: `u50`, `u55c`, `u200`, `u250`, `u280`.
* **xilinx_xrt_ensure_compatible_kernel**: If `true`, ensure the Linux kernel installed is compatible.
Default to `true`.
Default to `false`.
* **xilinx_xrt_bashrc**: If `true`, add the source of the XRT setup script to the user `~/.bashrc`.
Default to `false`.
* **xilinx_xrt_check_fpga**: If `true`, check if XRT is properly installed by trying to detect FPGA.
Expand Down Expand Up @@ -68,7 +68,7 @@ The following is only available when **xilinx_xrt_env** is set to `aws`.
Extra variable associated with [Xilinx Video SDK](https://github.com/Xilinx/video-sdk) for Alveo U30/AWS VT1.

* **xilinx_video_sdk_install**: If `true`, install Xilinx video SDK.
Default to `true`.
Default to `false`.
* **xilinx_video_sdk_version**: Xilinx video SDK version to install.
Default to the latest available.

Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _xilinx_xrt_env: "{{ xilinx_xrt_env | default('') }}"
xilinx_xrt_version: "{{ _xilinx_xrt_env | xrt_latest(ansible_facts) }}"

# Linux kernel version compatibles with XRT
xilinx_xrt_ensure_compatible_kernel: true
xilinx_xrt_ensure_compatible_kernel: false

# Check if properly installed by trying to detect FPGA
xilinx_xrt_check_fpga: false
Expand Down
2 changes: 1 addition & 1 deletion tasks/aws_fpga.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
executable: /bin/bash
when: not libfpga_mgmt.stat.exists

- include_tasks: kernel_headers.yml
- include_tasks: kernel.yml
when: aws_fpga_driver is defined

- name: Install AWS FPGA alternate driver
Expand Down
29 changes: 26 additions & 3 deletions tasks/kernel_headers.yml → tasks/kernel.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Ensure Kernel headers RPM are installed
- name: Ensure Kernel headers are installed
package:
name:
- "kernel-devel-{{ ansible_kernel }}"
Expand All @@ -17,21 +17,44 @@
- not (xilinx_xrt_container | bool)

- block:
- name: Ensure Kernel headers DEB are installed
- name: Ensure Kernel headers are installed
apt:
name: "linux-headers-{{ ansible_kernel }}"
retries: 10
delay: 1
register: _kernel_deb
until: _kernel_deb is successful

- name: Ensure Kernel modules are installed
apt:
name: "linux-modules-extra-{{ ansible_kernel }}"
retries: 10
delay: 1
register: _kernel_modules_deb
until: _kernel_modules_deb is successful

rescue:
- name: Ensure Kernel headers DEB are installed
- name: Ensure Kernel headers are installed
apt:
name: "linux-headers-{{ ansible_kernel }}-generic"
retries: 10
delay: 1
register: _kernel_deb
until: _kernel_deb is successful

- name: Ensure Kernel modules are installed
apt:
name: "linux-modules-extra-{{ ansible_kernel }}-generic"
retries: 10
delay: 1
register: _kernel_modules_deb
until: _kernel_modules_deb is successful

always:
- name: Ensure system rebooted after kernel module install
reboot:
when: _kernel_modules_deb.changed | bool

when:
- ansible_os_family == 'Debian'
- not (xilinx_xrt_container | bool)
6 changes: 2 additions & 4 deletions tasks/video_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
until: vsdk_tar is successful
when: not vsdk_xclbin.stat.exists

- include_tasks: kernel_headers.yml
- include_tasks: kernel.yml
when: not vsdk_xclbin.stat.exists

- name: Set Xilinx Video SDK release directory
Expand All @@ -49,9 +49,7 @@

- name: Ensure Xilinx Video SDK dependencies are present
apt:
name:
- "linux-modules-extra-{{ ansible_kernel }}"
- python
name: python
state: present
install_recommends: false
retries: 10
Expand Down
2 changes: 1 addition & 1 deletion tasks/xrt_from_pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "8"

- include_tasks: kernel_headers.yml
- include_tasks: kernel.yml

0 comments on commit 793f110

Please sign in to comment.