I tried out unRAID last year as an alternative to VMWare vSphere because getting non-server hardware to work with vSphere is getting more difficult with each release. Now I know that unRAID’s bread and butter is functioning as a NAS, but in recent releases they’ve added a ton of features, one of them being VM hosting support via QEMU. One of the surprising features that led me to eventually purchase unRAID is the ability to passthrough NVIDIA GPU’s to your VM. This allows users to play the latest titles on a VM with little to no performance loss. Say bye-bye to virtual graphics that can barely run Minesweeper let alone Minecraft. OK, that’s a bit of an exaggeration. I get great frame rates in Minesweeper. Keep in mind that this isn’t exclusive to unRAID and you can accomplish the same thing with QEMU on a standalone Linux box.
Now the setup for GPU passthrough with unRAID is fairly straightforward, but one of the bugs that has become more noticable with version 6.2 and above is video and audio stuttering. I would occassionally have some audio stuttering issues with unRAID 6.1, but never really saw any video problems until I upgraded to 6.2. This was very frustrating to say the least as gaming on my VM was effectively crippled. The problem was so severe that I couldn’t even play Youtube videos on the VM.
After much research I found a Windows registry fix that seems to have made everything all better. Now this fix will only work for NVIDIA cards that support MSI or Message Signaled Interrupt.
Checking GPU for MSI Capabilities
With your VM running, you’ll want to SSH to your unRAID server as root and run this command.
lspci -v -s 01:00.0
Look for the line that begins with Capabilities: . If you see MSI: Enable-, that means your GPU supports MSI, but it currently isn’t enabled. MSI: Enable+, means MSI is already enabled for your GPU. If you don’t see MSI listed at all, that means you’re out of luck and it may be time for an upgrade. It’s important that the VM you’re passing your GPU to is running as MSI will always report as disabled when the VM is off.
If you’ve discovered your GPU doesn’t support MSI then you can stop reading and head to Amazon or NewEgg to order a new GPU. If, however, you’re fortunate enough to have a modern GPU with MSI support, you’ll want to check if your GPU’s Audio has MSI enabled.
lspci -v -s 01:00.1
As you can see, both the Video & Audio portions of this NVIDIA GPU support MSI, but currently don’t have MSI enabled. Time to implement the fix.
Reclaiming your GPU Performance
Now it’s time to login to the VM in question and apply a reghack that will enable MSI. My gaming VM is running Windows 10, but this fix should work all the way back to Windows 7.
Once logged into your Windows VM, go to Control Panel -> Device Manager and open the Properties of your GPU under Display adapters.
In the Properties window, click on the Details tab and select Device instance path from the Property drop-down menu.
Copy or take note of the path (Yes I know its really, really long) and next open up regedit. Locate your GPU regkey under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ plus the Device instance path we found in Device Manager.
Example GPU Regkey
Under your GPU regkey, locate the Device Parameters key. You’ll need to create the following regkey and sub-regkey, Interrupt Management -> MessageSignaledInterruptProperties. Then create a DWord Value named MSISupported and set its value to 1. When completed your registry should look something like this.
Doing the Same for your Audio Performance
You may think you know exactly what we’re going to do next, but here’s the tricky part. I originally thought I needed to apply the regfix to the NVIDIA High Definition Audio device, but it turns out that for me, I needed to apply it to the High Definition Audio Controller under System devices instead. If this doesn’t work for you, you can try applying the fix to both, but this is what worked with my setup. Head back to Device Manager.
Open the Properties of the High Definition Audio Controller and click on the Details tab and find the Device instance path in the Property drop-down just like before, then copy or write down the path.
Go back to regedit and locate the Audio Regkey under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ plus the Device instance path.
Example Audio Regkey
You’ll need to create the same Regkey, Sub-Regkey and DWord Value. Interrupt Management -> MessageSignaledInterruptProperties and MSISupported with the value 1. After making these changes, your registry should look like this.
Checking Your Work
Now that our regfixes are in, reboot your VM and SSH into your unRAID server again.
lspci -v -s 01:00.0 lspci -v -s 01:00.1
After running these two commands, you should see MSI: Enable+ for both devices. With the hard work out of the way, log into your VM and enjoy all the games and HD videos the world has to offer.