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

Simplify vfio driver setup (accelerated networking tutorial) #71

Closed
gruyaume opened this issue Dec 16, 2024 · 0 comments · Fixed by #72
Closed

Simplify vfio driver setup (accelerated networking tutorial) #71

gruyaume opened this issue Dec 16, 2024 · 0 comments · Fixed by #72
Labels
enhancement New feature or request

Comments

@gruyaume
Copy link
Collaborator

Enhancement Proposal

The current tutorial is making the users' life unnecessarily complex for setting up vfio. We can remove most of what's in this section since in the VM IOMMU will always be disabled.

Load the vfio-pci driver in the User Plane VM
As root user, load the vfio-pci driver. To make it persistent upon VM restarts, add it to the /etc/rc.local file.

cat << EOF | sudo tee -a /etc/rc.local
#!/bin/bash
sudo echo "vfio-pci" > /etc/modules-load.d/vfio-pci.conf
sudo modprobe vfio-pci
EOF
sudo chmod +x /etc/rc.local
sudo /etc/rc.local
Note

Using vfio-pci, by default, needs IOMMU to be enabled. IOMMU support could be checked by running the command ls /sys/kernel/iommu_groups/. If IOMMU groups do not exist in the command output then it is not supported. In the environments which do not support IOMMU, vfio-pci needs to be loaded with additional module parameter persistently using the command below.

Enable VFIO driver unsafe IOMMU mode if IOMMU mode is not supported:

cat << EOF | sudo sudo tee -a /etc/rc.local
sudo echo "options vfio enable_unsafe_noiommu_mode=1" > /etc/modprobe.d/vfio-noiommu.conf
sudo echo "Y" > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
sudo modprobe vfio enable_unsafe_noiommu_mode=1
EOF
sudo chmod +x /etc/rc.local
sudo /etc/rc.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant