The Pragmatic Neckbeard 3: VFIO, IOMMU and PCIe

Hey, hopefully you found some rest and fully recovered last week.

I followed your articles to this point and made a running Windows guest but without ZFS for now. Synergy runs very well via a virtual interface btw. but I am not done adjusting it to my needs.

The only thing left to configure is sound output. A quick test with HDMI audio worked but I am rather looking for a way to send the VM audio to PulseAudio so I can use the host's device.

@SgtAwesomesauce I am keen to read your next article. Do you consider finishing it anytime soon? :)

Much obliged. I have needed someone to hold my hand with this for a while. Thank you, and looking forward to future installments.

Yeah I do plan on releasing soon, I've been struggling with a combination of busy weeks and weekends. I'm a mentor for my local high school's FIRST robotics team, and their 6-week build season is in full swing currently. It's the nerdiest thing I've ever been a part of and I love it. To be honest, I've only written about 120 words on the next article, but I'm going to force myself to start writing after I grab food.

Part of the problem is that I do research on everything I write to make sure that I'm correct. This, often times, makes it take something like 40 hours to write an article, since I'm not a good writer. I'll get working on it though. Thanks for pushing me for it, sometimes I need a little kick.

On the topic of redirecting audio to pulse, there are a few ways to do this. I know that OpenSUSE has automatic 2-way direction (sends input from default input device to VM and sends VM output to pulse), but aside from that, I haven't done much with it. (one of the things I need to research) I usually just pass through a USB controller and plug in my G35.

@khaudio Glad my content can be helpful to you.

is it possible that lets say: some drivers will make vm not to give any output at display (example: amd relive drivers), or it should work on any driver? (rx460 passed throu/ integrated used for host)

I've heard that AMD's ReLive drivers aren't doing too well in a VM. That said, I can't substantiate the rumors myself because my AMD GPU's suffer from the bus reset problem so I use them on the host to make my system more stable.

Try using Crimson and see if they work. If so, then the ReLive drivers are definitely to blame.

Eventually I've let windows update to get whql drivers and it works flawlessly. Thumbs up for pci-e passthrou guides

I've noticed any AMD driver update will fail completely unless I either:
- disable the virtual graphics card (QXL) using the Windows device manager in the guest
- remove the virtual graphics card completely
This also solved an issue on Windows 10 where my primary display was reset to that virtual graphics card and I couldn't see anything.

I am using Fedora 25 on Skylake with an RX 470.

My methods avoid using virtual GPU from step 1 to finish.

Glad to get a green light on the 470 though.

Hmm, for now biggest problem to me is cpu bottleneck I suspect, in WoW i get like ~50-70fps max (where in wine/windows i get ~140-180) and gpu load is really low (gpu-z says max 700-1000mhz core and utilization ~20-40%) but when i run heaven benchmark i get really good performance I'd guess same as on windows (it gives like lowfps(10-15) start but after 1-2 sec it goes up and runs smooth (~up to 40fps on 1080p extreme+tess).I've tried changing cpu socket number and core count, also threads but there's no much difference, does anyone have idea what's causing issue? (also if any1 knows how to get audio from vm (using alsa and virtual-manager)? thx

Are you pinning threads? If not, do so.

It also sounds like your host is trying to use that CPU.

In the real world, that laggy bit in heaven shouldn't be a problem, but let's work out WoW.

Are you still on the A8-5600k? If so, you're probably encountering an issue related to AMD CPUs being weird with QEMU. Have you tried tuning KVM for your CPU? I know you've tried socket number, core count and threads. Have you tried assigning 1 socket, 2 cores, 1 thread. That's probably your idea. Then set CPU pinning to pin it to CPU 2 and 3. Make sure you've got model set to host. That should hammer out your CPU issues.

Another potential problem is your ram. I'm assuming you've got 16GB of ram. Allocate 8GB. You'll also need to set up Huge Pages and tell the VM to use them. That's something that's a bit complex, so I'll go into this in my next installation (which is on the way, I promise!)

hmm, i've tried few things, best one was 1socket,2core,2threads (utilizes full cpu) except in wow i get up to 50% and doenst go higher, even tho it gave me lets say a bit performance now i get ~70fps
also i dont think that linux is actually making turbo boost possible since it reports only 3.6ghz in lshw grep mhz and in virsh node, i disabled it+ set multipl. to 38 so its ~turbo boosted
in cinebench am getting pretty good scores 261 and cpu runs at 100% on all cores

in blender it runs on all cores but ryzen blend is 5:11 *not impressive for now

(am using archlinux on host)

Depending on how boost clock is handled, it may not.

Try installing the linux-pf package from the AUR and switching to it. (different kernel) This will give some minor improvements in certain things.

We need to figure out where the bottlenecks are. The hardest to measure is RAM bottlenecks, which I'm starting to think this may be.

it doesnt get utilized more than 2-3gb, dunno how to test properly, should try memtest? :{
I'll enable huge pages now and retest

Memtest only checks for errors, not really speed. The problem here is definitely speed and not errors, otherwise we would be seeing kernel panics and bluescreens.

hmm how was name of mem copy thing for ramspeed test?
also testing crysis 3 running id say same as on normal windows :O

I think AIDA64 has a memory benchmark...

Crysis 3 is closer to windows performance than WoW? It's possibly a memory or disk issue then. I know WoW does a lot of dynamic texture loading.

btw; i've setup my host as samba server so i share my partitions in network, but, when i copy from it to "virtual C:" it gives a lot of mouse lagg/mini freezes to my vm

Sounds like CPU interrupts. You're going to want to adjust your core allocation to the VM down a bit or upgrade your CPU.

That said, don't make any purchases until Ryzen comes out.

and audio
any ideas how to fix?

Right, audio. Refresh my memory, what was the problem with audio again?