andre-richter / vfio-pci-bind Goto Github PK
View Code? Open in Web Editor NEWAutomatically bind a PCI device and all of it's IOMMU group members to vfio-pci
License: MIT License
Automatically bind a PCI device and all of it's IOMMU group members to vfio-pci
License: MIT License
I believe this line in the shell script is incorrect:
vfio-pci-bind/vfio-pci-bind.sh
Line 110 in ca6b660
In the Bourne Shell the "-ne" operator is meant for integer operations, since this is a string operation it should use "!=" or "==", right?
Also, it looks like the logic is reversed. Based on what the script is doing, and the corresponding line in the Ruby file:
vfio-pci-bind/vfio-pci-bind.rb
Line 103 in ca6b660
I believe this line should be:
if [[ "$curr_driver" == "vfio-pci" ]]; then
Can you double check and see if I am off base here?
Thanks for this script. It works well until you add hardware that changes your PCI addresses, and then there is a risk that the wrong device will be bound to vfio-pci. It would be a big problem if the host lost access to a nic or drive controller as a result.
I'd like to propose that the script accept a second (optional) parameter of the Vendor:Device
to bind. If the supplied Vendor:Device
is found at Domain:Bus:Device.Function
, then it can go ahead and bind the device. If something else is found at that address then it should not bind the device.
I will submit a pull request for a potential implementation of this.
Hi
Thank you for your work.
When I try to use the script my system hangs (waited for 10 min and still hanged) and I have to do a manual Computer Reset (press the physical button).
I have run it using:
sudo vfio-pci-bind.sh 0000:10:00.0 10de:107d
sudo vfio-pci-bind.sh 0000:10:00.1 10de:0e08
reversing the ID orders (10de:0e08 0000:10:00.1)
sudo vfio-pci-bind.sh 0000:10:00.0
sudo vfio-pci-bind.sh 0000:10:00.1
sudo vfio-pci-bind.sh 10de:107d
sudo vfio-pci-bind.sh 10de:0e08
Using "sudo su" before executing the commands.
After I press Enter, it outputs nothing and just hangs the PC, can't even use the mouse.
I have Debian 11.5 KDE. The MB BIOS has IOMMU and virtualization turned on. Linux has it enabled also. I tried using a manual procedure and it worked, but when installing the drivers on the guest I got the Code 43 error (turned off kvm and other workaround I found on the internet with no succes.. Even tried older NVidia Drivers). So I thought it was some misstep I did or the guide was to old and was missing a step. So I formatted the PC and installed Debian again (nothing lost, the previous installation was also fresh, preferred to star over from 0 then to reverse the steps of the manual guide).
What am I doing wrong?
Thank you in advanced!
Hi (:
first really big thank you for your script! <3
i plan to switch from vfio-pci on boot to doing it in system when the VM is needed.
So i can use the GPU for nativ gaming when VM is off.
So my question is now can you build a way to unbind vfio-pci and rebind with the driver?
with kind regards
Hi,
Thanks for making such great script it saves my day because I have some identical vfio ids on both gpu.
I have to add multiple devices bind on boot I tried like this but not working
KERNEL=="0000:4e:00.0","0000:4e:00.1","0000:4e:00.2","0000:4e:00.3", TAG="vfio-pci-bind"
and like this only first device was bounded
KERNEL=="0000:4e:00.0", TAG="vfio-pci-bind"
KERNEL=="0000:4e:00.1", TAG="vfio-pci-bind"
KERNEL=="0000:4e:00.2", TAG="vfio-pci-bind"
KERNEL=="0000:4e:00.3", TAG="vfio-pci-bind"
can you help please loop all devices ?
and besides script doesn't work using "sudo" but only as "sudo su -" root works
Using vfio-pci-bind.sh 0000:4e:00.0 one by one works but the bound gone after reboot ubuntu.
GPU 1
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73af] (rev c0)
03:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:ab28]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:ab28]
03:00.2 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73a6]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73a6]
03:00.3 Serial bus controller [0c80]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73a4]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:0408]
GPU 2
4e:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73bf] (rev c0)
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:0e3a]
4e:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:ab28]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:ab28]
4e:00.2 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73a6]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73a6]
4e:00.3 Serial bus controller [0c80]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:73a4]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:0408]
Thanks in advance
Cheers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.