Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPU Passthrough role #28

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Add GPU Passthrough role #28

wants to merge 10 commits into from

Conversation

technowhizz
Copy link

Needs to merge after #21

@technowhizz technowhizz self-assigned this Mar 27, 2024
@technowhizz technowhizz requested a review from a team as a code owner March 27, 2024 16:31
@technowhizz technowhizz force-pushed the gpu-passthrough branch 5 times, most recently from b7652f1 to ff65507 Compare March 27, 2024 17:19
@technowhizz technowhizz force-pushed the gpu-passthrough branch 2 times, most recently from 79259ec to 38d09d7 Compare April 8, 2024 15:30
Changes the conditional to search for 'Intel' in the
ansible_facts.processor variable as the first item in the list is not
always consistent.
@@ -34,12 +34,20 @@
ansible.builtin.include_role:
name: stackhpc.linux.grubcmdline
vars:
kernel_cmdline: "{{ ['intel_iommu=on'] + (['vfio-pci.ids=' + iommu_vfio_pci_ids] if iommu_vfio_pci_ids is defined else []) }}" # noqa: var-naming[no-role-prefix]
kernel_cmdline: "{{ ['intel_iommu=on'] }}" # noqa: var-naming[no-role-prefix]
kernel_cmdline_remove: # noqa: var-naming[no-role-prefix]
- ^intel_iommu=
- ^vfio-pci\.ids=
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we also remove this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot - done

roles/iommu/tasks/main.yml Outdated Show resolved Hide resolved
roles/iommu/tasks/main.yml Show resolved Hide resolved
@@ -0,0 +1,20 @@
---
- name: Regenerate initramfs (RedHat)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed to run after the reboot handler

# but it can help with dmesg spam in newer kernels (centos8?). Sample
# dmesg log message:
# [ +0.000002] kvm [8348]: vcpu0, guest rIP: 0xffffffffb0a767fa ignored rdmsr: 0x619
# options kvm report_ignored_msrs=N
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe should uncomment by default

ansible.builtin.blockinfile:
path: /etc/dracut.conf.d/gpu-vfio.conf
block: |
add_drivers+="vfio vfio_iommu_type1 vfio_pci vfio_virqfd"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw warnings about this configuration:

2024-08-27T12:52:11+0000 INFO /etc/dracut.conf.d/gpu-vfio.conf:add_drivers+="vfio vfio_iommu_type1 vfio_pci vfio_virqfd"

dracut: WARNING: <key>+=" <values> ": <values> should have surrounding white spaces!
dracut: WARNING: This will lead to unwanted side effects! Please fix the configuration file.

dracut-install: Failed to find module 'vfio_virqfd'
dracut: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/dracut.kNu52l/initramfs --kerneldir /lib/modules/5.14.0-362.24.1.el9_3.0.1.x86_64/ -m vfio vfio_iommu_type1 vfio_pci vfio_virqfd
/etc/dracut.conf.d/gpu-vfio.conf:add_drivers+="vfio vfio_iommu_type1 vfio_pci vfio_virqfd"

dracut: WARNING: <key>+=" <values> ": <values> should have surrounding white spaces!
dracut: WARNING: This will lead to unwanted side effects! Please fix the configuration file.

dracut-install: Failed to find module 'vfio_virqfd'
dracut: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/dracut.gebJKd/initramfs --kerneldir /lib/modules/5.14.0-362.24.1.el9_3.0.1.x86_64/ -m vfio vfio_iommu_type1 vfio_pci vfio_virqfd

Please fix the syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants