Oculus Rift performance in VM


Recommended Posts

Hi there!

This holiday my inner child ordered the Oculus Rift with an extra sensor.
While waiting for the delivery, I installed an 'USB3.0 x4 ports PCIe' expansion card that I passed through to my VM.

Beforehand I've done passthrough on an ASMedia USB controller integraded on my motherboard.
According to the 'oculus compatibility tool', I was good to go.

 

Upon delivery, I do the usual tedious setup, spreading the three sensors and the Oculus HMD across available USB ports.
Tracking is a bit questionable, and according to the Oculus software it was often the Oculus HMD itself that got messages

stating 'poor tracking quality'. These messages would come and go, and while some games were quite playable, other game 

titles would go completely bonkers trying to track my movement. 'Job Simulator' being the one I've been using to benchmark

the performance.

 

Now, this was on my fairly old Unraid setup, with the following specs:
- Gigabyte ga-z170xp-sli (Firmware F22c)

- Intel I5-6600 (Skylake)

- Crucial DDR4 2133MHz 32GB (4x8GB)

- EVGA GeForce GTX 1060 3GB

- Creative Sound Blaster Audigy FX

- 4 WD Reds in 11TB array with parity

- 512 SSD cache with VM

- USB3.0 x4 ports Renesas PCIe card with direct molex power

- Corsair TX 750W PSU

 

I ran Unraid 6.1.9, and both my onboard ASmedia USB controller and the PCIe Renesas USB3.0 card were isolated on boot and passed through to the VM.
The Creative Sound Blaster card have also been passed through as well as my GPU.

My VM is Win10 build 1709, accessing all 4 cores of my CPU and have 16GB dedicated RAM. Virtio drivers are fairly old. I've never felt as if the gaming experience have been especially impaired by this setup, but then again I've never tried running Win10 natively in bare-metal install on this setup until now.

 

I tried upgrading GPU drivers, rearranging Oculus USB wires for sensors and HMD, and updating USB card drivers through device mananger.

Nothing seemed to make a difference. My tracking would lag out. The Oculus Diagnostics Tool - which puts a small HUD atop any VR experience - stated that I frequently lost a lot of frames while gaming, and that the headroom in terms of CPU and GPU power were underwhelming.

 

While troubleshooting these issues, the Unraid reboots caused my old PSU to commit seppuku. Fair enough I thought; It was old, after all.
A newly purchased Corsair RM750x brought me back up.


At this point I decided I'd try a bare-metal install. This quickly led to more problems - albeit not necessarily related to the performance problems of the Oculus, they are interesting nonetheless; It turned out my motherboards firmware F22c were not fully compatible with my Skylake CPU (Kaby Lake support were introduced in F20, apparently), and my computer would suddenly reboot on a bare-metal install. Flashed to the latest bios - F22f - bare-metal install would work as intended.

I have now tried VR in this setup - with and without the Renesas USB PCIe card - and I can say that it's a whole different experience all together! Movements are fluid, tracking is spot on, and the diagnostics tool proves that theres plenty of headroom both CPU- and GPU-wise in the titles that I've previously struggled with in a virtual machine setup.

 

Now this led me to believe that the firmware was to blame. Last night I reinstated the array, the PCIe cards in their respective slots and booted unraid again. I then did a unraid upgrade in two steps - 6.1.9 to 6.3.5 (i believe it was), and after the subsequent reboot I upgraded Unraid from 6.3.5 to 6.6.6.

After a couple of tweaks on my VMs XML, it fired up as usual. And then also downloaded and mounted up the latest VirtIO iso. I managed to upgrade the virtio drivers on a couple devices in the device management. I did not find the "Virtio Balloon" device, so I could not do anything about that one. Upon trying to reinstall the the "guest agent", my previous disappeared and the new one would not install because of some strange error message. Anyhow my VM seemed to work as inteded and I carried on benchmarking the VR experience, which were shattered quite quickly, as the tracking were now just as bad as they initially were.

 

 

So, in light of this journey, I'm once again reaching out to this community to ask for help:

- Would I be right in assuming that my CPU is in fact the bottleneck in my gaming VM, as it's a regular 4core non-hyperthreaded processor? Seems to me that it's loosing a bit to much performance since it's also keeping my hypervisor running while serving my childish gaming needs. Bare in mind that this was without the usual TeamSpeak, Plex etc.etc dockers running.

- This afternoon I plan on dedicating only two CPU cores to the VM, leaving the other two to the hypervisor. I somewhat doubt that will help, though.
- Are there anything particular that anyone can think of in regards of testing this further? Any settings I should tweak on the VM template, any drivers to avoid/seek in regards of my USB controllers inside the VM? As previously stated; I did not manage to install the updated virtio guest-agent due to a strange error message. The old drivers disappeared as well. Don't know what impact this would cause, if any?

 

Unless someone can shed some light on this for me, I'm now strongly considering buing a upgrade kit consisting of an Asus ROG Strix B360-F mainboard, Core i7 8700 and 16GB Ballistix LT DDR4 2666MHz. I figure this processor would be far better at what I'm trying to achieve, and if not, it would make one hell of a stand-alone gaming rig if I move the GPU across, leaving my Unraid to a KVM-free future.

 

Thanks for reading, hope to hear from you!

Link to comment

I suspect that you're on the right track with trying to update the VirtIO drivers, since looks very much like a KVM performance issue. The fact that you're running KVM on unRAID is kind of incidental, therefore I think you'll have more luck getting deeply technical help on a dedicated KVM forum.

 

By the way, don't sweat it about the balloon device. That just allows the hypervisor to reclaim memory that's been allocated to your VM. If you're not overbooking your memory allocations (that is; assigning more memory in total to your VMs than you physically have), the balloon device doesn't really do much.

 

I really wish I could help you more with this, but my experience with VMs on KVM is limited to some lightweight linux installations. Sounds like your setup is quite advanced.

Link to comment

You're gonna struggle with performance with only having a 4 core CPU.... 

Even more so if you're assigning 4 cores to your VM...

 

You'll have a lot more luck upgrading to something like an i7 8700 which has a lot more CPU threads to play with. Before delving into your wallet, id post in the hardware forum and ask for some advice on where to go hardware wise. AMD are offering compelling options at very good price points...... 

 

in the short term, you could try:

  • isolating the CPU cores you're using on your VM (search the forum for isolcpus). Id isolate core 2 and 3, leaving 0 and 1 available for unraid\docker to use.
  • assigning core 2 and 3 to the VM
  • setting the emulatorpin value in your VM XML to core 1

Post your VM XML and im sure people will chime in with some more suggestions... but you're gonna struggle with such a small cpu core count to play with.

 

 

Edited by billington.mark
Link to comment

Try enabling MSI interrupts in Windows VM on the GPU and all sound devices

MSI_util.zip

 

I also found when I set up a VM for a colleague a few months ago that used an oculus and a racing sim setup that had a whole lot of USB devices plugged in, that performance with the USB devices wasn't good and things were dropping off until I enabled MSI interrupts on the USB controllers as well.

Maybe worth trying msi interrupts on GPU sound and USB?

 

Also, you could try assigning 3 cores to the VM and leaving the first core free for Unraid.

 

But an i7 8700 would most definitely help a whole lot !!

 

Link to comment

Hi, and thank you for your inputs @Leftie, @billington.mark and @SpaceInvaderOne

The same afternoon as I posted the OP, I came to realize that no matter how optimized my gaming VM could turn out to be, the experience would never be as fluid as the bare-metal install I tried. This epiphany made me fork out some dough, and on friday the upgrade kit arrived in the mail.

 

For now I've been running the unraid server on the old computer hardware, and build my new gaming rig up as a bare-metal install. The replies in this thread humbles me, and I really want to find time to pursue the tips that you guys have provided. The overall performance on the new processor is really something, and I really think its 12 HT cores @3200 (up to @4600 in turbo) would make a lot of sense in a unraid kvm build, giving 'lebensraum' for both the hypervisor and the VM. Looking back at the two odd years I've been gaming on this setup with the i5 6600, I feel the old i5 did a very decent job.

 

Even after building the new gaming rig, 'Job Simulator' on SteamVR have had med puzzled, as the laggy/choppy gaming experience carried over.

Last night I set to find out why, and decided to temporarily boot up the bare-metal SSD I used on the old hardware. Upon boot, Windows 10 installed the missing chipset drivers itself. I kept the old 'nVidia 399.24' driver from the previous run, and fired up Oculus Home -> SteamVR -> Job Sim. It ran smooth as silk.

Eager to try the same driver on my M.2 install, I quickly removed the SSD, booted the M.2 drive, removed my newer nVidia driver and installed 399.24 instead. This didn't have any effect, as the game performance (only in SteamVRs 'Job Simulator') were still very very bad.

 

'What is the difference between these setups?', I asked myself. Well, the one thing I hadn't altered yet, which shouldn't make a difference really, is the fact that my new gaming rig has its steamapps library on the Unraid array, connected through my LAN. The temporary SSD bare-metal install had its copy of 'Job Simulator' installed locally. I therefore moved the game folder (available as an Steam option on the games properties tab) from the Unraid steamlibrary array onto my local M.2 drive, and fired it up once again. And what do you know; it ran flawless!

 

Now this has left me thinking. What difference does it make to have the steamapps library on the unraid array as opposed to having it installed locally? I would have thought this would only affect loading times? If the fluidness of the game is affected by file access times on the folder in which it is installed, either I've completely misunderstood the point of having RAM or the game have very questionable coding... All my other Steam VR games (including SkyrimVR) are installed on the array, and they're not affected in terms of laggy/choppy gameplay because of this.

 

 

 



 

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.