Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CPU Isolation / pinning docker / VM

Featured Replies

So I haven't been able to find anything solid on pinning and isolation associations so I'm asking here

 

2700X for reference

 

So I have unraid isolating cores 8-15 for a win10 VM (and the vm pinned to those).

Dockers pinned to 2-7 (except handbrake and plex they are 0-7).

leaving unraid with 0-1 to play with on its own mostly.

 

Now would it be smart/doable to isolate core/thread 2-15 leaving unraid with core 0-1. Then pinning 8-15 to the VM and 2-7 to the dockers.

 

Or does unraid need access to those cores to hand them to the dockers?

 

Basically I'm trying to optimise where I can because I'm still getting annoying ass desyncing of audio on plex, YT and even VLC in the VM (though vlc can fix itself with a few pause/unpauses) games and game performance seem unaffected (unless I'm hammering the crap out of they system but that's something else)

  • Author
2 minutes ago, bastl said:

What do you mean with?

Do you get some sort of "demonic sound"? Is the sound stuttering from time to time?

 

No demonic sounds just lagging behind the video and progressively larger amount of time. it's not even "hang" lag it just slowly gets more behind until it gets to the point that you notice it.

 

6 minutes ago, bastl said:

I went through this a while ago (im using the onboard sound card and not the gfx card for sound)

 

I'll go through space invaders videos again see if there is anything I missed

In my case i also passthrough my onboard sound device and without the msi-util i get the demonic sound even if i don't use the HDMI part of the GPU. Just in case it worked before for you, a windows update had reset the msi-interrupt settings for me and i had to reapply it a couple days ago. 

  • Author
37 minutes ago, bastl said:

In my case i also passthrough my onboard sound device and without the msi-util i get the demonic sound even if i don't use the HDMI part of the GPU. Just in case it worked before for you, a windows update had reset the msi-interrupt settings for me and i had to reapply it a couple days ago. 

The MSI fix sadly did nothing for me and my GTX-1060 I even played with a few other settings to see if that would help.

 

 

well now this is confusing I have 7-15 pinned for the VM (in the gui) but looking at the xml its pinned all 16 cores/threads (was about to ad <emulatorpin cpuset='0,1'/> to it)

The other weird thing is its pairing 0/8 together but everything else says its 0/1 for core/HT

 

it also seems to have loaded itself into an 8 cores cpu instead of 4 cores 8 threads

 <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='8' threads='1'/>

Don't know if I'm looking into that the wrong way.

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' id='1'>
  <name>Windows 10</name>
  <uuid>c81a5f58-b662-3db3-b5eb-df41dfd2e6cf</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>8912896</memory>
  <currentMemory unit='KiB'>8912896</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='8'/>
    <vcpupin vcpu='1' cpuset='9'/>
    <vcpupin vcpu='2' cpuset='10'/>
    <vcpupin vcpu='3' cpuset='11'/>
    <vcpupin vcpu='4' cpuset='12'/>
    <vcpupin vcpu='5' cpuset='13'/>
    <vcpupin vcpu='6' cpuset='14'/>
    <vcpupin vcpu='7' cpuset='15'/>
     </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.11'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/c81a5f58-b662-3db3-b5eb-df41dfd2e6cf_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='8' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Windows 10/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='scsi'/>
      <boot order='1'/>
      <alias name='scsi0-0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win-0.1.141-1.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:af:ca:14'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-1-Windows 10/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'>
      <alias name='input0'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input1'/>
    </input>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom file='/mnt/cache/domains/Windows 10/GP106.rom'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0b' slot='0x00' function='0x3'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x09' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0a' slot='0x00' function='0x3'/>
      </source>
      <alias name='hostdev3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x0b05'/>
        <product id='0x1872'/>
        <address bus='1' device='2'/>
      </source>
      <alias name='hostdev4'/>
      <address type='usb' bus='0' port='1'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
</domain>

 

Edited by BomB191

