diff --git a/roles/gpu_passthrough/README.md b/roles/gpu_passthrough/README.md new file mode 100644 index 0000000..8ca33d5 --- /dev/null +++ b/roles/gpu_passthrough/README.md @@ -0,0 +1,12 @@ +# stackhpc.linux.iommu + +## Example playbook + +``` +--- +- name: Enable GPU Passthrough + hosts: gpu_passthrough + tasks: + - import_role: + name: stackhpc.linux.gpu_passthrough +``` diff --git a/roles/gpu_passthrough/defaults/main.yml b/roles/gpu_passthrough/defaults/main.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/roles/gpu_passthrough/defaults/main.yml @@ -0,0 +1 @@ +--- diff --git a/roles/gpu_passthrough/tasks/main.yml b/roles/gpu_passthrough/tasks/main.yml new file mode 100644 index 0000000..9c784c7 --- /dev/null +++ b/roles/gpu_passthrough/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: Blacklist nouveau + 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