3

I am trying to set up my dual GPU system for VFIO Passthrough (so my 2nd GPU can be used fully by a virtual machine). In order to do this I need to make sure that the 2nd GPU is not grabbed by the amdgpu driver, and is instead grabbed by either pci-stub or xen-pciback.

Unfortunately, my system with 4.13.4 kernel (from Ukuu) is causing the amdgpu module to be loaded too early, grabbing both GPUs. I have tried blacklisting the amdgpu module and that works but it requires me to manually modprobe amdgpu after login to load the amdgpu driver so I can use my first GPU.

The only way I could find to automate loading the amdgpu is by adding the modprobe command to /etc/rc.local but that generally doesn't get executed until 10-20 seconds after I am presented with an X login prompt (causing me to have to login twice if I forget to wait till the modprobe finishes).

Is there any way to reliably make the amdgpu driver load after other modules?

Edit: It appears I can do this if I blacklist the amdgpu module, rebuild initramfs, then remove the amdgpu blacklist without updating initramfs. This causes the modules to load in the order specified and everything work. Unfortunately, this is only a temporary fix :-/.

4
  • Did you delete your previous question and post this instead? Oct 1, 2017 at 19:37
  • Yes, as this is more direct to what I've learned the true issue is. The other question (about the splash screen display) is actually tangental to my true issue.
    – KallDrexx
    Oct 1, 2017 at 19:38
  • 1
    Yeah, looking around it seems the only solution people have found is to blacklist and manually modprobe... maybe someone will put a bounty on this question though, because there has to be a better way. There are plenty of people with the same issue Oct 1, 2017 at 19:45
  • The workaround in the edit worked for me too. Much appreciate this being up here as I'd experimented a bit with other methods fruitlessly :(
    – radman
    Feb 19, 2018 at 16:00

1 Answer 1

0

You can use a softdep command for modprobe to make sure vfio-pci loads before amdgpu. See example below:

# /etc/modprobe.d/vfio-pci.conf
options vfio-pci ids=1002:xxxx
softdep amdgpu pre: vfio-pci

With this it should be necessary either to have eg a pci-stub.ids on the grub cmdline in /etc/default/grub

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .