<div dir="ltr">Thanks Alex,<br><br>I consider myself an intermediate power user. I know enough to understand what the line that you provided does, but not enough to write a solution of my own. I inserted the line that you provided above in /modprobe.d/vfio.conf and it caused X to fail. I had to alt+f2 to comment it out, rebuilt initramfs and then reboot.<br><br>It was suggested that I could do this through a systemd service in the arch irc channel but nobody was able to provide details other than "man systemd.service".  Any further pointers is greatly appreciated.<br><br>Best,<br>Garland</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 19, 2016 at 6:06 PM Alex Williamson <<a href="mailto:alex.williamson@redhat.com">alex.williamson@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 19 Feb 2016 16:43:47 -0500<br>
Ben J <<a href="mailto:btpprograms@gmail.com" target="_blank">btpprograms@gmail.com</a>> wrote:<br>
<br>
> For your latter question, it doesn't seem like you should need to modify it<br>
> as his original script already generically finds all GPUs. Did it not work<br>
> when you tried it? Also, what type of cards are you using? If they're<br>
> NVIDIA with nvidia drivers then I doubt that script will work for you.<br>
> I'm using the following guide:<br>
> <a href="https://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-3-host.html" rel="noreferrer" target="_blank">https://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-3-host.html</a>.<br>
> I'm having trouble adapting some of the Fedora focused instructions for use<br>
> in Arch.<br>
><br>
> *1. Dracut*<br>
> Dracut isn't used in Arch but the mkinitcpio is. You're asked to<br>
> insert *add_drivers+="vfio<br>
> vfio_iommu_type1 vfio_pci vfio_virqfd" *in: */etc/dracut.conf.d/local.conf*.<br>
> Farther down, I'm supposed to insert<br>
> *install_items+="/sbin/vfio-pci-override-vga.sh<br>
> /usr/bin/find /usr/bin/dirname" *in: */etc/dracut.conf.d/local.conf*.<br>
><br>
> Should I instead add these lines to a modprobe.d conf file or should I add<br>
> it to the modules line in */etc/mkinitcpio.conf*?<br>
><br>
> *2. driver_override*<br>
> My bash-foo isn't very good and I need to adapt the following script (see<br>
> below) so that it points to the correct directories. In Arch, the directory<br>
> for the GPU (02:00.0) and GPU audio (02:00.1) are here:<br>
> */sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0/* &<br>
> */sys/devices/pci0000:00/0000:00:02.0/0000:02:00.1/*<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> *    #!/bin/sh    DEVS="0000:02:00.0 0000:02:00.1"    for DEV in $DEVS;<br>
> do echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override    done<br>
> modprobe -i vfio-pci*<br>
<br>
There are really just so many ways to solve this problem, don't feel<br>
like you need to stick with the approaches I've given.  If you want<br>
something that only depends on modprobe.d, then the "install" directive<br>
is really powerful.  For instance, let's say I have a pair of identical<br>
nvidia cards, one at 01:00.0 and the other at 02:00.0 and I want to use<br>
02: for my guest.  I could do something like:<br>
<br>
install nvidia "echo vfio-pci > /sys/bus/pci/devices/0000:02:00.0/driver_override; modprobe --ignore-install nvidia"<br>
<br>
This tells modprobe that before loading the nvidia driver, set the<br>
driver override so that only vfio-pci can claim 02:00.0, then load the<br>
nvidia driver.  You can do the same with the audio function and<br>
snd_hda_intel driver.  You can wait til later to actually load the<br>
vfio-pci module, it's not really necessary to include them in your<br>
initramfs.<br>
<br>
As for sysfs paths, the actual devices do live in /sys/devices/, but<br>
there are links to them in /sys/bus/pci/devices/, this is a kernel<br>
property, your choice of distribution isn't going to change that.<br>
Thanks,<br>
<br>
Alex<br>
</blockquote></div>