About to give up on UNRAID :(


Recommended Posts

I apologize in advance if this comes across as a rant, I am new to UNRAID and this is my first post, however I am literally pulling my hair out at this point.

I have spent close to $3500 on a completely brand new Unraid build, the  idea came from watching 2 gamers 1 pc video on linus tech tips. What I am trying to achieve is as follows:

 

One machine to do the following:

- NAS functionality (Unraid is doing this great and I have no issues with it)

- 1 x Gaming VM

- 1 x Workstation VM

- 1 x Kodi via LibreElec

- Only two dockers (Deluge and Plex)

 

Everything is working great except the VMs. They are laggy, I have audio issues popping/crackling, very high latency on the VMs, even unable to properly watch YouTube videos without stuttering or audio/video sync issues.

 

What I have tried:

- MSI Audio fix (fixes the demonic audio issue, however doesn't fix the popping sounds and AV sync issues)

- CPU pinning (fixes the audio popping issues, but introduces severe lag in the VM like moving the mouse and typing with the keyboard becomes an exercise in patience)

- DPC Latency is averaging between 2000 - 4000 and reaching as high as 16000

- Tried assigning multiple cores, single core, dual cores, isolated cores to no success

- Tried Hyper-v on and off

- Tried ACS override

 

I have a core i7 6700, I have the following cores (0,4/1,5/2,6/3,7)

I have (0,4) unassigned to unraid and dockers,

(1,5) assigned to Windows 10 desktop VM

(2,6/3,7) assigned to Windows 10 Gaming VM

I have tried cpu isolation, emulator pinning but nothing seems to get rid of the latency.

 

I honestly have no idea what to do anymore. More then happy to attach any logs. Don't know if I am expecting too much from my VM, but these are not CPU 100% utilization issues, my CPU shows under utilized in both windows and unraid. My server details are in my signature.

 

Would really appreciate if somebody could point me in the right direction. Thanks

 

Link to comment

I had similar issues until I moved my VM images off of my unRAID array and put them on an SSD mounted through the Unassigned Devices plug in.  The WiKi recommends Cache drive for VM Image storage in a share called "Domains", I think (mnt/user/domains), but you should see a performance improvement either way if you haven't tried either option already.

 

Good Luck!

 

:)

Link to comment

+1 on the SSD mounted vm's. Running a vm off the array would be wore than running it off a straight hard disk.

 

also, downgrade to unRaid 6.2.4. It's the current stable version.

 

I've also found success ignoring everyone's advice about cpu pinning with its own hyper thread. try putting 4,5,6,7 as your gaming cpu (it's not like it's going to break anything) and put unRaid/plex on 0,1, and the other vm on 2,3.

 

also post logs.  :) You're not expecting too much, unRaid sometimes requires patience/trial/error/screaming/pleading/resolution.

Link to comment

Actually, maybe I didn't mention it in my first post, my VMs are on the cache SSD in a Raid 0 configuration, they are sitting under the domain folder. Had I known that I will have to isolate and pin cpu cores I would have gone with a processor with more cores for my workload, I feel it's important that the Unraid marketing material fails to mention this. Almost everyone on these forums seems to be using cpu pinning to avoid latency, then why it is not mentioned in the wiki or system requirements? A lot of people like me will purchase their hardware thinking the workload will be shared between the cores. CPU pinning basically means your cores are not used even if the VM is offline.

Link to comment

 

 

Actually, maybe I didn't mention it in my first post, my VMs are on the cache SSD in a Raid 0 configuration, they are sitting under the domain folder. Had I known that I will have to isolate and pin cpu cores I would have gone with a processor with more cores for my workload, I feel it's important that the Unraid marketing material fails to mention this. Almost everyone on these forums seems to be using cpu pinning to avoid latency, then why it is not mentioned in the wiki or system requirements? A lot of people like me will purchase their hardware thinking the workload will be shared between the cores. CPU pinning basically means your cores are not used even if the VM is offline.

 

I'm not using cpu isolation. I use cpu pinning to make sure a vm or a docker doesn't bog down core 0 and prevent unraid from functioning properly. All other cores are shared on unraid. I have a libreelec vm and a win10 vm both working fine with gpu passthrough. No slow downs, no audio issues. I have other vms running headless as well (Ubuntu).

 

Sounds like you either have a config issue or a fault piece of hardware.

Link to comment

Here it is:

 

<domain type='kvm' id='5'>
  <name>Mohsin</name>
  <uuid>8a8e48cd-1725-8f63-b038-059bd20d690f</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>2</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='6'/>
    <emulatorpin cpuset='1,5'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/8a8e48cd-1725-8f63-b038-059bd20d690f_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'>
    <topology sockets='1' cores='1' threads='2'/>
  </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/Mohsin/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:2f:1f:66'/>
      <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 port='0'/>
      <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-5-Mohsin/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <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='0x02' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <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='0x02' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc52b'/>
        <address bus='1' device='4'/>
      </source>
      <alias name='hostdev2'/>
      <address type='usb' bus='0' port='1'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
</domain>

Link to comment

Your CPU pinning seems odd. This is how I have four cores dedicated to my windows 10 VM that I use for gaming, it resides on its own dedicated SSD as an unassigned device. While I am not using CPU pinning, your core selections seem off. They should correlate like mine. 0=0, 1=1.

 

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='3'/>

  </cputune>

Link to comment

Your CPU pinning seems odd. This is how I have four cores dedicated to my windows 10 VM that I use for gaming, it resides on its own dedicated SSD as an unassigned device. While I am not using CPU pinning, your core selections seem off. They should correlate like mine. 0=0, 1=1.

 

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='3'/>

  </cputune>

 

From what I have read on these forums, you are supposed to assign the matching threading pairs to your VMs for better latency, the thread pair is shown on the Dashboard screen and also in the System Devices tab. That is the pairing I am using. Using it like you will result in worse latency, again this is what I have read on these forums and it's also mentioned in the CPU assignment thread sticky in the KVM forums?

Link to comment

Your CPU pinning seems odd. This is how I have four cores dedicated to my windows 10 VM that I use for gaming, it resides on its own dedicated SSD as an unassigned device. While I am not using CPU pinning, your core selections seem off. They should correlate like mine. 0=0, 1=1.

 

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='3'/>

  </cputune>

 

cpu pinning does not need to correlate to actual cpu numbers on your host. If it did, you could never run more than 1 vm. In fact, it's better to not put a vm on core 0, as unRaid prefers it for host operations.  The op is attempting to put the vm on "core" 3 and its hyper threaded pair. Some people swear by this method, but I've found for certain vm's that using cpu "sides" and not using their hyper threaded pairs in groups actually works better, at least in my case (using a dual processor server.)

 

to take it a step further, and for better response in vm's, one should isolate the intended vm cores away from unRaid so no host functions run at the same time as the vm.

Link to comment

Your CPU pinning seems odd. This is how I have four cores dedicated to my windows 10 VM that I use for gaming, it resides on its own dedicated SSD as an unassigned device. While I am not using CPU pinning, your core selections seem off. They should correlate like mine. 0=0, 1=1.

 

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='3'/>

  </cputune>

 

cpu pinning does not need to correlate to actual cpu numbers on your host. If it did, you could never run more than 1 vm. In fact, it's better to not put a vm on core 0, as unRaid prefers it for host operations.  The op is attempting to put the vm on "core" 3 and its hyper threaded pair. Some people swear by this method, but I've found for certain vm's that using cpu "sides" and not using their hyper threaded pairs in groups actually works better, at least in my case (using a dual processor server.)

 

to take it a step further, and for better response in vm's, one should isolate the intended vm cores away from unRaid so no host functions run at the same time as the vm.

 

