<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 10/27/2015 03:53 PM, Alex Williamson
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAEMbtcLMQo6Yv34JeR7gUms3BLsEdZzZPVp+JDLU4AzaXLxCwg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Tue, Oct 27, 2015 at 1:50 PM,
            Manvir Singh <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:webmaster@programming4life.com"
                target="_blank">webmaster@programming4life.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote">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?<br>
            </blockquote>
            <div><br>
            </div>
            <div>I thought there was a "modules" file somewhere in /etc
              on Ubuntu systems, but I don't have any to check. <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    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:<br>
    <br>
    install vfio-pci /usr/local/sbin/pci-override-vga.sh<br>
    softdep fglrx pre: vfio-pci<br>
    softdep radeon pre: vfio-pci<br>
    <br>
    ---<br>
    <br>
    /usr/local/sbin/pci-override-vga.sh:<br>
    #!/bin/sh<br>
    <br>
    for i in $(find /sys/devices/pci* -name boot_vga); do<br>
            if [ $(cat $i) -eq 0 ]; then<br>
                    GPU=$(dirname $i)<br>
                    AUDIO=$(echo $GPU | sed -e "s/0$/1/")<br>
                    echo "vfio-pci" > $GPU/driver_override<br>
                    if [ -d $AUDIO ]; then<br>
                            echo "vfio-pci" > $AUDIO/driver_override<br>
                    fi<br>
            fi<br>
    done<br>
    modprobe -i vfio-pci<br>
    <br>
    ---<br>
    <br>
    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.<br>
    <br>
    -Eric Hattemer<br>
    <br>
    <br>
  </body>
</html>