[vfio-users] Loading vfio before radeon module in Ubuntu 15.10
Eric Hattemer
hattenator at gmail.com
Tue Oct 27 23:43:29 UTC 2015
On 10/27/2015 04:23 PM, Eric Hattemer wrote:
> On 10/27/2015 03:53 PM, Alex Williamson wrote:
>> 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
>
> ---
I re-thought this after looking into it a bit. Make your
/etc/modprobe.d/radeon.conf just blacklist the radeon and fglrx modules
and not do softdep. But you can keep the 'install' line in there. You
might want to re-think the pci-override-vga.sh script I put in there to
just use the new_id feature, though. Then you can put 'vfio-pci' in
/etc/modules as Alex Williamson said, and it will load automatically at
bootup, and should read the 'install' line and register the card (all
vga cards, though; edit the script if you want different behavior).
Then you have to run 'sudo update-initramfs -u', which is the Ubuntu
equivalent of 'dracut --force' that I mentioned in the last email.
radeon.conf:
install vfio-pci /usr/local/sbin/pci-override-vga.sh
blacklist fglrx
blacklist radeon
-Eric Hattemer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20151027/ebcfae35/attachment.htm>
More information about the vfio-users
mailing list