You are not logged in.

#4776 2015-04-11 17:47:20

logix
Member
Registered: 2013-11-04
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Any ideas on why I can't get IOMMU working? My original post: https://bbs.archlinux.org/viewtopic.php … 4#p1517314

I cannot get DMAR tables populated:

# ls /sys/firmware/acpi/tables/
APIC  BGRT  DSDT  dynamic  FACP  FACS  FPDT  HPET  MCFG  SSDT

I have everything enabled as mentioned in previous post  . Only thing I can think of is hardware issues; however, I've switched motherboards twice.

i7-3930k w/ C2 Stepping (SR0KY)
ASUS P9x79 LE (Tried 4 different bios)
ASUS RAMPAGE IV GENE( Tried 3 different bios)

Internet research shows people have successfully used this hardware. Any ideas?

Last edited by logix (2015-04-11 17:49:41)

Offline

#4777 2015-04-11 18:13:27

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

@logix

It's still a BIOS issue, nothing we can do here.  Maybe Asus doesn't detect the C2 stepping as having VT-d.  It is possible to pass tables into the kernel, but creating and passing that table is beyond the scope of this thread.


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

#4778 2015-04-11 19:00:30

mostlyharmless
Member
Registered: 2014-01-16
Posts: 72

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Anyone tried the UEFI new machine install on virt-manager? There's supposed to be a patch to allow selecting Overview|Firmware and then UEFI or BIOS while "Customizing before install" when making a new machine. All I see is the 440fx or Q35 choice using the latest libvirtd/virt-manager on Arch.

Offline

#4779 2015-04-11 19:40:29

lersek
Member
Registered: 2015-03-15
Posts: 38

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

mostlyharmless wrote:

Anyone tried the UEFI new machine install on virt-manager? There's supposed to be a patch to allow selecting Overview|Firmware and then UEFI or BIOS while "Customizing before install" when making a new machine. All I see is the 440fx or Q35 choice using the latest libvirtd/virt-manager on Arch.

You should have the OVMF package installed, and its files (firmware binary and varstore template) listed as a pair in the "nvram" stanza of /etc/libvirtd/qemu.comf. IIRC virt-manager queries libvirtd, and the UEFI choice means the first entry in that list of pairs (assuming there is a pair). My memories might be off though.

If you edit qemu.conf, don't forget to restart libvirtd.

Offline

#4780 2015-04-11 19:54:51

mostlyharmless
Member
Registered: 2014-01-16
Posts: 72

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Yeah, followed the instructions in the white paper, restarted, still no joy. Any other troubleshooting I can try?

Offline

#4781 2015-04-11 21:22:38

mostlyharmless
Member
Registered: 2014-01-16
Posts: 72

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

@logix
My functioning system with a RIVE IV and a 4930K, bios 4901 shows the same output as you have, namely:

ls /sys/firmware/acpi/tables/
APIC  BGRT  DMAR  DSDT	dynamic  FACP  FACS  FPDT  HPET  MCFG  SSDT

so I don't think that indicates anything. However you should see something like

#dmesg | grep -e DMAR -e IOMMU
[    0.000000] ACPI: DMAR 0x00000000AC4D3690 0000B4 (v01 A M I  OEMDMAR  00000001 INTL 00000001)
[    0.000000] Intel-IOMMU: enabled
[    0.337843] dmar: IOMMU 0: reg_base_addr fbffc000 ver 1:0 cap d2078c106f0466 ecap f020de
[    0.337938] IOAPIC id 0 under DRHD base  0xfbffc000 IOMMU 0
[    0.337938] IOAPIC id 2 under DRHD base  0xfbffc000 IOMMU 0
[    1.001689] IOMMU: dmar0 using Queued invalidation
[    1.001692] IOMMU: Setting RMRR:
[    1.001702] IOMMU: Setting identity map for device 0000:00:1a.0 [0xac39b000 - 0xac3a8fff]
[    1.001727] IOMMU: Setting identity map for device 0000:00:1d.0 [0xac39b000 - 0xac3a8fff]
[    1.001741] IOMMU: Prepare 0-16MiB unity mapping for LPC
[    1.001749] IOMMU: Setting identity map for device 0000:00:1f.0 [0x0 - 0xffffff]
[   10.885128] AMD IOMMUv2 driver by Joerg Roedel <joerg.roedel@amd.com>
[   10.885129] AMD IOMMUv2 functionality not available on this system

Note in particular the first line.  Support for your hardware should be there since bios 1005, see http://rog.asus.com/61782011/news/uefi- … -and-gene/ although your bios could be up to date at 4901 as well.  The only other thing I see that's different is  "pcie_acs_override=downstream" which I don't use.  My kernel line has intel_iommu=on pci-stub.ids=10de:0ffe,10de:0e1b modprobe.blacklist=nouveau,nvidia.  The other weird thing is that your command

#dmesg | grep pci-stub
[    0.700460] pci-stub 0000:02:00.0: claimed by stub
[    0.700501] pci-stub 0000:02:00.1: claimed by stub

doesn't actually show pci-stub in your kernel command line.  Is there a typo somewhere? Extra whitespace? Or did you edit the output?
Here's the result on my machine:

dmesg | grep pci-stub
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/cryptvg2-arch rw intel_iommu=on pci-stub.ids=10de:0ffe,10de:0e1b modprobe.blacklist=nouveau,nvidia radeon.dpm=1 radeon.modeset=1 cryptdevice=/dev/sdb1:cryptvg2 cryptkey=/dev/sdc:vfat:/keyfile
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/cryptvg2-arch rw intel_iommu=on pci-stub.ids=10de:0ffe,10de:0e1b modprobe.blacklist=nouveau,nvidia radeon.dpm=1 radeon.modeset=1 cryptdevice=/dev/sdb1:cryptvg2 cryptkey=/dev/sdc:vfat:/keyfile
[    1.039022] pci-stub: add 10DE:0FFE sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.039030] pci-stub 0000:03:00.0: claimed by stub
[    1.039037] pci-stub: add 10DE:0E1B sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.039045] pci-stub 0000:03:00.1: claimed by stub

You'd have to have horrible luck to have two bad motherboards, so a hardware problem seems unlikely. I am using the standard Arch kernel.

Offline

#4782 2015-04-11 21:39:50

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

mostlyharmless wrote:

@logix
My functioning system with a RIVE IV and a 4930K, bios 4901 shows the same output as you have, namely:

ls /sys/firmware/acpi/tables/
APIC  BGRT  DMAR  DSDT	dynamic  FACP  FACS  FPDT  HPET  MCFG  SSDT

You're missing that logix's output doesn't include the DMAR table, which is essential to VT-d functionality.


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

#4783 2015-04-11 21:54:57

mostlyharmless
Member
Registered: 2014-01-16
Posts: 72

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hmm, missed that; still hope the other suggestions are helpful.

Offline

#4784 2015-04-11 22:59:42

Helios747
Member
Registered: 2012-11-17
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I've made a bit more progress from a blank output. I've tried OVMF and am now correctly passing through my GTX 770 and I'm getting a display!

The snag I'm hitting now is that I can only seem to boot into the default EFI shell. I have no idea what to do from there. I can't seem to boot from my Windows 8 ISO file. I tried typing "bootx64.efi" to see if I could manually trigger a boot but that didn't work.

This is my QEMU command

qemu-system-x86_64 -enable-kvm -m 1024 -cpu host,kvm=off  \
-smp 4,sockets=1,cores=4,threads=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=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd \
-device vfio-pci,host=01:00.0 -device vfio-pci,host=01:00.1 \
-vga none  -device virtio-scsi-pci,id=scsi -drive file=/home/anthony/windows.img,id=disk,format=raw,if=none \
-device scsi-hd,drive=disk -drive file=/home/anthony/win8.iso,id=isocd,if=none -drive file=/home/anthony/virtio.iso,id=virtiocd,if=none \
-device ide-cd,bus=ide.1,drive=virtiocd

What am I missing? Anything obvious?

Offline

#4785 2015-04-11 23:19:12

Denso
Member
Registered: 2014-08-30
Posts: 179

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Helios747 wrote:

I've made a bit more progress from a blank output. I've tried OVMF and am now correctly passing through my GTX 770 and I'm getting a display!

The snag I'm hitting now is that I can only seem to boot into the default EFI shell. I have no idea what to do from there. I can't seem to boot from my Windows 8 ISO file. I tried typing "bootx64.efi" to see if I could manually trigger a boot but that didn't work.

This is my QEMU command

qemu-system-x86_64 -enable-kvm -m 1024 -cpu host,kvm=off  \
-smp 4,sockets=1,cores=4,threads=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=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd \
-device vfio-pci,host=01:00.0 -device vfio-pci,host=01:00.1 \
-vga none  -device virtio-scsi-pci,id=scsi -drive file=/home/anthony/windows.img,id=disk,format=raw,if=none \
-device scsi-hd,drive=disk -drive file=/home/anthony/win8.iso,id=isocd,if=none -drive file=/home/anthony/virtio.iso,id=virtiocd,if=none \
-device ide-cd,bus=ide.1,drive=virtiocd

What am I missing? Anything obvious?

All I can provide is my working Drives configuration , replace yours with these and see if it works :

-drive file=/home/anthony/windows.img,cache=writeback,format=raw,if=none,id=drive0,aio=threads \
-device virtio-blk-pci,drive=drive0,ioeventfd=on,bootindex=1 \
-device virtio-scsi-pci,id=scsi \
-drive file=/home/anthony/win8.iso,id=iso_install,if=none,format=raw \
-device scsi-cd,drive=iso_install \
-cdrom /home/anthony/virtio.iso \

When the UEFI shell appears , type "exit" and hit enter , you will see a menu choose "boot devices" if I remember correctly , then choose the SCSI device .

