Qemu - virtual machine - cpu pinning (how?)

Let’s do it fast then.


  • image



Error changing VM configuration: xmlParseDoc() failed

Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/addhardware.py”, line 345, in change_config_helper
File “/usr/share/virt-manager/virtManager/details/details.py”, line 1353, in change_cb
return self.vm.define_xml(newxml)
File “/usr/share/virt-manager/virtManager/object/domain.py”, line 1820, in define_xml
File “/usr/share/virt-manager/virtManager/object/domain.py”, line 1794, in _replace_domain_xml
newbackend = Guest(self._backend.conn, parsexml=newxml)
File “/usr/share/virt-manager/virtinst/guest.py”, line 202, in init
XMLBuilder.init(self, *args, **kwargs)
File “/usr/share/virt-manager/virtinst/xmlbuilder.py”, line 547, in init
self._xmlstate = _XMLState(self.XML_NAME,
File “/usr/share/virt-manager/virtinst/xmlbuilder.py”, line 438, in init
self.parse(parsexml, parentxmlstate)
File “/usr/share/virt-manager/virtinst/xmlbuilder.py”, line 454, in parse
self.xmlapi = XMLAPI(parsexml)
File “/usr/share/virt-manager/virtinst/xmlapi.py”, line 292, in init
self._doc = libxml2.parseDoc(xml)
File “/usr/lib/python3.10/site-packages/libxml2.py”, line 1346, in parseDoc
if ret is None:raise parserError(‘xmlParseDoc() failed’)
libxml2.parserError: xmlParseDoc() failed



1 Like

Is there a reason you need to pin things? I’ve always been a “let the scheduler figure it out” guy myself.

EDIT: I see, gaming VMs…

EDITEDIT: I’d give it one entire CCD, cores 12-23 if I had to pick.

12 cores instead of 16?

If it’s unstable I might actually end up with something like that.

My logic is to keep it to a single CCD so you don’t have a bunch of traffic on the infinity fabric between the CCDs.

EDIT: Sorry, I’m being unhelpful, you’re asking why it’s not working not what will give the best performance. I’ve scanned over your config and it doesn’t look like you have a typo at least. Not sure why it’s not working.

can you post the full xml?

1 Like

Do you really need all the available cpus inside vm?

“lscpu -e” lists all the threads, not actual cores.
cpu 0 and cpu 12 are on the same physical core.
cpu 1 and cpu 13 are on the same physical core.
so on and so forth …

If you don’t need last bit of multithread performance, I suggest just passthrough cpu 0-11. Basically, you pin vcpu to every actual core. There is no smt/hyperthread going on inside vm. In the qemu, 1 socket, 12 cores, 1 thread per core.

also, when you are pinning, you should pin pair of threads on the same cores, so, assuming you want all the second CCD plus the last pair from the first one that would be threads:

1 Like

If I do as you suggest… It would look something like this right?
but the last part needs to be reworked in that case.

I’m going to play games so maybe I should just use 12 cores on the VM?

I had to delete the VM, since I was in the creation of it. "/
Something about vfio… I unbound the card again, and is about to bind it again.

GPU-Passthrough-Manager. ;D

Can I install the VM before I start adding stuff to it? Or does it need to have the passthrough:d stuff from the start?

<emulatorpin cpuset="0-3,12-15"
1 Like


1 Like

For gaming, yes. Just passing 12 physical cores gives you best performance.

I did this on my 7950x. Just passing 16 cores results better “Time Spy” cpu score than it did on bare metal. Windows just doesn’t play well with smt.

1 Like

Tips: Use Q35 instead of i440fx.

1 Like


I usually set it as 6 cores 2 threads. Should I do that or set it like this?


12 Cores.
1 Thread.
We are trying to avoid hyperthreading.

1 Like

Which one’s here can I delete?

PCI 0:11 = The 2.5GbE Controller.

Adding the Mouse and Keyboard too, I have two sets connected to the computer atm, since I haven’t fixed a KVM yet.

I get this error message.


Unable to complete install: 'missing target information for device ’

Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File “/usr/share/virt-manager/virtManager/createvm.py”, line 2008, in _do_async_install
installer.start_install(guest, meter=meter)
File “/usr/share/virt-manager/virtinst/install/installer.py”, line 695, in start_install
domain = self._create_guest(
File “/usr/share/virt-manager/virtinst/install/installer.py”, line 637, in _create_guest
domain = self.conn.createXML(initial_xml or final_xml, 0)
File “/usr/lib/python3.10/site-packages/libvirt.py”, line 4481, in createXML
raise libvirtError(‘virDomainCreateXML() failed’)
libvirt.libvirtError: missing target information for device