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 :-/.
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