Hope you'd find your path around ! Good luck .

Offline

#4786 2015-04-12 00:01:38

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Helios747 wrote:

I've made a bit more progress from a blank output. I've tried OVMF and am now correctly passing through my GTX 770 and I'm getting a display!

The snag I'm hitting now is that I can only seem to boot into the default EFI shell. I have no idea what to do from there. I can't seem to boot from my Windows 8 ISO file. I tried typing "bootx64.efi" to see if I could manually trigger a boot but that didn't work.

This is my QEMU command

qemu-system-x86_64 -enable-kvm -m 1024 -cpu host,kvm=off  \
-smp 4,sockets=1,cores=4,threads=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=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd \
-device vfio-pci,host=01:00.0 -device vfio-pci,host=01:00.1 \
-vga none  -device virtio-scsi-pci,id=scsi -drive file=/home/anthony/windows.img,id=disk,format=raw,if=none \
-device scsi-hd,drive=disk -drive file=/home/anthony/win8.iso,id=isocd,if=none -drive file=/home/anthony/virtio.iso,id=virtiocd,if=none \
-device ide-cd,bus=ide.1,drive=virtiocd

What am I missing? Anything obvious?

Create a 4GB fat32 image and copy your windows installation files there, it should work

Offline

#4787 2015-04-12 03:30:45

Helios747
Member
Registered: 2012-11-17
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Alright, I tried that, I didn't get very far though.

This is my new qemu command

qemu-system-x86_64 -enable-kvm -m 1024 -cpu host,kvm=off  \
-smp 4,sockets=1,cores=4,threads=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=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd \
-device vfio-pci,host=01:00.0 -device vfio-pci,host=01:00.1 \
-vga none \
-device virtio-scsi-pci,id=scsi \
-drive file=/home/anthony/windows.img,id=disk,format=raw,if=none -device scsi-hd,drive=disk \
-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-cd,drive=isocd \
-drive file=/home/anthony/virtio.iso,id=virtiocd,if=none -device ide-cd,bus=ide.1,drive=virtiocd

win8boot.img is a fat32 formatted image with all the files from the win8.iso copied to it.


By the way, when I boot the VM, I get msgs of it trying to boot from EFI floppy, EFI floppy 2, EFI DVD/CDROM and all failing.

It then tries to boot from network, fails, then drops me to an EFI shell.

Last edited by Helios747 (2015-04-12 03:31:03)

Offline

#4788 2015-04-12 03:38:50

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Helios747 wrote:

Alright, I tried that, I didn't get very far though.

This is my new qemu command

qemu-system-x86_64 -enable-kvm -m 1024 -cpu host,kvm=off  \
-smp 4,sockets=1,cores=4,threads=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=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd \
-device vfio-pci,host=01:00.0 -device vfio-pci,host=01:00.1 \
-vga none \
-device virtio-scsi-pci,id=scsi \
-drive file=/home/anthony/windows.img,id=disk,format=raw,if=none -device scsi-hd,drive=disk \
-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-cd,drive=isocd \
-drive file=/home/anthony/virtio.iso,id=virtiocd,if=none -device ide-cd,bus=ide.1,drive=virtiocd

win8boot.img is a fat32 formatted image with all the files from the win8.iso copied to it.


By the way, when I boot the VM, I get msgs of it trying to boot from EFI floppy, EFI floppy 2, EFI DVD/CDROM and all failing.

It then tries to boot from network, fails, then drops me to an EFI shell.

First change this:

-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-cd,drive=isocd \
-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-hd,drive=isocd \

Second:

Make sure the file /efi/boot/bootx64.efi exists on the image

Offline

#4789 2015-04-12 04:34:53

Helios747
Member
Registered: 2012-11-17
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Did you mean to paste the changes to be made on the second line?

I think you just copied my win8boot.img line twice.

Offline

#4790 2015-04-12 04:35:50

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Helios747 wrote:

Did you mean to paste the changes to be made on the second line?

I think you just copied my win8boot.img line twice.

-device scsi-cd != -device scsi-hd

this

-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-cd,drive=isocd \

to this

-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-hd,drive=isocd \

Last edited by nbhs (2015-04-12 04:36:34)

Offline

#4791 2015-04-12 16:36:59

ughman
Member
Registered: 2015-04-12
Posts: 7

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hello. I am trying to pass through an AMD Radeon R9 290 to an x86-64 Windows 7 guest using qemu with kvm. I have had significant success so far, the card passes through and runs with excellent performance, however I am having an issue with the guest freezing and/or crashing.

The first issue I had encountered was a crash (BSOD) every time while booting the guest. I believe it was code 0x116 in atikmpag.sys, however I cannot recall for certain. I was able to fix this issue by ensuring the host's module vfio_iommu_type1 was loaded with the parameter "disable_hugepages=1".

For my current issue, there appears to be two cases where the guest fails in (at least slightly) different ways.

Case A

While booting the VM, during the windows logo on black background screen, the following appears in dmesg -w:

