by fpgaminer · 10y ago · 0 comments
Most everything I use runs in Linux, and for the few things that don't I can spin up a VM. But there's the caveat that is as old as Windows itself ... gaming. Dual booting isn't an option for me, because I tend to run various server VMs 24/7. I also didn't want a second tower just for Windows; that's non-ideal. But wait! Apparently modern CPUs have this fancy thing called IOMMU I never knew about, which lets you give direct access to PCI-E devices, like GPUs, to a VM.
So I bought up a 5820K, a X99 motherboard, and an extra graphics card, and away I went. I now have Arch Linux running as the host system where I do all my work. Windows 10 sits in a VM where it's given direct and exclusive access to a GTX 970 for graphics. So far, things are working well and Windows runs the benchmark apps just fine.
The end result is that I can use Linux as my daily driver, but flip over to my Windows VM whenever I want to game. It keeps Windows isolated, which is great from a privacy/security perspective, I don't have to dual-boot, and best of all I can spin up different VMs if I want to use the beastly GTX 970 for other work like machine learning. Thanks to using the 5820K which has a few Xeon features in it, the entire process when smoothly. The biggest caveat is I haven't found a DisplayPort switch yet, so I can't hook up the Windows VM to my primary Cinema monitor, and I haven't nailed down the mouse+keyboard thing yet. QEMU's virtual mouse+keyboard doesn't normally work with these kinds of VMs, so you have to hack it in, and even then it likes to randomly stop working. I could just grab a second set of physical mouse+keyboard but that's not ideal. Steam Steaming will probably be the best option for now.
[0] - https://www.youtube.com/watch?v=LXOaCkbt4lI (14:57)
[1] - https://www.youtube.com/watch?v=lThX7UovKCc (1:35:15 - really long stream of him disassembling it live, so forgive me for not finding exactly where he said each thing).
Then again Nvidia cards have their own set of horrible problems too, although theirs are somewhat on the side of malicious intent rather than incompetence.
[0] - https://github.com/qemu/qemu/blob/master/hw/vfio/pci-quirks....
[1] - https://github.com/qemu/qemu/blob/master/hw/vfio/pci-quirks....
Right now I am basically running a windows pc for gaming and a linux laptop for work. It seems IOMMU is compatible with all my gaming tower, and with many modern cpus/chipsets. I will make a test over a live CD anb if it works migrate my whole pc and blog about it.
Thanks very much for the ida
Link: https://medium.com/@ChakibBenz/making-a-home-made-mini-cloud...
vanilla skyrim never required a good computer... its a different story if it's fully modded, but i doubt you've done that, as you'd be pushing 30 fps with a 290 in that case
Is it as simple as it seems? I'd love to switch over to a VM for windows games backed by vtx and vtd, but I've been worried that it'd be waay more work.
The largest problem is that the NVIDIA driver refuses to work when it detects that it's in a VM. The workaround is to hide the VM status for the guest os, by using -cpu host,kvm=off and disabling the tweaks that makes windows work better (hv_time,hv_relaxed,hv_vapic).
I've seen research that shows the GPU being 98-99% when using QEMU/KVM. I haven't used the system long enough to accurately quantify my personal experience.
> Is it as simple as it seems?
For me getting the GPU working was the easiest part. It worked on the first try. The hardest part was finding good docs (Arch wiki & VFIO blog), trying to understand their little ecosystem, and finding the right compatible parts (hint: besides the CPU, it's really easy). I'd never used QEMU/KVM before (I used VirtualBox previously) so that was a big learning curve. It seems like things have matured quite a bit since the VFIO blog wrote its articles, as a number of things had changed and become easier.
I'd love to, say, run a Hackintosh setup with Windows 10 in a VM that could fully utilize it's own GPU + external ports -- this way I could use a modern VR setup (Oculus or Vive) without having to use Windows full time!
You can also route USB hubs to it the same way, sound cards, etc.
However, my main reason for needing Windows is for music recording and mixing via Cubase and other DAW software. This requires really low-latency access to my USB and PCI sound cards.
Does anyone have experience with running applications like this in a VM? Is it feasible?
I would be thrilled if I could finally move to Linux or FreeBSD entirely and just keep a Windows 7 VM, all sandboxed up with no Internet access, just for the music recording.
That said, "really low latency" is relative. Device assignment will give you excellent I/O performance in terms of sending data to/from the device, particularly for bulk DMA transfers. Where you (likely) still pay a penalty is in terms of interrupt delivery, as on most chips these are still routed through the host even in "passthrough" mode. Even so, you're looking at delays at the outside on the tens of microseconds scale, depending on which microarchitecture you're on and how well tuned the fiddly bits of your hypervisor (presumably KVM for most users) are. Some configurations will be much better behaved here. If your audio hardware goes into polling mode (or can be made to do so) when it is recording you can potentially avoid the interrupts entirely.
(source: I work on Google Compute Engine, in particular on virtualized networking, historically on performance. Virtual interrupt delivery latency is a topic near and dear to my heart, although I don't know a damned thing about audio gear and its tolerances there :)
What you need: Wine Wineasio (for Wine support in FL Studio or others) KXstudio
1. http://kxstudio.linuxaudio.org/index.php 2. https://www.youtube.com/watch?v=GBD-wsMiZCk 3. https://www.youtube.com/watch?v=PhfmGGPcwNc
I/O performance is a whole other story, dependent on many workload and hypervisor specific factors.
https://www.google.com/search?safe=off&q=VGA+PCI+Passthrough...
Otherwise, check the forums. This has been done many times over the years, and there's no shortage of existing information.
[1] https://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardw...
You were allowing Bing to show you random photos by enabling this feature. If you didn't want that, then disable it . . . give a break. Ads on installers have been common for ages. Ubuntu shows advertisements . . . this is out of control with the fear mongering.
The whole KVM/Qemu ecosystem is great.
I'd wish virtualbox would support pci pass-through. Virtualbox being the default and most used vm with vagrant it would be awesome to spin up a linux vm with pci pass-through, so you can have a machine learning vm with cuda.
I would prefer to drop Windows entirely though and was looking forward to SteamOS making strides in this area but it doesn't look too promising.
WINE solves a lot of problems but it's not perfect, and a lot of games still don't work with it according to its compatibility database.
I have a 5820K as well, with a GA-X99-UD3P motherboard and 32 gigs of quad-channel DDR4 RAM, and I dual-boot Linux and Windows. Windows just has Steam, and I do all my work on Linux. It would be wonderful to not have to reboot and switches OSes and just run Windows off a VM with full graphics performance! :)
I splurged on an M.2 PCI-E drive. 2 GB/s read!? How could I turn that down? No way I'll ever use that drive to its full potential, but I love the M.2 form factor.
Only thing I'd change is using AIO cooling for the CPU and the S340 instead of the H440 case. I had to use the H440 for the air cooler, and that was not an aesthetically pleasing choice. The H440 also has a number of obnoxious problems.
Another similar resource is overclocking https://www.reddit.com/r/overclocking
(It feels weird to have to explain that.)
However, it's important to note that you don't need Windows 10, or Windows at all, to play good video games. All the best games play using emulators, since they all came out in the 70s-90s. And Linux supports emulators like MAME and MESS just fine.