Skip to content

Commit

Permalink
Add GPU Passthrough role
Browse files Browse the repository at this point in the history
  • Loading branch information
technowhizz committed Mar 27, 2024
1 parent 8a81227 commit e719049
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/gpu_passthrough/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# stackhpc.linux.iommu

## Example playbook

```
---
- name: Enable GPU Passthrough
hosts: gpu_passthrough
tasks:
- import_role:
name: stackhpc.linux.gpu_passthrough
```
1 change: 1 addition & 0 deletions roles/gpu_passthrough/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
20 changes: 20 additions & 0 deletions roles/gpu_passthrough/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Blacklist nouveau

Check failure on line 2 in roles/gpu_passthrough/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint / Ansible 2.12 lint

parser-error conflicting action statements: ansible.builtin.blockinfile, handlers

Check failure on line 2 in roles/gpu_passthrough/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint / Ansible 2.14 lint

syntax-check[specific]

conflicting action statements: ansible.builtin.blockinfile, handlers
ansible.builtin.blockinfile:
path: /etc/modprobe.d/blacklist-nouveau.conf
block: |
blacklist nouveau
options nouveau modeset=0
mode: "0664"
owner: root
group: root
create: true
handlers:
- import_tasks: iommu/handlers/main.yml
become: true
notify:
- reboot
- Regenerate initramfs
- name: Add IOMMU config to kernel command line
ansible.builtin.include_role:
name: stackhpc.linux.iommu

0 comments on commit e719049

Please sign in to comment.