When using their ls-iommu script It only shows one GPU. I tried unplugging one of my GPUs and now I am using the other GPU but it still has the same id as the other one.
I am using two GTX 1050 Ti.
Greetings
Flowstar
Edit Interestingly they show up. If I have both GPUs plugged in then I get the same “VGA Controller …” two times. If I unplug one of them I only get that line once. But always with the same ID.
On Nvidia, you can just unbind nouveau or nvidia from the GPU you want to pass through, using the sysfs module unbind feature.
Can you post the output of ls-iommu and the rest of your system specs? That shouldn’t be happening.
So there is device ID (think of it as device model number) and device address which is how you find the device on the PCIe tree.
The address is the 06:00.1 segment. Those should be different, so you can identify the devices that way. How to determine which GPU is which, that’s a different story. I think you need to use trial and error because they’re numbered sequentially, for example:
you’ve got two GPUs, one at 12:00 and one at 11:00. You unplug the 11:00 one and the one at 12:00 then gets addressed at 11:00.
Those are kernel command line options. On most distros, that can be found in /etc/default/grub, but I forget if Ubuntu follows that standard. if you edit that file, it should look something like this:
I wanted to unbind the first GPU (0000:01:00.0) since my monitors are hooked up to that GPU, everything blacked out immediately. I tried rebooting the pc blind. After 5 minutes i did a hard-reset and tried it again with the second GPU (0000:02:00.0). Then I noticed, that the echo command doesn’t finish. Even if I kill the terminal, the command is still going and preventing the system from rebooting.
#!/bin/sh
for i in /sys/devices/pci*/*/boot_vga; do
if [ $(cat "$i") -eq 0 ]; then
GPU="${i%/boot_vga}"
AUDIO="$(echo "$GPU" | sed -e "s/0$/1/")"
echo "vfio-pci" > "$GPU/driver_override"
if [ -d "$AUDIO" ]; then
echo "vfio-pci" > "$AUDIO/driver_override"
fi
fi
done
modprobe -i vfio-pci
You can require this script in modprobe.d:
install vfio-pci /usr/bin/vfio-pci-override.sh
And it will run that script, to initialize your non-boot GPU to have the vfio-pci driver.
I don’t think, that the script is getting executed at bootup. If I add some debug messages, they don’t show up in boot log. And both GPUs are still claimed by nouveau.