Can you post a screenshot of your VM settings so i can see the core pairings? In your xml you pinned 8 cores to the VM not 16.

31 minutes ago, BomB191 said:

<topology sockets='1' cores='8' threads='1'/>

For me there is no difference if i use the standard topology from unraid like yours or use something like

<topology sockets='1' cores='4' threads='2'/>

Windows will detect it as 8 cores and will show 8 virtual cores in the taskmanager.

When an AMD processor is used the topology is always assigned as # of cores without hyperthreading.

  • Author

@bastl makes sense that that wouldnt change much. Just had the thought that The VM itself might pick and choose depending on what it's doing.

 

The cores are what I'm interested in though with what appears to be a difference between the GUI and XML. Screenshot ad requested

image.thumb.png.cf9c69d19c85143fea2c6315129355c5.png

  • Author
1 minute ago, bonienl said:

When an AMD processor is used the topology is always assigned as # of cores without hyperthreading.

Oh. Anywhere I can go to figure out why it's done like that?

 

Your CPU pinning looks fine for me. You have choosen 8-15 in the GUI and thats what is in the XML "cpuset=8-15".

<cputune>
    <vcpupin vcpu='0' cpuset='8'/>
    <vcpupin vcpu='1' cpuset='9'/>
    <vcpupin vcpu='2' cpuset='10'/>
    <vcpupin vcpu='3' cpuset='11'/>
    <vcpupin vcpu='4' cpuset='12'/>
    <vcpupin vcpu='5' cpuset='13'/>
    <vcpupin vcpu='6' cpuset='14'/>
    <vcpupin vcpu='7' cpuset='15'/>
</cputune>

Try swaping your sound cards so that the Nvidia one is the first one. I'm not sure if that fixes the sound issue for you, but i always set the first sound card to the one from the GPU and the second to the onboard device. Never noticed that someone did it the order you do.

Edited by bastl

  • Author
1 minute ago, bastl said:

Your CPU pinning looks fine for me. You have choosen 8-15 in the GUI and thats what is in the XML "cpuset=8-15".


<cputune>
    <vcpupin vcpu='0' cpuset='8'/>
    <vcpupin vcpu='1' cpuset='9'/>
    <vcpupin vcpu='2' cpuset='10'/>
    <vcpupin vcpu='3' cpuset='11'/>
    <vcpupin vcpu='4' cpuset='12'/>
    <vcpupin vcpu='5' cpuset='13'/>
    <vcpupin vcpu='6' cpuset='14'/>
    <vcpupin vcpu='7' cpuset='15'/>
</cputune>

Try swaping your sound cards so that the Nvidia one is the first one. I'm not sure if that fixes the sound issue for you, but i always set the first sound card to the one from the GPU und the second the onboard device. Never noticed that someone did it the order you do.

Oh I'm a dumb dumb vcpu == cpuset derp.

I'll flip the sound devices now and see how I go.

I know, sometimes numbers are confusing 😂

30 minutes ago, bonienl said:

When an AMD processor is used the topology is always assigned as # of cores without hyperthreading.

Before using unRaid i had a Fedora system setup on my TR4 around a year ago and back than i had setup a Windows VM with the same cores assigned as i'am now using except that the topology was set to 

<topology sockets='1' cores='8' threads='2'/>

and inside the Windows VM it showed as 8 cores 16 threads. If i use that format in Unraid the VM picks up the exact core count (16) but never shows the HT. Is that an unRaid thing or is it something with the never qemu/libvirt versions?

 

Another question:

If i isolate some cores, am i able to use some of them as emulatorpin or does the emulatorpin has to be a un-isolated core? 

Edited by bastl

  • Author

sounds flipped but I won't be able to binge anything until tonight when I get home. I'll post back when I can

  • Author

OK so now with the emulation only on core 0/1 the msi fix back on and sound flipped.

 

The sound now longer lags but the video glitches so it stays in sync with the audio. not as bad but still an issue

edit. turns out that only happened with netflix. plex is still doing it.

Edited by BomB191

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.