Thank you, that's exactly what I was saying. Now the issue is, on a 6700 there are only 4 cores, if I assign only two cores a Win 10 VM, it runs really slow, unable to decode 4k youtube videos, or normal videos, stuttering etc. When I assign 4 cores (logical), the performance improves and the latency is much better however the problem is now I can't run any other VMs because the remaining two cores are assigned to Unraid for obvious reasons. If I give Unraid only two cores, the whole system and all the VMs come to a crawl, and this lead me into my initial argument, that had I known that for optimum performance and latency issues I will have to assign individual cores to VMs I'd have gone with a higher core processor for the build.

Link to comment

Why do you assume your problem is just a processor issue? Maybe its an I/O issue too. You could try putting your VM on a dedicated SSD like many of us have to see if that alleviates any of your issues.

 

I will definitely give that a try and report my findings. Since you have the same CPU, do you have CPU isolation in your sysconfig? Or you are simply assigning cores from the GUI? My latency issues get worse when I don't isolate CPUs.

 

And if it's not too much to ask is it possible that you could assign 2 instead of 4 cores to one of your Win 10 VMs and try playing a 4k youtube video and see if there is any stuttering? It is entirely possible that I might have some other device in my system that is causing the latency issues. Would really help to isolate the issue for me.

 

Thanks

Link to comment

So I modified my Windows 7 VM, removed cores 0 and 1, leaving only 2 and 3, and I did this in the GUI config of the VM, booted up and I am playing a 4K video on youtube full screen, zero lags in either video or audio. I am playing the Costa Rica II 4K  video.

I should also point out that I have 16GB of memory allocated to my VM as well, and as I have mentioned it runs on its own dedicated 500GB Samsung SSD.

Link to comment

Why do you assume your problem is just a processor issue? Maybe its an I/O issue too. You could try putting your VM on a dedicated SSD like many of us have to see if that alleviates any of your issues.

 

this is a +1, though they should run fine on the samsung cache you have....

 

 

but try this and see what happens:

 

isolate cpus 1,2,3,5,6,7

 

assign your power hungry gaming vm 2,3,6,7, set your kodi and workstation both on cpu's 1,4 and set the emulator pin for all vm's to 0,1

 

if the workstation is just writing emails and word documents, it should be able to share cores with kodi, which is fairly low cpu requirements (for me anyways).

 

also try changing your topology to not show/use virtual hyper threads. for a 4 core vm that would look like:

 

<cpu mode='host-passthrough'>
    <topology sockets='1' cores='4' threads='1'/>

 

 

if it still is wonky, then try the vm on cpus 1,2,3 (really) then kodi on 5,6 and workstation on 6,7. this goes against the prevalent consensus on how to pin, but as I stated earlier, I've had more success without using hypertreaded pairs when assigning to vm's. I'm actually beginning to think  pinning is much more influenced by processor/board than a one size all solution.

 

Link to comment

Gentlemen,

 

We have success (somewhat). This is what I did.

 

 <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
    <emulatorpin cpuset='4-5'/>
  </cputune>

 

No CPU isolation, and all the other VMs are off. No latency issues, no performance issues, no audio issues.

However, if I share a care with any of the other VMs, then severe latency issues, so summary is have the emulator tasks off loaded to a free core, do not share any cores with any VMs or unraid and everything works as expected.

Link to comment

So I modified my Windows 7 VM

 

AH!

 

Right. Windows 7 on QEMU... Windows 7 doesnt really perform well in a VM, but there's another tweak you can apply to your <cpu> part of your XML. in your VM XML:

 

change:

  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='1' threads='2'/>
  </cpu>

 

to:

<cpu mode='host-passthrough'>
<topology sockets='1' cores='1' threads='2'/>
<feature policy='disable' name='hypervisor'/>
</cpu>

 

Source: http://vfio.blogspot.co.uk/2016/10/how-to-improve-performance-in-windows-7.html

 

Bear in mind if you make any changes in the GUI to the VM after making this change in the XML, it will dissapear and you'll need to reapply manually.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.