You are not logged in.

#1 2016-09-06 09:54:56

Caramba
Member
Registered: 2016-09-06
Posts: 4

PCI-Passthrough Performance Optimization with virt-manager

First of all: Hi everyone smile I'm a Newbie in this Forum smile

i hope that this topic is in the right section and that you can help me smile
I configured a VM with PCI Passthrough (Sapphire RX480 Nitro+ OC) and Windows10 using virt-manager 1.4.0.
I want to play Overwatch as good as possible and i tried to give the guest full access on my CPU (i5-3570), so 4 out of 4 cores each 1 thread.
After some games my complete system freezed suddently. I think: Overwatch gets full access to CPU -> 99% Load -> Host freezed.

There is a optimazion chapter on the ArchWiki site (PCI passthrough via OVMF) and i want to configure a cpu pinning (3 cores for guest, 1 core for host).
How can i configure this with virt-manger?
In the CPU section, there is no cpu pinning option, like some screenshots in the internet.
When i run "virsh list ", the list is empty (why?), so i cant use virsh atm..

Does anyone knows a solution for that?
Thanks for your help! smile

Offline

#2 2016-09-06 10:58:50

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: PCI-Passthrough Performance Optimization with virt-manager

Try to run virsh with sudo.

Offline

#3 2016-09-06 14:14:16

Caramba
Member
Registered: 2016-09-06
Posts: 4

Re: PCI-Passthrough Performance Optimization with virt-manager

Thank you for your answer!
I thought "sudo virsh list" lists all machines (running or not), but in my case it lists only machines, which are current running.
I never checked this because i do usb passthrough with my input devices, so i had to shut down my vm first to have access on my host big_smile

Now i can edit the config file and pin my cpus thanks!

EDIT: What do you think is better?
1. Option:
<vcpu placement='static'>3</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
  </cputune>
<cpu mode='host-passthrough'>
  <topology sockets='1' cores='3' threads='1'/>
</cpu>

2. Option:
<vcpu placement='static' current='3'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='0-3'/>
  </cputune>
<cpu mode='host-passthrough'>
  <topology sockets='1' cores='4' threads='1'/>
</cpu>

Last edited by Caramba (2016-09-06 14:17:40)

Offline

#4 2016-09-06 14:37:54

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: PCI-Passthrough Performance Optimization with virt-manager

I'd probably just go with option 1. With the other option you basically don't know where the 4th vcpu will be running and it might end up running on a core that another vcpu is also using.

EDIT: and I think that with the current config in option 2 that last vcpu is actually disabled?
         ("... current='3'>4<..." is telling the virtual machine that it has a CPU with 4 cores, of which 3 are enabled iirc)

Last edited by Omar007 (2016-09-06 14:41:57)

Offline

#5 2016-09-06 15:08:41

Caramba
Member
Registered: 2016-09-06
Posts: 4

Re: PCI-Passthrough Performance Optimization with virt-manager

You are right.
2. Option should be without "current='3'":
<vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='0-3'/>
  </cputune>
<cpu mode='host-passthrough'>
  <topology sockets='1' cores='4' threads='1'/>
</cpu>

I think the 1. Option is safer too.
Overwatch is a heavy CPU game, so i have to deal with it.
Maybe in the future i will buy a new rig with an i7.

EDIT: Is it possible to set a threshhold for the CPU Load?
e.g.: The vm gets all 4 cores, but is only allowed to use them at a maximum of 90%?
So the 10% left can use the host?

Last edited by Caramba (2016-09-06 15:12:41)

Offline

#6 2016-09-06 15:28:03

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: PCI-Passthrough Performance Optimization with virt-manager

If there is a way to do so I'm not aware of it. I'd just take option 1 and leave the last core to the host. That should be more than enough.

If you do push more load on your host than that one core can handle, I'd say just let the scheduler do its job. If you push so much load on your host that it grinds to a halt you probably need a more powerful system (or try to postpone such load until after you're done with your VM) wink

Last edited by Omar007 (2016-09-06 15:29:09)

Offline

#7 2016-09-06 15:50:40

Caramba
Member
Registered: 2016-09-06
Posts: 4

Re: PCI-Passthrough Performance Optimization with virt-manager

Omar007 wrote:

you probably need a more powerful system

I knew it big_smile
My rig gets too old! big_smile

Thank you alot for your help, i will take Option 1 smile

Have a nice evening! wink

Offline

#8 2016-09-06 22:34:48

mapintar
Member
Registered: 2010-04-17
Posts: 50

Re: PCI-Passthrough Performance Optimization with virt-manager

I sucefull run Windows 10 with qemu on my i3-6100 and Samsung 840 SSD. But, unafortunaly, DPC latency is high like describe here:

https://lime-technology.com/forum/index … ic=43126.0

It's result in FPS drop, and audio/video not sync. Check yours.

The provisory solution is isolcpu, and pin isolated cpu to vcpu, disable hiperthreding and cpu speed step. After this change, DPC latency is decent but i have only one cpu in vm (i3-6100 is a dual-core).

Sorry for my bad english.

Offline

#9 2017-02-13 06:53:44

ElectricPrism
Member
Registered: 2012-12-07
Posts: 35

Re: PCI-Passthrough Performance Optimization with virt-manager

mapintar wrote:

I sucefull run Windows 10 with qemu on my i3-6100 and Samsung 840 SSD. But, unafortunaly, DPC latency is high like describe here:

https://lime-technology.com/forum/index … ic=43126.0

It's result in FPS drop, and audio/video not sync. Check yours.

The provisory solution is isolcpu, and pin isolated cpu to vcpu, disable hiperthreding and cpu speed step. After this change, DPC latency is decent but i have only one cpu in vm (i3-6100 is a dual-core).

Sorry for my bad english.

Could you share your config file please? I've had trouble finding good qemu PCI-Passthrough configs. Thank You smile

Offline

Board footer

Powered by FluxBB