You are not logged in.
I'm trying to set up a OVMF VM so I can also use the Intel iGPU for a Linux workstation, but I seem to get no video output at all. I know it's booting from my test Linux ISO (the serial output shows something).
qemu-system-x86_64 -enable-kvm -m 1024 -cpu host -smp 4,sockets=1,cores=4,threads=1 -drive if=pflash,format=raw,readonly,file=/usr/share/qemu/OVMF-pure-efi.fd -vga none -device vfio-pci,host=08:00.0 -device vfio-pci,host=08:00.1 -drive file=CentOS-7.0-1406-x86_64-DVD.iso,id=virtiocd
No video, zilch. Am I missing something obvious?
In dmesg, I see:
[ 1755.997185] vfio-pci 0000:08:00.0: enabling device (0400 -> 0403)
[ 1756.019017] vfio_ecap_init: 0000:08:00.0 hiding ecap 0x19@0x270
[ 1756.021067] vfio-pci 0000:08:00.1: enabling device (0400 -> 0402)
[ 1757.395393] kvm: zapping shadow pages for mmio generation wraparound
Which I assume is good?
EDIT: And of course, tell me what I can do to debug/what more information if any is needed.
Last edited by MacCoaster (2015-01-09 11:01:10)
Offline
I'm trying to set up a OVMF VM so I can also use the Intel iGPU for a Linux workstation, but I seem to get no video output at all. I know it's booting from my test Linux ISO (the serial output shows something).
qemu-system-x86_64 -enable-kvm -m 1024 -cpu host -smp 4,sockets=1,cores=4,threads=1 -drive if=pflash,format=raw,readonly,file=/usr/share/qemu/OVMF-pure-efi.fd -vga none -device vfio-pci,host=08:00.0 -device vfio-pci,host=08:00.1 -drive file=CentOS-7.0-1406-x86_64-DVD.iso,id=virtiocd
No video, zilch. Am I missing something obvious?
In dmesg, I see:
[ 1755.997185] vfio-pci 0000:08:00.0: enabling device (0400 -> 0403) [ 1756.019017] vfio_ecap_init: 0000:08:00.0 hiding ecap 0x19@0x270 [ 1756.021067] vfio-pci 0000:08:00.1: enabling device (0400 -> 0402) [ 1757.395393] kvm: zapping shadow pages for mmio generation wraparound
Which I assume is good?
EDIT: And of course, tell me what I can do to debug/what more information if any is needed.
The graphics card needs to support UEFI. Does it?
http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses? Try https://www.redhat.com/mailman/listinfo/vfio-users
Offline
I'm trying to set up a OVMF VM so I can also use the Intel iGPU for a Linux workstation, but I seem to get no video output at all. I know it's booting from my test Linux ISO (the serial output shows something).
qemu-system-x86_64 -enable-kvm -m 1024 -cpu host -smp 4,sockets=1,cores=4,threads=1 -drive if=pflash,format=raw,readonly,file=/usr/share/qemu/OVMF-pure-efi.fd -vga none -device vfio-pci,host=08:00.0 -device vfio-pci,host=08:00.1 -drive file=CentOS-7.0-1406-x86_64-DVD.iso,id=virtiocd
No video, zilch. Am I missing something obvious?
In dmesg, I see:
[ 1755.997185] vfio-pci 0000:08:00.0: enabling device (0400 -> 0403) [ 1756.019017] vfio_ecap_init: 0000:08:00.0 hiding ecap 0x19@0x270 [ 1756.021067] vfio-pci 0000:08:00.1: enabling device (0400 -> 0402) [ 1757.395393] kvm: zapping shadow pages for mmio generation wraparound
Which I assume is good?
EDIT: And of course, tell me what I can do to debug/what more information if any is needed.
1. Tell us about your hardware - what GPU are you trying to passthrough.
2. Are you sure that the guest OS(CentOS) does support pure EFI and works with GOP and stuff? I'm sorry, i'm a bit unfamiliar with CentOS(while using fedora, heh) on UEFI.
3. Try booting with CSM on - maybe it'll get you video output, but there will be no gains - it will use VGA.
The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.
Offline
Hi,
I need some assistance, please. My rig has an Asus P9X79E-WS with Xeon E5-2670, 32gb of ram and 4x AMD R9 280x. What I want to do is to passthrough 2 GPU to the guest OS, but I don't know how to blacklist only 2 of them without blacklisting all 4 GPUs. I want to leave 2 GPUs for the Host OS with its own HDMI Audio Device, and the other pair for the Guest OS with its HDMI Audio Device.
I don't want to go the ESXi way because I want to have direct access by Linux without any virtualization layer to a pool of 28 hdds that I have attached to an HP SAS Expander Card
04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
04:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
06:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
0b:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] [1002:6798]
0b:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] [1002:aaa0]
Offline
Hi,
I need some assistance, please. My rig has an Asus P9X79E-WS with Xeon E5-2670, 32gb of ram and 4x AMD R9 280x. What I want to do is to passthrough 2 GPU to the guest OS, but I don't know how to blacklist only 2 of them without blacklisting all 4 GPUs. I want to leave 2 GPUs for the Host OS with its own HDMI Audio Device, and the other pair for the Guest OS with its HDMI Audio Device.
Somewhere in this thread, within the last couple weeks, is an example of someone using Xen's pci-back driver (not Xen itself) in place of pci-stub because it has the ability to claim based on bus address.
http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses? Try https://www.redhat.com/mailman/listinfo/vfio-users
Offline
The graphics card needs to support UEFI. Does it?
Hi aw, thanks for the quick response.
[root@localhost 0000:08:00.0]# cat rom > /tmp/image.rom
cat: rom: Input/output error
[root@localhost 0000:08:00.0]#
(snip)
[root@localhost 0000:08:00.0]# dmesg
(snip)
[ 117.891895] pci-stub 0000:08:00.0: Invalid ROM contents
[root@localhost 0000:08:00.0]#
Can't seem to extract the ROM. Any other way? Maybe I have to do GPU-Z?
1. Tell us about your hardware - what GPU are you trying to passthrough.
ASUS PD9-WS, with Radeon R7 240 in the last PCI-E port (PCH).
08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Oland PRO [Radeon R7 240] (prog-if 00 [VGA controller])
Subsystem: PC Partner Limited / Sapphire Technology Device e263
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 11
Region 0: Memory at e0000000 (64-bit, prefetchable) [disabled] [size=256M]
Region 2: Memory at f0000000 (64-bit, non-prefetchable) [disabled] [size=256K]
Region 4: I/O ports at a000 [disabled] [size=256]
Expansion ROM at f0040000 [disabled by cmd] [size=128K]
Capabilities: [48] Vendor Specific Information: Len=08 <?>
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1+,D2+,D3hot+,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [58] Express (v2) Legacy Endpoint, MSI 00
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr- TransPend-
LnkCap: Port #0, Speed 8GT/s, Width x8, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x4, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis-, LTR-, OBFF Not Supported
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
Address: 0000000000000000 Data: 0000
Capabilities: [100 v1] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
Capabilities: [150 v2] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [270 v1] #19
Kernel driver in use: pci-stub
Kernel modules: radeon
2. Are you sure that the guest OS(CentOS) does support pure EFI and works with GOP and stuff? I'm sorry, i'm a bit unfamiliar with CentOS(while using fedora, heh) on UEFI.
Fair question -- but wouldn't I also get EFI BIOS output on the GPU too? I tried to use the Windows 8.1 ISO but it says boot failed (in the serial console) from a CD/DVD. :\
3. Try booting with CSM on - maybe it'll get you video output, but there will be no gains - it will use VGA.
I see several options for that in the BIOS. Right now it's set to [Enabled].
Offline
Hello, I got new hardware in hands, a 5820k with a Asrock X99 Extreme 6, I can confirm that GT430 in second slot works but when I try to pass the GTX970 at first slot I get
vfio-pci 0000:02:00.0: BAR 3: can't reserve [mem 0xe0000000-0xe1ffffff 64bit pref]
in dmesg and similar warning in QEMU console warning about performance, the gpu resets but then stays black, any suggestion?
Offline
Hello, I got new hardware in hands, a 5820k with a Asrock X99 Extreme 6, I can confirm that GT430 in second slot works but when I try to pass the GTX970 at first slot I get
vfio-pci 0000:02:00.0: BAR 3: can't reserve [mem 0xe0000000-0xe1ffffff 64bit pref]
in dmesg and similar warning in QEMU console warning about performance, the gpu resets but then stays black, any suggestion?
Check if the GPU is used by some splash-screens. Do cat /proc/iomem and search the given memory range. I bet there is something like vesafb.
The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.
Offline
Duelist wrote:3. Try booting with CSM on - maybe it'll get you video output, but there will be no gains - it will use VGA.
I see several options for that in the BIOS. Right now it's set to [Enabled].
By saying "booting with CSM on" i've meant booting the VM with OVMF-with-csm image. My OVMF would always output on the serial instead of any graphics given, QXL, STD or passed through GPU.
About the rom... My suggestion would be placing the GPU in the first pci-e slot, booting with it and extracting the ROM. I can't extract ROM from my second card resting in pci-e x8(02:00.0) slot.
Last edited by Duelist (2015-01-09 20:51:11)
The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.
Offline
longyny wrote:Hi,
I need some assistance, please. My rig has an Asus P9X79E-WS with Xeon E5-2670, 32gb of ram and 4x AMD R9 280x. What I want to do is to passthrough 2 GPU to the guest OS, but I don't know how to blacklist only 2 of them without blacklisting all 4 GPUs. I want to leave 2 GPUs for the Host OS with its own HDMI Audio Device, and the other pair for the Guest OS with its HDMI Audio Device.
Somewhere in this thread, within the last couple weeks, is an example of someone using Xen's pci-back driver (not Xen itself) in place of pci-stub because it has the ability to claim based on bus address.
https://bbs.archlinux.org/viewtopic.php … 9#p1486869
BOOT_IMAGE=/boot/vmlinuz-3.18.1-custom root=UUID=7ca2c85e-f29e-404d-91c7-92ad1e087465 ro splash ivrs_ioapic[9]=00:14.0 ivrs_ioapic[10]=00:00.1 iommu=pt iommu=1 xen-pciback.hide=(06:00.0)(06:00.1) default_hugepagesz=1G hugepagesz=1G panic=10 hugepages=6 isolcpus=2-7 vt.handoff=7
xen-pciback.hide=(06:00.0)(06:00.1)
The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.
Offline
Check if the GPU is used by some splash-screens. Do cat /proc/iomem and search the given memory range. I bet there is something like vesafb.
Wow thanks, really, I was quite lost and comtemplating posiblity of changing the pc case because the 970 doesn't fit in the second slot
The culprit was "efifb" even it was not showing in lsmod, just recompiling the kernel without vesafb,efifb... did the trick
EDIT:
Seems that trying to boot host with CSM/legacy vbios causes Invalid ROM error, but booting host without CSM/Using UEFI vbios just works fine, interesting... (guest booting in legacy/uefi mode has the same outcome, seems that host booting mode matters)
Last edited by Cubex (2015-01-10 03:28:19)
Offline
Seems that trying to boot host with CSM/legacy vbios causes Invalid ROM error, but booting host without CSM/Using UEFI vbios just works fine, interesting... (guest booting in legacy/uefi mode has the same outcome, seems that host booting mode matters)
Turn on CSM on host, try booting VM without CSM(pure-efi). What happens? It is obvious that if you turn off CSM on host, it won't work in VM while not using emulated graphics that have VGA(qxl-vga for example).
Turn on CSM on host, try booting VM with csm(with-csm). What happens? Invalid ROM contents error? Try passing the ROM via romfile= option to the vfio-pci device. You can get the ROM file on techpowerup vbios database(i personally don't like that approach, since my asus cards had serial number inside that can be omitted harmlessly, but you can't know for sure if it's all the same) or plugging the card into the first PCI-E slot(making it your ONLY host GPU) and dumping the ROM via sysfs as told in aw's blog post. The NASTY way of getting ROM out of the card is using GPU-Z or ATIWinFlash(or just ATIFlash) on windows, but it works with cards not-in-the-first-slot.
Also, it may turn out that your GPU(R7 240, yes?my HD7750 didn't originally, and they are rebadged R7 250E) doesn't support UEFI at all. In that case you can check your vendor's site(like asus.com) for bios updates - i did so and updated my cards' VBIOS to make them support UEFI and GOP. Though there may be problems with some vendors(again, like asus) having a broken update tool.
Last edited by Duelist (2015-01-10 11:11:28)
The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.
Offline
Booting host with UEFI vbios or disabling CSM its the only way it works, the guest can be run using bios or ovmf
If I boot host with legacy vbios there is no way running the guest, yesterday tried with romfile too but nothing happens, anyways csm on host is not very relevant to me
Offline
Booting host with UEFI vbios or disabling CSM its the only way it works, the guest can be run using bios or ovmf
If I boot host with legacy vbios there is no way running the guest, yesterday tried with romfile too but nothing happens, anyways csm on host is not very relevant to me
Oh my! I think i've mistaken you with the other guy.
Forget all that i've said there
https://bbs.archlinux.org/viewtopic.php … 9#p1491799
Sorry.
The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.
Offline
Duelist wrote:Check if the GPU is used by some splash-screens. Do cat /proc/iomem and search the given memory range. I bet there is something like vesafb.
Wow thanks, really, I was quite lost and comtemplating posiblity of changing the pc case because the 970 doesn't fit in the second slot
The culprit was "efifb" even it was not showing in lsmod, just recompiling the kernel without vesafb,efifb... did the trickEDIT:
Seems that trying to boot host with CSM/legacy vbios causes Invalid ROM error, but booting host without CSM/Using UEFI vbios just works fine, interesting... (guest booting in legacy/uefi mode has the same outcome, seems that host booting mode matters)
That sounds a lot like the issue I had on my SuperMicro board (X10SAT).
My board has BIOS options for choosing primary dispaly device, and for what mode to use when loading the ROM from a given PCIe slot.
If I have the Intel card set as always-enabled and primary, I must also make sure the PCIe slot is set to "legacy" or "disabled" ROM loading.
Otherwise, even though it's not the primary device, the Radeon card will hijack the boot display. If I remember correctly, the Radeon became fb0 and the Intel became fb1.
Worse than that, though, is the fact that the device's framebuffer base address gets screwed up. This breaks everything, including the native-boot Windows Catalyst driver!
You may still be able to EFI boot the host with framebuffer if your BIOS lets you disable loading the discrete card's ROM.
Last edited by DanaGoyette (2015-01-10 22:37:20)
Offline
The problem is that my CPU doesn't have any IGPU so using a secondary 430 for host does solve, the good part about this new system is that I don't need to apply the override ACS patch, iommu grouping works fine out of box.
Seems that booting guest with seabios causes a host crash after ~8-10 secs, but using OVMF seems to work fine.
Offline
...long story short...
I've finally flashed my cards with UEFI-compatible "secret"(i can't get it anywhere anymore) firmware, but appears like windows7 doesn't really works right with it. I turn off CSM, boot up the windows, it shows the splash logo and then image freezes. Yay for windows7. So, OVMF/UEFI and windows 7 is possible but troublesome, so most folks shouldn't bother about it.
Have you had any further success with UEFI Windows 7? I'm stuck at this flash screen as well, unfortunately.
No errors or messages, just a pulsing "Starting Windows" logo indefinitely on both the installation disk and a boot disk.
Offline
need a little help here:
PC:
Processor: Amd FX-8320
Motherboard: M597 Pro
8 GB ram
Video1: Asus Radeon R9 270
Video2: Sapphire Radeon HD 6850
System:
arch linux, linux-uksm-ck 3.18.2
For example, I want to passthrough video2
i have in my grub:
GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/lvmVolume-lvmRoot discard rw iommu=pt iommu=1 ivrs_ioapic[9]=00:14.0 ivrs_ioapic[10]=00:00.1 amd_iommu_dump=1 pci-stub.ids=1002:6739,1002:aa88,1002:43a0"
because:
lspci
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Barts PRO [Radeon HD 6850] [1002:6739]
03:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Barts HDMI Audio [Radeon HD 6800 Series] [1002:aa88]
and
walkindude@Desktop> ls /sys/bus/pci/devices/0000:03:00.0/iommu_group/devices/ ~
0000:00:15.0 0000:03:00.0 0000:03:00.1
walkindude@Desktop>
so we need also
00:15.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0) [1002:43a0]
on start pci-stub gives me:
[ 2.983932] pci-stub: add 1002:6739 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[ 2.983954] pci-stub 0000:03:00.0: claimed by stub
[ 2.983960] pci-stub: add 1002:AA88 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[ 2.983969] pci-stub 0000:03:00.1: claimed by stub
[ 2.983973] pci-stub: add 1002:43A0 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
my windows.xml (windows 10 9888):
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>windows</name>
<uuid>c8bc2373-6271-4810-991e-8618a0ee01d2</uuid>
<memory unit='KiB'>3145728</memory>
<currentMemory unit='KiB'>3145728</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-2.2'>hvm</type>
<loader type='pflash'>/usr/share/ovmf/ovmf_x64.bin</loader>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/sbin/qemu-system-x86_64</emulator>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/walkindude/Downloads/JM1_CCSA_X64FRE_EN-US_DV5.iso'/>
<target dev='hdb' bus='ide'/>
<readonly/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/walkindude/virtio-win-0.1-94.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/walkindude/brasero.iso'/>
<target dev='hdd' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='1'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/vm1.qcow2'/>
<target dev='vda' bus='virtio'/>
<boot order='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</disk>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci1'>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
<master startport='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='ide' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</controller>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
<controller type='scsi' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</controller>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x0cf3'/>
<product id='0x9271'/>
</source>
</hostdev>
<redirdev bus='usb' type='spicevmc'>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
</redirdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>
</devices>
<seclabel type='none' model='none'/>
<qemu:commandline>
<qemu:arg value='-vga'/>
<qemu:arg value='none'/>
<qemu:arg value='-device'/>
<qemu:arg value='vfio-pci,host=03:00.0,x-vga=on'/>
<qemu:arg value='-runas'/>
<qemu:arg value='root'/>
</qemu:commandline>
</domain>
after
sudo vfio-bind 0000:03:00.0 0000:03:00.1 0000:00:15.0
and
sudo virsh start windows
i get this:
error: Failed to start domain windows
error: internal error: process exited while connecting to monitor: 2015-01-11T13:57:15.773249Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -122015-01-11T13:57:15.773322Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: vfio_dma_map(0x7f4e40656020, 0x0, 0xa0000, 0x7f4d58000000) = -12 (Cannot allocate memory)
2015-01-11T13:57:15.773402Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -122015-01-11T13:57:15.773429Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: vfio_dma_map(0x7f4e40656020, 0xc0000, 0x20000, 0x7f4e23400000) = -12 (Cannot allocate memory)
2015-01-11T13:57:15.773481Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -122015-01-11T13:57:15.773505Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: vfio_dma_map(0x7f4e40656020, 0xe0000, 0x20000, 0x7f4e23600000) = -12 (Cannot allocate memory)
2015-01-11T13:57:15.773541Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -12
and in dmesg:
walkindude@Desktop> sudo dmesg | tail ~
[ 2727.433870] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2727.433929] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2727.433932] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2733.570647] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2733.570655] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2733.570807] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2733.570810] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2733.570880] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2733.570945] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
[ 2733.570947] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded
walkindude@Desktop>
Last edited by walkindude (2015-01-11 14:25:41)
Offline
Maybe I sould have said this earlier, AFAIK Windows 7 boots in UEFI mode, however doesn't support UEFI vbios. I remenber getting a boot error on bare metal when disabling CSM even If i was booting using UEFI mode.
If you can't use seabios or ovmf with csm (like me), use Win8+
Offline
need a little help here:
PC:
Processor: Amd FX-8320 Motherboard: M597 Pro 8 GB ram Video1: Asus Radeon R9 270 Video2: Sapphire Radeon HD 6850
System:
arch linux, linux-uksm-ck 3.18.2
For example, I want to passthrough video2
i have in my grub:
GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/lvmVolume-lvmRoot discard rw iommu=pt iommu=1 ivrs_ioapic[9]=00:14.0 ivrs_ioapic[10]=00:00.1 amd_iommu_dump=1 pci-stub.ids=1002:6739,1002:aa88,1002:43a0"
because:
lspci
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Barts PRO [Radeon HD 6850] [1002:6739] 03:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Barts HDMI Audio [Radeon HD 6800 Series] [1002:aa88]
and
walkindude@Desktop> ls /sys/bus/pci/devices/0000:03:00.0/iommu_group/devices/ ~ 0000:00:15.0 0000:03:00.0 0000:03:00.1 walkindude@Desktop>
so we need also
00:15.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0) [1002:43a0]
No, the root ports never get bound to vfio-pci, only endpoints. There's a patch that just went upstream, and tagged for stable, that will prevent binding root ports, bridges, and switches to vfio-pci.
on start pci-stub gives me:
[ 2.983932] pci-stub: add 1002:6739 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000 [ 2.983954] pci-stub 0000:03:00.0: claimed by stub [ 2.983960] pci-stub: add 1002:AA88 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000 [ 2.983969] pci-stub 0000:03:00.1: claimed by stub [ 2.983973] pci-stub: add 1002:43A0 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
my windows.xml (windows 10 9888):
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <name>windows</name> <uuid>c8bc2373-6271-4810-991e-8618a0ee01d2</uuid> <memory unit='KiB'>3145728</memory> <currentMemory unit='KiB'>3145728</currentMemory> <vcpu placement='static'>4</vcpu> <os> <type arch='x86_64' machine='pc-i440fx-2.2'>hvm</type> <loader type='pflash'>/usr/share/ovmf/ovmf_x64.bin</loader> <bootmenu enable='yes'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <pm> <suspend-to-mem enabled='no'/> <suspend-to-disk enabled='no'/> </pm> <devices> <emulator>/usr/sbin/qemu-system-x86_64</emulator> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/home/walkindude/Downloads/JM1_CCSA_X64FRE_EN-US_DV5.iso'/> <target dev='hdb' bus='ide'/> <readonly/> <boot order='1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/home/walkindude/virtio-win-0.1-94.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/home/walkindude/brasero.iso'/> <target dev='hdd' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='1'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/vm1.qcow2'/> <target dev='vda' bus='virtio'/> <boot order='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </disk> <controller type='usb' index='0' model='ich9-ehci1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/> </controller> <controller type='pci' index='0' model='pci-root'/> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='ide' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> <controller type='virtio-serial' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller> <controller type='scsi' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> </controller> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <sound model='ich6'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <hostdev mode='subsystem' type='usb' managed='yes'> <source> <vendor id='0x0cf3'/> <product id='0x9271'/> </source> </hostdev> <redirdev bus='usb' type='spicevmc'> </redirdev> <redirdev bus='usb' type='spicevmc'> </redirdev> <redirdev bus='usb' type='spicevmc'> </redirdev> <redirdev bus='usb' type='spicevmc'> </redirdev> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </memballoon> </devices> <seclabel type='none' model='none'/> <qemu:commandline> <qemu:arg value='-vga'/> <qemu:arg value='none'/> <qemu:arg value='-device'/> <qemu:arg value='vfio-pci,host=03:00.0,x-vga=on'/> <qemu:arg value='-runas'/> <qemu:arg value='root'/> </qemu:commandline> </domain>
Well, you got 440fx and ovmf right, but all of your <qemu:arg> stuff needs to go away. -vga none doesn't get specified here, you do that in xml by deleting the <video> and <graphics> entries. You don't need x-vga=on because you're using ovmf, and trying to specify the -runas option here is pointless and futile. Use a proper <hostdev> entry with managed="yes" to assign the GPU.
after
sudo vfio-bind 0000:03:00.0 0000:03:00.1 0000:00:15.0
This becomes unnecessary when you properly define the device in the XML.
and
sudo virsh start windows
i get this:
error: Failed to start domain windows error: internal error: process exited while connecting to monitor: 2015-01-11T13:57:15.773249Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -12 2015-01-11T13:57:15.773322Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: vfio_dma_map(0x7f4e40656020, 0x0, 0xa0000, 0x7f4d58000000) = -12 (Cannot allocate memory) 2015-01-11T13:57:15.773402Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -12 2015-01-11T13:57:15.773429Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: vfio_dma_map(0x7f4e40656020, 0xc0000, 0x20000, 0x7f4e23400000) = -12 (Cannot allocate memory) 2015-01-11T13:57:15.773481Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -12 2015-01-11T13:57:15.773505Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: vfio_dma_map(0x7f4e40656020, 0xe0000, 0x20000, 0x7f4e23600000) = -12 (Cannot allocate memory) 2015-01-11T13:57:15.773541Z qemu-system-x86_64: -device vfio-pci,host=03:00.0,x-vga=on: VFIO_MAP_DMA: -12
and in dmesg:
walkindude@Desktop> sudo dmesg | tail ~ [ 2727.433870] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2727.433929] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2727.433932] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2733.570647] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2733.570655] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2733.570807] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2733.570810] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2733.570880] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2733.570945] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded [ 2733.570947] vfio_pin_pages: RLIMIT_MEMLOCK (65536) exceeded walkindude@Desktop>
Both of these are because you're hiding the define from libvirt in <qemu:arg> options.
http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses? Try https://www.redhat.com/mailman/listinfo/vfio-users
Offline
@aw
ok, thanks
so, i deleted video and graphics tags, and add this:
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</hostdev>
for
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Barts PRO [Radeon HD 6850] [1002:6739]
Is it right?
Now vm boots, i see spikes in virt-manager. I've already installed windows, everything works in there, except catalyst always gives me VIDEO_TDR_FAILURE, that's why I tried to solve with qemu:args.
Stupid question: now, as I haven't any graphics in xml config, how do I see whats going on wm?
Tried to connect hdmi cable from gpu to my second monitor (it's a tv really, multiple hdmi outs) - nothing happens.
Previously I did it with the help of virt-manager, through VNC.
Last edited by walkindude (2015-01-11 15:37:27)
Offline
@aw
ok, thanksso, i deleted video and graphics tags, and add this:
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</hostdev>for
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Barts PRO [Radeon HD 6850] [1002:6739]
Is it right?
Now vm boots, i see spikes in virt-manager. I've already installed windows, everything works in there, except catalyst always gives me VIDEO_TDR_FAILURE, that's why I tried to solve with qemu:args.
Stupid question: now, as I haven't any graphics in xml config, how do I see whats going on wm?
Tried to connect hdmi cable from gpu to my second monitor (it's a tv really, multiple hdmi outs) - nothing happens.
Previously I did it with the help of virt-manager, through VNC.
<qemu:args> is almost never the right answer. Have you checked whether your HD 6850 actually supports UEFI in the ROM? You should be getting OVMF splash screen as well as the Windows loading animation on the connected screen.
http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses? Try https://www.redhat.com/mailman/listinfo/vfio-users
Offline
@aw
When I was using graphics VNC, I indeed see OVMF splash screen (TianoCore) and after it Windows logo, than system boots as expected.
You had said that I need to delete <graphics> from xml, which I did. So I plug hdmi cable from 6850 to hdmi-out of tv-screen. It's also connect by another hdmi to first card, R9 and I have properly configured dual screen.
When I start the VM I tried to switch to another out of my tv, but it says only connecting... and then logo of LG appears - means nothing here.
I've tried this videocard on the same hardware with the same windows UEFI - catalyst works. Also, before I bought this R9 I was running arch on UEFI with this HD 6850 - no problems.
Offline
@aw
When I was using graphics VNC, I indeed see OVMF splash screen (TianoCore) and after it Windows logo, than system boots as expected.
This means the emulated graphics support UEFI and proves nothing about your 6850.
You had said that I need to delete <graphics> from xml, which I did. So I plug hdmi cable from 6850 to hdmi-out of tv-screen. It's also connect by another hdmi to first card, R9 and I have properly configured dual screen.
When I start the VM I tried to switch to another out of my tv, but it says only connecting... and then logo of LG appears - means nothing here.
Not sounding good for UEFI support.
I've tried this videocard on the same hardware with the same windows UEFI - catalyst works. Also, before I bought this R9 I was running arch on UEFI with this HD 6850 - no problems.
Bare-meta UEFI systems almost always support the Compatibility Support Module (CSM), which allows support for legacy x86 option ROMs and VGA. So, this doesn't really prove anything either. To avoid VGA and all the issues that come with it, we explicitly do not want a CSM for our VM, which is why we use the pure-EFI OVMF image. There's a post on my blog (link below) to determine whether the card supports UEFI.
http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses? Try https://www.redhat.com/mailman/listinfo/vfio-users
Offline
@aw
Thanks again for explanations. Now it gives me, when the driver for this card is pci-stub (lspci -kn)
cat rom > /tmp/image.rom /sys/bus/pci/devices/0000:03:00.0
cat: rom: Input/output error
Maybe I just try with the latest bios on http://www.techpowerup.com/ ...
walkindude@Desktop> ./rom-parser ~/Sapphire.HD6850.1024.110620.rom ~/rom-parser
Valid ROM signature found @0h, PCIR offset 1f4h
PCIR: type 0, vendor: 1002, device: 6739, class: 030000
PCIR: revision 0, vendor revision: d0c
Last image
latest from this site.. meanging no UEFI with this card?
and if I disable OVMF, and boot with seabios, should I see anything on screen which is connected to hd 6850 by hdmi? For now, it's nothing there.
Last edited by walkindude (2015-01-11 17:52:03)
Offline