Skip to content

Instantly share code, notes, and snippets.

@Swyter
Last active November 22, 2022 05:42
Show Gist options
  • Save Swyter/d6f96d171649865d0d1a1107ee61b19c to your computer and use it in GitHub Desktop.
Save Swyter/d6f96d171649865d0d1a1107ee61b19c to your computer and use it in GitHub Desktop.
Linux VFIO KVM Passthrough with AMD Radeon card -- Solution for dmesg error «No more image in the PCI ROM» -- VFIO single graphics card bootup

If you have a black screen when trying to boot your guest OS via qemu/kvm with passthrough for your AMD Radeon card (in my case RX 480/590 or POLARIS10) and nothing is working, and you are able to ssh into the host while the virtualization is running or afterwards and get something like this via dmesg:

...
vfio_ecap_init: hiding ecap 0x19@0x270
...
vfio-pci 0000:03:00.0: No more image in the PCI ROM
...

Then the solution is to boot Linux through pure EFI; the problem is enabling CSM and then either booting the host system through a legacy BIOS bootloader or EFI. TL;DR: Disable CSM, ensure you've a proper EFI boot chain first. Then it will work straight away.


Some other useful commands are virsh start win10 and especially virsh destroy win10 to kill it, where win10 is the name of your VM in virt-manager, and remotely recover when you are stuck with the powered off display via phone or a different computer in the same network. Enable sshd to run virsh destroy win10 and recover, avoiding having to force a hard reboot each time.

In many cases virsh shutdown win10 won't work because it uses ACPI shutdown; the equivalent of pressing the physical power button in your case and asking the guest nicely.

References

Other useful references for this topic:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment