[vfio-users] Loading vfio before radeon module in Ubuntu 15.10

Eric Hattemer hattenator at gmail.com
Tue Oct 27 23:23:18 UTC 2015


On 10/27/2015 03:53 PM, Alex Williamson wrote:
> On Tue, Oct 27, 2015 at 1:50 PM, Manvir Singh 
> <webmaster at programming4life.com 
> <mailto:webmaster at programming4life.com>> wrote:
>
>     In Ubuntu 15.10 the radeon module loads before the vfio module
>     loads, not allowing me to assign a card to vfio. In fedora I can
>     use "rd.driver.pre=vfio-pci" to load the vfio module before other
>     modules, but how do I do this in Ubuntu 15.10?
>
>
> I thought there was a "modules" file somewhere in /etc on Ubuntu 
> systems, but I don't have any to check.

It's not the cleanest way, but I'd do it via modprobe.d.  You make a 
file called like radeon.conf (it has to end in .conf), and you use an 
"install" line that runs a script to force all calls to the 'radeon' 
module to not actually load the 'radeon' module:

install vfio-pci /usr/local/sbin/pci-override-vga.sh
softdep fglrx pre: vfio-pci
softdep radeon pre: vfio-pci

---

/usr/local/sbin/pci-override-vga.sh:
#!/bin/sh

for i in $(find /sys/devices/pci* -name boot_vga); do
         if [ $(cat $i) -eq 0 ]; then
                 GPU=$(dirname $i)
                 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

---

driver_override is a more extreme method than 
/sys/bus/pci/drivers/vfio-pci/new_id, so you might want to try 
/sys/bus/pci/drivers/vfio-pci/new_id first.  But the softdep stuff in 
modprobe.d should get you around the issue with the radeon driver 
loading.  You do have to worry about the initrd loading it, though. That 
might be tricky.  On Fedora, you add 'blacklist radeon' and 'blacklist 
fglrx' to modprobe.d/something.conf and run `dracut --force` and it will 
rebuild the initrd without a call to load the radeon driver for the 
enhanced getty.  On Ubuntu I'm not sure how that works.  I'm also not 
sure how softdep and blacklist interact with each other if you put both in.

-Eric Hattemer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20151027/eb76312d/attachment.htm>


More information about the vfio-users mailing list