[  803.389766] AMD-Vi: Event logged [INVALID_DEVICE_REQUEST device=00:00.1 address=0x000000fdf8010020 flags=0x0a00]

The guest runs fine until some point, usually seems to be associated with high memory or cpu usage. At this point, the following messages appear, in one quick burst, in dmesg -w:

[ 2517.239350] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d400 flags=0x0010]
[ 2517.239357] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d480 flags=0x0010]
[ 2517.239359] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d440 flags=0x0010]
[ 2517.239361] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d4c0 flags=0x0010]
[ 2517.239363] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d500 flags=0x0010]
[ 2517.239364] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d540 flags=0x0010]
[ 2517.239365] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d580 flags=0x0010]
[ 2517.239367] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d5c0 flags=0x0010]
[ 2517.239368] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d540 flags=0x0010]
[ 2517.239370] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:00.0 domain=0x0002 address=0x000000009822d580 flags=0x0010]

(etc, about 47 of these)

At this point, most (all?) applications in the guest (appear to) stop responding to window events, and do not appear to render to their windows anymore. Some, but not all, applications stop producing audio. After 2 to 4 seconds, the mouse cursor freezes. At this point, the guest is unusable except remotely. The keyboard (ps2-over-usb usb passthrough) responds to numlock, some applications continue to run. For example, I have been running a Zandronum game server (UDP) and it continues to receive/send packets, run its game simulation, accept new connections, etc. The client I have running on the same guest appears to stop functioning, however its software MIDI synthesizing still runs. I have been unable to get any -soundhw working without serious quality and skipping/choppiness issues, so I have written a program (user-mode) for the guest to record the audio and then send it over the (virtual) network to the host which then plays it back (this happens over UDP). This program, too, continues to run without issue.

The guest at this point does not respond to system_powerdown from the qemu console. If I press alt-tab or ctrl-alt-delete in the guest, it enters a further frozen state where the keyboard no longer responds to numlock, and the guest appears to no longer get incoming packets (or perhaps the server has frozen/crashed/terminated?). The MIDI synth continues to run, however, and the audio software I have written continues to record the audio and send it correctly.

Case B

When booting the VM, the above error message does not appear in dmesg. Eventually, the system freezes, however no messages appear in dmesg, and there is a chance the screen will turn black for a few seconds and then display a BSOD with the following message:

Attempt to reset the display driver and recover from timeout failed.

*** STOP: 0x00000116 (0xFFFFFA8006257010,0xFFFFF88003C0B848,0x0000000000000000,0
x0000000000000002)

***  atikmpag.sys - Address FFFFF88003C0B848 base at FFFFF88003C00000, DateStamp
 546e9eb6

In either case, I can reset the guest using system_reset (or just quit and then run it later) without doing any kind of reboot/reset/suspend-resume with the host.

The first time running the guest after booting the host, I get case A every time, however from that point on I will (at least it seems) either always get case A or always get case B, until I reboot the host. I could be mistaken about this, however.

The devices I am looking at are these:

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Root Complex
( there does not appear to actually be a 00:00.1 )
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) I/O Memory Management Unit
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1424
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 1425
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii PRO [Radeon R9 290]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device aac8
02:00.0 VGA compatible controller: NVIDIA Corporation G92 [GeForce 9800 GT] (rev a2)
03:07.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV280 [Radeon 9200 PRO] (rev 01)
03:07.1 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] RV280 [Radeon 9200 PRO] (Secondary) (rev 01)

00:02.x are in the same iommu group as 01:00.x which is the card I am passing through. 02:00.0 is the graphics card I'm using for the host. I have blacklisted radeon so the device does not come up aside from the BIOS when booting. The card I am passing through is selected by the BIOS as primary, which I thought might be the issue so I installed a PCI radeon card (03:07.x) and set PCI as the primary VGA display. This did not appear to have any effect on my problem at all.

The script I use to launch the VM is the following:

#!/bin/sh

export QEMU_AUDIO_DRV=alsa
export QEMU_ALSA_DAC_FIXED_FREQ=48000
export QEMU_ALSA_DAC_BUFFER_SIZE=8192
#export QEMU_ALSA_DAC_PERIOD_SIZE=170
qemu-system-x86_64 \
        -enable-kvm \
        -cpu host,kvm=off \
        -m 4096 \
        -smp cores=2,threads=1,sockets=1 \
        -drive file=/dev/mapper/urw-win,format=raw,if=virtio \
        -device vfio-pci,host=01:00.0,x-vga=on \
        -device vfio-pci,host=01:00.1 \
        -usb \
        -usbdevice host:13ba:0018 \
        -usbdevice host:046d:c040 \
        -usbdevice host:0810:0001 \
        -vga none \
        -soundhw hda \
        $*

