Is there an easy way of having a vm with gpu pass through to play windows games ?
from shapis@lemmy.ml to linux@lemmy.ml on 13 Nov 02:12
https://lemmy.ml/post/22441009

Basically the title. I’ve only ever seen huge 20 page guides on how to make it work. Is there an easy way?

Specifically on Debian or Arch with a laptop with two gpus (zephyrus g14)

#linux

threaded - newest

nanook@friendica.eskimo.com on 13 Nov 02:16 next collapse

I used the Arch instructions on Ubuntu 22.04 wiki.archlinux.org/title/PCI_p… and it worked, but broke on 24.04 owing to broken UEFI bios on 24.04.

shapis@lemmy.ml on 13 Nov 02:30 collapse

Indeed. That’s the opposite of what I’m looking for though. That’s complicated and apparently breaks ?

I’m currently dual booting. Which works fine. I was wondering if there was an easier way though.

nanook@friendica.eskimo.com on 13 Nov 02:34 next collapse

@shapis It's complicated to setup but once done works wonderfully, you can share one GPU between OS's in real time, even have one windows window up along with Linux at the same time. So I'm temporarily fuxored but I already have a plan for a fix and that is simply to steal the UEFI vm bios from Manjaro which does work and use it on Ubuntu.

walthervonstolzing@lemmy.ml on 13 Nov 02:38 collapse

With Proxmox on AMD gpus, it can be as simple as picking a pci device from a dropdown.

– but then again, you’ll need to learn how to properly use proxmox, esp. with respect to storage configuration. Also, the performance can still suffer, depending on various factors.

If it’s not too big of an inconvenience, dual boot is the way to go, IMHO.

nanook@friendica.eskimo.com on 13 Nov 02:40 collapse

@walthervonstolzing @shapis I personally use kvm/qemu but whatever works for you.

atzanteol@sh.itjust.works on 13 Nov 05:09 collapse

That’s all proxmox does too, just provides a gui and management tools.

JoMiran@lemmy.ml on 13 Nov 02:56 next collapse

VMWare Workstation Pro is now free and I believe that it had GPU passthrough. Don’t take my word on that though. I haven’t used it in a few versions.

nanook@friendica.eskimo.com on 13 Nov 03:00 collapse

@JoMiran @shapis CPU pass through isn't JUST the function of the hypervisor, the host os, guest os, gpu drivers, and uefi bios ALL play a role.

variants@possumpat.io on 13 Nov 05:36 next collapse

If there’s a game that doesn’t work on Linux because of anti or something it probably won’t work in a vm either so dual booting would probably be the way to go to avoid that

nanook@friendica.eskimo.com on 13 Nov 05:41 collapse

@variants @shapis Not true, a root-kit will break it in wine because wine is just translating windows sys calls into Linux sys calls, but a vm is actually running a windows kernel, then the root kit anti-cheat works fine. With GPU pass through, I have found no games that work under Windows won't also work within the VM.

[deleted] on 13 Nov 06:26 next collapse

.

nanook@friendica.eskimo.com on 13 Nov 06:41 collapse

@halfapage I'm saying from experience, nothing I could not get to run in a VM that ran in a physical machine.

[deleted] on 13 Nov 06:57 collapse

.

nanook@friendica.eskimo.com on 13 Nov 07:16 collapse

@halfapage Anti-cheats don't generally care if they're running in a vm as long as they can insert kernel drivers.

PlasticPaperplane@lemmy.dbzer0.com on 13 Nov 11:07 collapse

Maybe anti-cheat software does not care if it is running inside a VM, but online-multiplayer game developers do, and they will ban you for using a VM.

nanook@friendica.eskimo.com on 13 Nov 11:10 collapse

@PlasticPaperplane I've never been banned, but ok.

lord_ryvan@ttrpg.network on 13 Nov 06:57 next collapse

At least MiHoyo’s anti cheat detects and blocks VirtualBox VMs as well as Waydroid.

nanook@friendica.eskimo.com on 13 Nov 07:18 collapse

@lord_ryvan Interesting, haven't played that game so no experience with it. VirtualBox does do some things a bit differently, I was not able to get flyff to run it well, it runs but at about 3fps, where as it runs normally in kvm/qemu.

JustMarkov@lemmy.ml on 13 Nov 08:19 collapse

Vanguard (Valorant, LoL) detects a VM pretty easily.

shekau@lemmy.today on 13 Nov 10:11 collapse

Damn that really fucking sucks man :/

blobjim@hexbear.net on 13 Nov 07:30 next collapse

I also don’t know if there’s any Linux program that will automatically do the configuration for you.

It seems like it would be pretty complex since I guess you need to disable the linux host from using the GPU, and do PCI passthrough in a VM that has Windows installed.

And there’s still the problem of the graphics needing to move around the system in order to get to the display instead of the display being directly connected to the GPU.

Seems like a pretty cool thing that would be neat to have a nice automated GUI solution for.

I was just looking at, seems like it’s difficult but not impossible www.youtube.com/watch?v=eTWf5D092VY

I’m in the same boat that it seems too difficult (and I bet the performance still isn’t near native).

I just dual boot and boot into Windows if I’m going to play a game.

nanook@friendica.eskimo.com on 13 Nov 07:35 collapse

It seems like it would be pretty complex since I guess you need to disable the linux host from using the GPU, and do PCI passthrough in a VM that has Windows installed.@blobjim @shapis


This is all addressed by the Linux kernel and xml code specifying it for the VM.

And there's still the problem of the graphics needing to move around the system in order to get to the display instead of the display being directly connected to the GPU.

Again handled by the kernel and qemu, just requires a bit of XML code in the vm description. Not a big deal.

xtapa@discuss.tchncs.de on 13 Nov 08:10 next collapse

Does it have to be a VM? Is Steam or Lutris not an option?

nanook@friendica.eskimo.com on 13 Nov 08:14 collapse

@xtapa @shapis Lutris is just wine, so any game using a kernel anti-cheat won't work under Lutris. And most of the games I play aren't steam so it does me little good personally, and many of the steam games I have tried don't work on Linux in spite of steam being installed.

Thorry84@feddit.nl on 13 Nov 09:14 next collapse

Most anti-cheat doesn’t take kindly to running in a VM as well, so if that’s the reason it won’t work.

brian@programming.dev on 14 Nov 03:08 collapse

proton has support for quite a few kernel level anti cheat now, although it has to be explicitly allowed by the dev. needs to be run via steam I think, but you can add non steam games if you got them elsewhere

antsu@lemmy.wtf on 13 Nov 15:17 next collapse

I have the 2020 G14 and I got this working once. I’m afraid easy and simple are not a thing here, as you need to understand what you’re doing if you want it to work well. The basics are:

  • Prevent the host system from loading any drivers that touch the discrete GPU. This is done by attaching it to the VFIO driver and uninstalling/blacklisting the Nvidia and Nouveau drivers.
  • Make sure you have the correct kernel parameters to support virtualisation and PCI-e passthrough.
  • Create a Windows VM and attach the Nvidia GPU to it.
  • Setup Looking Glass so you can play with the best possible latency. This will likely require a dummy USB-C display stick.

Personally, I don’t think it’s worth the hassle. I keep a Windows install for when it’s needed, and do most of my gaming on a separate system.

Ptsf@lemmy.world on 13 Nov 23:50 next collapse

Easy way to get yourself banned in online games just an FYI. Most online games will detect and ban virtual machines now since they’ve become commonplace in cheat/hack communities.

nanook@friendica.eskimo.com on 13 Nov 23:57 collapse

@Ptsf @shapis I've primarily gamed from a virtual machine and have NEVER EVER been banned, so I don't think so.

Ptsf@lemmy.world on 14 Nov 00:27 collapse

Depends on the game. Apex, Riot, ubisoft, and EA all ban vm players. A list of other companies do as well.

nanook@friendica.eskimo.com on 14 Nov 02:04 collapse

@Ptsf Haven't played any of those. Anyway, there is a way to edit your xml to fake the machine id.

brian@programming.dev on 14 Nov 02:51 collapse

machine id isn’t necessarily the important part. anticheat and vm detection check a lot of different heuristics incl hard to defend against things like timing attacks on particular cpu instructions. there’s a handful of open source versions if you’re curious

nanook@friendica.eskimo.com on 14 Nov 03:11 collapse

@brian To be honest, until and unless it becomes a problem for me, not really. KVM has the host CPU executing the VM instructions so timing on CPU instructions should product identical results. I have the VM setup as CPU and GPU pass through.

brian@programming.dev on 14 Nov 03:27 collapse

even with cpu passthrough some things are still emulated. you can run a vm detector and see for yourself what tests fail.

it may not affect your games but others should still be careful since it is a real issue, and people do get banned for it.

nanook@friendica.eskimo.com on 14 Nov 03:39 collapse

@brian Ok, just for kicks tell me where I can get this.

brian@programming.dev on 14 Nov 14:37 collapse

I’ve never used it but this one seems like the most complete currently, and it’ll tell you which tests fail.

nanook@friendica.eskimo.com on 15 Nov 00:20 collapse

@brian I have used it and with flyff at least the performance was far insuperior to kvm/qemu.

Sheldan@mander.xyz on 15 Nov 11:48 collapse

The most random mention of Flyff I have seen yet, as long as you mean the game.

nanook@friendica.eskimo.com on 15 Nov 12:52 collapse

@Sheldan Yes I am referring to the game, back when I had tried on vmware it was still the main commercial one that I was playing, I have since moved to Insanity Flyff. One of those minor continuities in my life.

Presi300@lemmy.world on 14 Nov 23:45 next collapse

It’s not… easy but it’s also not 20 pages difficult, unless you wanna do sinlge GPU passtrough, then that’s black magic.

Here is the guide I used when setting it up

This along with the arch wiki’s page on GPU passtrough should be enough to get you setup

E: Pro tip - pay close attention to section 2.3 Gotchas in the arch wiki, this sh!t had me stuck for a while on my system

nanook@friendica.eskimo.com on 15 Nov 00:25 collapse

Single GPU isn't substantially harder than 2GPU pass through, that is what I have done, but it does require support by the UEFI bios and the GPU and not all support it.