Opennebula 6.4 CE and GPU Passthrough

I recently updated our OpenNebula stack to 6.4 CE from 6.2 CE and all was well until i tried to add a new GPU server to OpenNebula and do GPU passthrough to a VM. The Ubuntu 20.04 host was setup for GPU passthrough just like I’d done in the past but when added to OpenNebula the GPU was not show in the list of PCI devices. I tried adjusting filters, double checking the GPU passthrough setup on the host, all to no avail. After some searching I found the following issue in GitHub which is exactly the issue I was facing. Since we run the CE version no updates are available and the patch has to be applied by hand. To resolve the issue with GPU passthrough follow the instructions below:

  • mv the file here: /var/lib/one/remotes/im/kvm-probes.d/host/system/pci.rb somewhere safe just in case
  • Run the following to grab the patched pci.rb file from github: wget -P /var/lib/one/remotes/im/kvm-probes.d/host/system/pci.rb https://raw.githubusercontent.com/OpenNebula/one/3f300f3bf9ccd90fd082cb8b1ad85c0037911304/src/im_mad/remotes/node-probes.d/pci.rb
  • after downloading the patched file make it executable: chmod +x /var/lib/one/remotes/im/kvm-probes.d/host/system/pci.rb
  • restart the opennebula services
    • If you’ve already added a host and run into this issue you’ll need to remove the host
    • modify /var/lib/one/remotes/etc/im/kvm-probes.d/pci.conf and change the filter to '0:0' to filter all PCI devices.
    • Once that change has been made re-add the host and remove it again (this is required to clear the PCI data already associated with the host in ONE). Last step is remove the ‘0:0’ filter with your previous filters, restart your OpenNebula services and re-add your host and you should now see your PCI devices.