I have tried various changes to the script with no success:

  • -m 2048, -smp cores=1,threads=1,sockets=1 (didn't fix anything)

  • -smp cores=1,threads=3,sockets=1 (didn't fix anything)

  • removing x-vga=on (system does not appear to actually boot, suspect either seabios or windows can't handle not having any graphics)

  • removing x-vga=on, adding -vga cirrus (system boots, seems more sluggish, did not fix issue)

  • adding multi-function=on to 01:00.0 (had this before, didn't work then either)

  • no soundhw (actually had this before, didn't fix anything)

  • adding vfio-pci devices for 00:02.0, 00:02.1 (error in dmesg unable to reset one of the devices, boots fine but didn't fix anything)

  • without kvm=off (didn't fix anything)

  • -realtime mlock=on (looked hopeful but didn't fix anything)

  • -realtime mlock=off (nope)

I have included some dmesg lines from booting the host, which may be relevant (blank lines where I have cut):

[    0.000000] Linux version 3.19.3-3-ARCH (builduser@tobias) (gcc version 4.9.2 20150304 (prerelease) (GCC) ) #1 SMP PREEMPT 
Wed Apr 8 14:10:00 CEST 2015
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=4f2e65ef-ef21-4628-bbd7-219d7855732b rw quiet cryptdevice=UUI
D=17b9c41f-ab59-4a68-a5ec-b7b3e2776bf6:calue
[    0.000000] tseg: 009f800000
[    0.000000] e820: BIOS-provided physical RAM map:

[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000009bc9bfff] usable

[    0.000000] DMI: To Be Filled By O.E.M. To Be Filled By O.E.M./FM2A88X+ Killer, BIOS P2.10 07/31/2014

[    0.000000] ACPI BIOS Warning (bug): Optional FADT field Pm2ControlBlock has zero address or length: 0x0000000000000000/0x1 (20141107/tbfadt-649)

[    0.000000] AGP: Checking aperture...
[    0.000000] AGP: No AGP bridge found
[    0.000000] AGP: Node 0: aperture [bus addr 0x00000000-0x01ffffff] (32MB)
[    0.000000] AGP: Your BIOS doesn't leave a aperture memory hole
[    0.000000] AGP: Please enable the IOMMU option in the BIOS setup (<- it is enabled)
[    0.000000] AGP: This costs you 64MB of RAM
[    0.000000] AGP: Mapping aperture over RAM [mem 0x90000000-0x93ffffff] (65536KB)

[    0.365445] ACPI: Using IOAPIC for interrupt routing
[    0.365463] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xe0000000-0xefffffff] (base 0xe0000000)
[    0.365501] PCI: MMCONFIG at [mem 0xe0000000-0xefffffff] reserved in ACPI motherboard resources
[    0.365837] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug

[    0.401076] vgaarb: device added: PCI:0000:01:00.0,decodes=io+mem,owns=none,locks=none
[    0.401080] vgaarb: device added: PCI:0000:02:00.0,decodes=io+mem,owns=none,locks=none
[    0.401083] vgaarb: setting as boot device: PCI:0000:03:07.0
[    0.401085] vgaarb: device added: PCI:0000:03:07.0,decodes=io+mem,owns=io+mem,locks=none
[    0.401086] vgaarb: loaded
[    0.401088] vgaarb: bridge control possible 0000:03:07.0
[    0.401089] vgaarb: bridge control possible 0000:02:00.0
[    0.401090] vgaarb: bridge control possible 0000:01:00.0
[    0.401183] PCI: Using ACPI for IRQ routing

[    0.841509] ERROR: Unable to locate IOAPIC for GSI 56 (<- this one appears on the screen during my cryptsetup password entry prompt)
[    0.841566] Failed to set pin attr for GSI56
[    0.841569] pci 0000:00:00.2: PCI INT A: failed to register GSI
[    0.842108] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40
[    0.842109] AMD-Vi:  Extended features:  PPR GT IA PC
[    0.842112] AMD-Vi: Interrupt remapping enabled
[    0.853022] AMD-Vi: Using passthrough domain for device 0000:01:00.0
[    0.854512] AMD-Vi: Lazy IO/TLB flushing enabled
[    0.854893] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.854896] software IO TLB [mem 0x97c9c000-0x9bc9c000] (64MB) mapped at [ffff880097c9c000-ffff88009bc9bfff]

[    0.858586] pcieport 0000:00:02.1: Signaling PME through PCIe PME interrupt
[    0.858588] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
[    0.858589] pci 0000:01:00.1: Signaling PME through PCIe PME interrupt
[    0.858592] pcie_pme 0000:00:02.1:pcie01: service driver pcie_pme loaded
[    0.858604] pcieport 0000:00:03.1: Signaling PME through PCIe PME interrupt
[    0.858605] pci 0000:02:00.0: Signaling PME through PCIe PME interrupt
[    0.858607] pcie_pme 0000:00:03.1:pcie01: service driver pcie_pme loaded
[    0.858619] pcieport 0000:00:15.0: Signaling PME through PCIe PME interrupt
[    0.858622] pcie_pme 0000:00:15.0:pcie01: service driver pcie_pme loaded
[    0.858635] pcieport 0000:00:15.2: Signaling PME through PCIe PME interrupt
[    0.858636] pci 0000:05:00.0: Signaling PME through PCIe PME interrupt
[    0.858639] pcie_pme 0000:00:15.2:pcie01: service driver pcie_pme loaded
[    0.858651] pcieport 0000:00:15.3: Signaling PME through PCIe PME interrupt
[    0.858652] pci 0000:06:00.0: Signaling PME through PCIe PME interrupt
[    0.858655] pcie_pme 0000:00:15.3:pcie01: service driver pcie_pme loaded
[    0.858660] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.858675] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.858716] GHES: HEST is not enabled!

[   11.604037] input: HD-Audio Generic HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input8
[   11.604117] input: HD-Audio Generic HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input9
[   11.604189] input: HD-Audio Generic HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input10
[   11.604258] input: HD-Audio Generic HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input11
[   11.604329] input: HD-Audio Generic HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input12
[   11.604396] input: HD-Audio Generic HDMI/DP,pcm=11 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input13

I also get these while starting the vm:

[  124.786012] vfio-pci 0000:01:00.0: enabling device (0000 -> 0003)
[  124.786149] vfio_ecap_init: 0000:01:00.0 hiding ecap 0x19@0x270
[  124.786155] vfio_ecap_init: 0000:01:00.0 hiding ecap 0x1b@0x2d0
[  128.333852] vgaarb: device changed decodes: PCI:0000:02:00.0,olddecodes=io+mem,decodes=none:owns=none

At some point while troubleshooting I stopped using pci-stub on the kernel command line. Enabling it again has not fixed the problem:

[    0.917064] pci-stub: add 1002:67B1 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    0.917083] pci-stub 0000:01:00.0: claimed by stub
[    0.917091] pci-stub: add 1002:AAC8 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    0.917100] pci-stub 0000:01:00.1: claimed by stub

I hope this post is not too long, but I really don't know where to go from here. If anyone has any answers or advice, please. I'm dying here.

Offline

#4792 2015-04-12 16:53:57

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

@ughman
Just a sidenote: instead of writing a userspace tool for audio transfer, you could use NetJACK instead. Works the same way, pushing audio into UDP.

I can't help you with the main problems, because they're very complex. But i'll just cut some of the info you've provided:

[    0.917064] pci-stub: add 1002:67B1 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    0.917083] pci-stub 0000:01:00.0: claimed by stub
[    0.917091] pci-stub: add 1002:AAC8 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    0.917100] pci-stub 0000:01:00.1: claimed by stub

