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.
Other useful references for this topic:
- https://forum.proxmox.com/threads/pve7-vfio-pci-xxxx-xx-xx-x-no-more-image-in-the-pci-rom.108189/
- https://github.com/cosminmocan/vfio-single-amdgpu-passthrough
- https://github.com/gnif/vendor-reset
- https://passthroughpo.st/simple-per-vm-libvirt-hooks-with-the-vfio-tools-hook-helper/
- https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF
- https://github.com/ilayna/Single-GPU-passthrough-amd-nvidia/tree/3d8666e66d009493a3f5b574bdba15954ed86af5
- https://gitlab.com/YuriAlek/vfio/-/wikis/Use
- https://github.com/joeknock90/Single-GPU-Passthrough
- https://docs.google.com/document/d/17Wh9_5HPqAx8HHk-p2bGlR0E-65TplkG18jvM98I7V8/edit
- https://github.com/QaidVoid/Complete-Single-GPU-Passthrough