0

I am trying to setup GPU passthrough on Arch. I followed the PCI passthrough via OVMF wiki along with some other resources online. I substituted a few steps as needed, for example I am using systemd-boot instead of GRUB.

Everything seems correct and working except when I start the qemu script there is no output on the screen. The VM starts using the set amount of memory as expected but no video output.

lspci -vnn
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798] (prog-if 00 [VGA controller])
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:254d]
    Flags: fast devsel, IRQ 16
    Memory at e0000000 (64-bit, prefetchable) [size=256M]
    Memory at f7b00000 (64-bit, non-prefetchable) [size=256K]
    I/O ports at e000 [size=256]
    Expansion ROM at f7b40000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: vfio-pci
    Kernel modules: radeon

01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:aaa0]
    Flags: fast devsel, IRQ 17
    Memory at f7b60000 (64-bit, non-prefetchable) [disabled] [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: vfio-pci
    Kernel modules: snd_hda_intel

00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0151] (rev 09) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 26
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    I/O behind bridge: 0000e000-0000efff
    Memory behind bridge: f7b00000-f7bfffff
    Prefetchable memory behind bridge: 00000000e0000000-00000000efffffff
    Capabilities: <access denied>
    Kernel driver in use: pcieport
    Kernel modules: shpchp

Both VGA and HDMI Audio devices are claimed by vfio-pci.

lspci -nnk

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:254d]
    Kernel driver in use: vfio-pci
    Kernel modules: radeon
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
    Subsystem: Gigabyte Technology Co., Ltd Device [1458:aaa0]
    Kernel driver in use: vfio-pci
    Kernel modules: snd_hda_intel

Qemu start script:

#!/bin/bash

cp /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd /tmp/my_vars.fd
qemu-system-x86_64 \
-enable-kvm \
-m 2048 \
-cpu host,kvm=off \
-vga none \
-device vfio-pci,host=01:00.0,multifunction=on \
-device vfio-pci,host=01:00.1 \
-drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd \
-drive if=pflash,format=raw,file=/tmp/my_vars.fd

All files in the script exist. When executed the qemu console opens on the host but no output on monitor. GPU seems to be available to the vm as I can see the vga and audio ID's when I run "info pci" command in qemu console. Libvirtd is running if it matters. VT-d and IOMMU are enabled.

I have also installed linux-vfio-lts and updated the GPU firmware to latest (UEFI is supported on either firmware) with no change. There are reports of people getting this to work with 7970 so it should work but I am completely stuck on what to try next. Any ideas?

0

In the end it seems to have been a software configuration issue though I was unable to pinpoint the exact cause.

Both Radeon HD7970 and RX 480 works almost flawlessly with my setup now.

I also ended up writing a guide if anyone has similar issues: GPU Passthrough with QEMU on Arch Linux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.