This is 100% fine.

[  124.786012] vfio-pci 0000:01:00.0: enabling device (0000 -> 0003)
[  124.786149] vfio_ecap_init: 0000:01:00.0 hiding ecap 0x19@0x270
[  124.786155] vfio_ecap_init: 0000:01:00.0 hiding ecap 0x1b@0x2d0
[  128.333852] vgaarb: device changed decodes: PCI:0000:02:00.0,olddecodes=io+mem,decodes=none:owns=none

This is fine, but vgaarb line looks strange. AW may provide more info on this, if he'll come.

00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1424
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 1425

This looks very weird. What kernel version are you using? I suppose you should have something alike to this:

00:02.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Port [1022:1412]
00:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Port [1022:1414]

And since we're sharing same CPU BugList(i've got fam15h mod10h-1fh), and i've been experiencing same weird issues on my x-vga VM too...

I'd suggest you to move to OVMF. That helped me much. In fact, that's the only way i'm able to run VM stable.

P.S.
And why do you have three different GPUs in your system?..

Last edited by Duelist (2015-04-12 17:03:57)


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

#4793 2015-04-12 17:58:03

ughman
Member
Registered: 2015-04-12
Posts: 7

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Duelist wrote:

Just a sidenote: instead of writing a userspace tool for audio transfer, you could use NetJACK instead. Works the same way, pushing audio into UDP.

Thank you, I will look into that.

Duelist wrote:
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1424
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 1425

This looks very weird. What kernel version are you using? I suppose you should have something alike to this:

00:02.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Port [1022:1412]
00:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Port [1022:1414]

I am running "3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux" according to uname -a. The complete lspci list is here:

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) I/O Memory Management Unit
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1424
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 1425
00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1424
00:03.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Root Port
00:04.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1424
00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 09)
00:10.1 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 09)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 16)
00:14.1 IDE interface: Advanced Micro Devices, Inc. [AMD] FCH IDE Controller
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] FCH PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 0)
00:15.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 2)
00:15.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 3)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 30h-3fh) Processor Function 5
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii PRO [Radeon R9 290]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device aac8
02:00.0 VGA compatible controller: NVIDIA Corporation G92 [GeForce 9800 GT] (rev a2)
03:07.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV280 [Radeon 9200 PRO] (rev 01)
03:07.1 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] RV280 [Radeon 9200 PRO] (Secondary) (rev 01)
05:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
06:00.0 Ethernet controller: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller (rev 10)
Duelist wrote:

I'd suggest you to move to OVMF. That helped me much. In fact, that's the only way i'm able to run VM stable.

I will work on this then. Will this require me to get the guest OS UEFI-bootable? At the moment it is installed on an MBR-partitioned virtual drive.

Duelist wrote:

P.S.
And why do you have three different GPUs in your system?..

I only installed the third so that I could get the BIOS to select a card other than the one I'm using for passthrough to not be the primary VGA adapter. The setup screen only allows me to select "PCI Express", "PCI", or "Onboard". The other two are both pci-e and I'm pretty sure I don't actually have onboard graphics because I'm running a non-APU on an FM2+ board.

Offline

#4794 2015-04-12 19:28:30

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

ughman wrote:

I will work on this then. Will this require me to get the guest OS UEFI-bootable? At the moment it is installed on an MBR-partitioned virtual drive.

Yes, the OS will need to be UEFI-bootable. Using OVMF whitepaper you can get Windows 7 to boot.

I'm running a non-APU on an FM2+ board.

AH THE PAIN I FEEL.
So you have AMD Athlon 860K(kaveri) or something and you are experiencing same problems as i've had on 750K(trinity based).
God damn it...
And you even have A88X-based motherboard...
Damn it!
I've considered upgrading my system to 860K+A88X, but seems like my system can not be saved.

So, the only way to run vfio-pci stable on AMD APU-based Athlon CPUs or APUs is OVMF.

UPD:
Just checked AMD's revision guide on fam15h mod30h-3fh - they've deleted a lot of bugs, but the IOMMU ones are still present. Still not quite sure what do they mean.

Last edited by Duelist (2015-04-12 20:06:59)


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

#4795 2015-04-12 19:55:04

Helios747
Member
Registered: 2012-11-17
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

nbhs wrote:
Helios747 wrote:

Did you mean to paste the changes to be made on the second line?

I think you just copied my win8boot.img line twice.

-device scsi-cd != -device scsi-hd

this

-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-cd,drive=isocd \

to this

-drive file=/home/anthony/win8boot.img,id=isocd,if=none -device scsi-hd,drive=isocd \

THANK YOU. IT BOOTS!

I installed windows 8.1, and nVidia drivers installed just fine! Device Manager shows my 770 running properly!

All I need now is sound, but that should be simple enough.

Also, for anybody lurking this thread, I got this all working in Arch Linux with the vfio kernel from AUR. I had trouble getting in working in Ubuntu or Fedora so I said screw it and installed Arch.

Offline

#4796 2015-04-12 20:29:35

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Helios747 wrote:

I had trouble getting in working in Ubuntu or Fedora so I said screw it and installed Arch.

Well, you do know that aw(who wrote vfio-pci) is a redhat developer and he's using.. well.. redhat products?
As my long experience reading this thread says, it's either hardware or people, rarely software problems. So this should work distribution-independent.


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

#4797 2015-04-12 21:27:01

logix
Member
Registered: 2013-11-04
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

We'll I'm finally up and running with a successful GTX 770 pass (what a long adventure).

Looking for some performance tuning, performance is a bit choppy while gaming (med settings, easy to run game). Currently, I cannot get Windows 8 to boot with cpu=host. I get the SYSTEM_THREAD_EXCEPTION_NOT_HANDLED error. I have to use cpu=qemu64 to boot.

Any advice for my boot script?

sudo qemu-system-x86_64 -enable-kvm -m 10240 -cpu qemu64,kvm=off -smp 4,sockets=1,cores=4,threads=4 \
-device vfio-pci,host=03:00.0,x-vga=on \
-device vfio-pci,host=03:00.1 \
-device vfio-pci,host=00:1f.2 \
-device vfio-pci,host=06:00.0 \
-net nic -net bridge,br=br0 \
-rtc base=localtime,clock=host \
-soundhw hda \
-vga none

I am just passing my SATA controller (00:1f.2) directly to the guest in order to boot, because it has Windows already installed on the ssd. 03:00.0 is GTX 770 and 06:00.0 is 1 of 3 USB controllers.

Edit: I'm using a KVM switch and my monitors digital/analog input selector to switch between host and guest. I noticed that when my host goes to sleep, I cannot wake it back up. Any ideas on why?

Last edited by logix (2015-04-12 21:34:45)

Offline

#4798 2015-04-12 23:20:15

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

logix wrote:

We'll I'm finally up and running with a successful GTX 770 pass (what a long adventure).

Looking for some performance tuning, performance is a bit choppy while gaming (med settings, easy to run game). Currently, I cannot get Windows 8 to boot with cpu=host. I get the SYSTEM_THREAD_EXCEPTION_NOT_HANDLED error. I have to use cpu=qemu64 to boot.

Any advice for my boot script?

sudo qemu-system-x86_64 -enable-kvm -m 10240 -cpu qemu64,kvm=off -smp 4,sockets=1,cores=4,threads=4 \
-device vfio-pci,host=03:00.0,x-vga=on \
-device vfio-pci,host=03:00.1 \
-device vfio-pci,host=00:1f.2 \
-device vfio-pci,host=06:00.0 \
-net nic -net bridge,br=br0 \
-rtc base=localtime,clock=host \
-soundhw hda \
-vga none

I am just passing my SATA controller (00:1f.2) directly to the guest in order to boot, because it has Windows already installed on the ssd. 03:00.0 is GTX 770 and 06:00.0 is 1 of 3 USB controllers.

Edit: I'm using a KVM switch and my monitors digital/analog input selector to switch between host and guest. I noticed that when my host goes to sleep, I cannot wake it back up. Any ideas on why?

There's a lot of options for -cpu. Choose one that will represent your cpu best, usually i do -cpu host.
Also, when -smp cores=NUM or sockets=NUM or threads=NUM argument is supplied, the first -smp NUMBER is ignored.
If you want the most simple config - use -smp 4(that'll give you 4 cores).
If you want to follow your cpu's logical core topology as stated in lscpu, you'd do something like -smp sockets=1,cores=4,thread=2(NUM threads is NUM threads per core), that'll give your guest EIGHT logical cpus, like on a real core i7-alike CPU with hyperthreading.
If you'll specify, let's say, one socket, four cores-per-socket and four threads-per-core while having a regular four core host, you'd have a huge performance hit because every one physical core would need to work as two logical cores. When using libvirt, there's a warning issued about that.

So, currently your machine is having one socket, four cores per socket and four threads per core, which sums up into 16 logical cores. Y' sure that you have that much? What does your VM's task manager say about that?

You could also try enabling hugepages or npt.
And you can try pinning your cpus, since looks like you have a lot of cpu cores. Usually that improves latencies and performance alot.

Regarding your edit:
I guess your KVM switch is passive, and just disconnects your mouse and keyboard from the machine. Of course when it's disconnected, your firmware lefts those ports unpowered and it doesn't wait for any signals to come from them. When the power is given, KVM switch is switching somewhere.
Actually, that's a way i've considered going back in the day, but i've stayed on libvirt's VNC "display" - works like a charm, even ACPI power button event is transfered into VM.
But being kind of dumb and retarded, instead of going netjack way or any other way of software audio output, i've built a hardware audio mixer just4lulz and plugged a separate sound card for host needs. So your mileage may vary.

P.S.
Windows 7 is limited to one or two sockets depending on the edition, but it's not limited on overall core or thread core, so it's legal to put two opteron-6300s CPUs and have 32 cores on a real machine, and of course it's possible to do so in a VM.

Last edited by Duelist (2015-04-12 23:27:42)


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

#4799 2015-04-12 23:29:06

Helios747
Member
Registered: 2012-11-17
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Duelist wrote:
Helios747 wrote:

I had trouble getting in working in Ubuntu or Fedora so I said screw it and installed Arch.

Well, you do know that aw(who wrote vfio-pci) is a redhat developer and he's using.. well.. redhat products?
As my long experience reading this thread says, it's either hardware or people, rarely software problems. So this should work distribution-independent.

It was simpler for me because I didn't have to translate many steps listed in this guide to work with various distros. All the steps he gave here worked without modification in Arch Linux.

Offline

#4800 2015-04-13 00:32:06

Helios747
Member
Registered: 2012-11-17
Posts: 12

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

One last issue I'm having, is the sound in the Windows 8.1 VM is choppy. I'm thinking about working around this by simply giving the VM my g930 through a USB passthrough, but if I can I'd like to fix this.

This is my command line

#!/bin/sh

QEMU_ALSA_DAC_BUFFER_SIZE=512 QEMU_ALSA_DAC_PERIOD_SIZE=170 QEMU_AUDIO_DRV=alsa qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off  \
-smp 4,sockets=1,cores=2,threads=2 \
-drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/ovmf_code_x64.bin \
-drive if=pflash,format=raw,file=/usr/share/ovmf/x64/ovmf_vars_x64.bin \
-device vfio-pci,host=01:00.0 -device vfio-pci,host=01:00.1 \
-vga none \
-device virtio-scsi-pci,id=scsi \
-drive file=/dev/SSD/lvWinRoot,id=disk,format=raw,if=none -device scsi-hd,drive=disk \
-drive file=/dev/HDD/lvWinStorage,id=disk2,format=raw,if=none -device scsi-hd,drive=disk2 \
-usb -usbdevice host:046d:c31c -usbdevice host:062a:3621 -usbdevice host:1532:0201 \
-soundhw hda

The audio device Linux is routing this through is "Analog output" on my Logitech G930 headset. I tried the pulseaudio driver but the problem was even worse.

The OP said I'd have to mess around with those env variables to get sound working right but I don't really know how to mess with them. Should I increase the values? Decrease?

Last edited by Helios747 (2015-04-13 00:32:50)

Offline

Board footer

Powered by FluxBB