98

For years I’ve had a dream of building a rack mounted PC capable of splitting its resources to host multiple GPU intensive VMs:

  • a few gaming VMs
  • a VM for work that can run Davinci Resolve and Blender renders
  • an LLM server
  • a Stable Diffusion server
  • media server

Just to name a few possibilities…

Everytime I’ve looked into it, it seemed like the technology just wasn’t there yet. I remember a few years ago Linus TT took a shot at it, but in the end suggested the technology (for non-commercial entities) just wasn’t in a comfortable spot yet.

So how far off are we? Obviously AI focused companies seem to make it work, but what possibilities exist for us self-hosters who might also want to run multiple displays in addition to the web gui LLM servers? And without forking out crazy money for GPU virtualization software licenses?

top 50 comments
sorted by: hot top new old
[-] TCB13@lemmy.world 49 points 2 years ago

The technology has "been there" for a while, it's trivial do setup what you're asking for, the issue is that games have anti cheat engines that will get triggered by the virtualization and ban you.

[-] socphoenix@midwest.social 8 points 2 years ago

Which games do that? Running pasthrough gpu on windows for destiny and halo at least gave me 0 issues for years

[-] You999@sh.itjust.works 15 points 2 years ago

Anything using vanguard such as valorant and league of legends, battleye such as pubg, destiny 2, and rainbow 6 siege, and easy anti cheat such as fortnight blocks virtual machines. Vanguard is especially bad because it will not allow to run the game with Intel-VT/AMD-V enabled even if you are running bare metal as of its last update.

[-] socphoenix@midwest.social 7 points 2 years ago

That’s weird destiny 2 has never given me issue, though I don’t play super frequently so maybe I’m just lucky

load more comments (1 replies)
[-] Dark_Arc@social.packetloss.gg 4 points 2 years ago

I'm surprised, I was pretty sure anything with Battleye flat out rejected virtualization.

I thought Destiny used Battleye but I must be mistaken on one of these points.

load more comments (2 replies)
[-] Decipher0771@lemmy.ca 22 points 2 years ago* (last edited 2 years ago)

I’ve been doing exactly that at home for a couple years now. First with Parsec, now Sunshine/Moonlight.

Host is Proxmox on Ryzen 5800x, 64gm RAM GPU is 2070 Super, with VGPU patched drivers from https://gitlab.com/polloloco/vgpu-proxmox

When I’m gaming I’ll dedicate the full 8Gb to my windows Vm, otherwise I split it in 2 or 4Gb chunks to Jellyfin or my home camera monitoring. 8gb can’t split very many ways, and most things require at least 2 to run.

Locally at home I can run 1440p 60fps rock solid over wifi on any device, from my phone/old laptop/apple tv/raspberry pi. Remote I can do 1080p60, but a bit more hit or miss depending on my network connection.

Experimenting with LLMs I’ve done through the same windows VM, or to a ubuntu dev VM. Works the same way. I’m thinking of transitioning my gaming VM to Linux too.

The amount of VRAM is the hard limitation to get past, the virtualization tech itself has been there for a while.

But to be perfectly honest……it really was just a “let’s see if I could do this” type task, direct GPU pass though is more straightforward and it’s not really worth splitting 8Gb these days. Unless you get a card with significantly more VRAM passthrough is much less work.

[-] Lem453@lemmy.ca 6 points 2 years ago

This is really amazing! In theory, can you can use 2gb with 4 different VMs?

[-] Decipher0771@lemmy.ca 5 points 2 years ago

Sure, but you’ll get diminishing returns most likely as consumer hardware doesn’t really have the resources to scale that way very well if all the VMs are running demanding apps simultaneously.

Even for something like 4 VMs that just do NVenc, there are limits for how many streams the GPU can do. I think there’s another patch that lets you raise that, but at some point you’ll run out of resources quick. Even powerful consumer gear isn’t really designed to be used by more than one user/app and it starts to show the more you virtualize and split those resources.

How does the vGPU compare to running it on the bare metal? Last I tried things were painful but technically usable.

[-] Decipher0771@lemmy.ca 3 points 2 years ago

I don’t see any performance differences with the vgpu actually. I have more performance bottlenecks with the CPU, and my RAM isn’t the fastest, so I think I’m more CPU limited. Benchmarks I have run that are GPU focused seem to show little to no difference from what the physical card would do.

load more comments (4 replies)
[-] LrdThndr@lemmy.world 14 points 2 years ago* (last edited 2 years ago)

I bought a cheap used Dell R710 on Facebook marketplace for like $100 or so, as well as an ups, rack, 10g switch, etc, from various other sellers. All told, I’ve got about $500 in my server setup.

Installed proxmox on it. It’s “free” if you don’t buy a license. You just have to put up with a little nag screen when you open the control panel but it still works 100%, much like winrar.

Works great.

Edit: just realized this is in c/selfhosted AND I misunderstood the post. I’m gonna leave it here just on the off chance it’s useful to somebody, but I acknowledge it’s not what you’re looking for.

[-] lupec@lemm.ee 10 points 2 years ago

Btw just in case you aren't aware, the nag can be done away with. I don't have a link off the top of my head but it's out there.

load more comments (1 replies)
[-] Byter@lemmy.one 10 points 2 years ago

I've also wanted to do this for a while, but there were always a few too many barriers to actually spin up the project. Here's just a brain dump of things I've seen recently.

vGPUs continue to be behind a license. But there is now vgpu_unlock.

L1T just showed off PCIe "fabric" from Liqid that can switch physical devices between machines.

Turning VMs on and off isn't as slick as either of the above, but that is doable today. You'll just have to build all the switching automation yourself. That could just be a shell script running QEMU/libvirt commands, at a minimum.

load more comments (6 replies)
[-] monomon@programming.dev 10 points 2 years ago* (last edited 2 years ago)

I know you asked about VMs, but fwiw there are GPU-capable containers now: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

Used one of these and the setup is as easy as it sounds. It can run Houdini, Stable Diffusion.

[-] just_another_person@lemmy.world 9 points 2 years ago

You're not really describing your use-case here. Are you just trying to run a server that does all your rendering for you so you can play games elsewhere? Yes, that's totally possible.

If you're trying to describe a business...no, it's not possible, scalable, or profitable.

I'm curious as to what your intentions are here though.

[-] brownmustardminion@lemmy.ml 6 points 2 years ago

I have a workstation I use for video editing/vfx as well as gaming. Because of my work, I'm fortunate to have the latest high end GPUs and a 160" projector screen. I also have a few TVs in various rooms around the house.

Traditionally, if I want to watch something or play a video game, I have to go to the room with the jellyfin/plex/roku box to watch something and am limited to the work/gaming rig to play games. I can't run renders and game at the same time. Buying an entire new pc so I can do both is a massive waste of money. If I want to do a test screening of a video I'm working on to see how it displays on various devices, I have to transfer the file around to these devices. This is limiting and inefficient to me.

I want to be able to go to any screen in my house: my living room TV, my large projector in my studio room, my tablet, or even my phone and switch between:

  • my workstation display running on a Window 10 VM
  • my linux VM with youtube or jellyfin player I use as a daily driver
  • a fedora or Windows VM dedicated to gaming, maybe SteamOS
  • maybe a friend comes over for a LAN party and we both can game without having to set up a 2nd rig
  • I want to host an LLM or stablediffusion server without having to buy a new GPU with enough VRAM to run SDXL
load more comments (6 replies)
[-] pepperprepper@lemmy.world 8 points 2 years ago

You can use proxmox to do most of this. Currently my set will only pass-through the gpu to one VM. I have heard of splitting the power among VMs but I have not gone down that rabbit hole. If I want to play with llms I fire up that server, if I want to game, I shut that down and fire up my windows 10 vm.

[-] mikyopii@programming.dev 9 points 2 years ago* (last edited 2 years ago)

In Proxmox they have VirGL-GPU and Virtio-GPU. They allow VMs to pass work to the GPU without being dedicated to one VM. I don't think gaming was the intended use case and don't know what kind of performance you would get. My uninformed guess is that it would not be great.

load more comments (1 replies)
[-] MudMan@fedia.io 8 points 2 years ago* (last edited 2 years ago)

OK, but why?

Well, for fun and as a cool hobby project, I get that. That is enough to justify it, like any other crazy hobbyist project. Don't let me stop you.

But in the spirit of practicality and speaking hypothetically: Why set it up that way?

For self-hosting why not build a few standalone machines and run off that instead? The reason to do this large scale is optimizing resources so you can assign a smaller pool of hardware to users as they need it, right? For a home set of two or three users you'd probably notice the fluctuations in performance caused by sharing the resources on the gaming VMs and it would cost you the same or more than building a couple reasonable gaming systems and a home server/NAS for the rest. Way less, I bet, if you're smart about upgrades and hand-me-downs.

[-] Catsrules@lemmy.ml 4 points 2 years ago

Yep this has been my hold up. It is mostly just a solution in search of a problem.

The best use case I have come up with is if you have an nice computer and an extra GPU laying around. You could turn the single computer into two workstation/gaming computers.

load more comments (4 replies)
load more comments (2 replies)
[-] Sethayy@sh.itjust.works 8 points 2 years ago

I currently have a setup exactly like this, with a threadripper 2950x, an RX 6600, and a 2070 super.

Let me know if you have any questions in the specifics, but its 100% possible

Best part of this setup is being able to connect to both via sunshine on many displays at once

load more comments (2 replies)
[-] Trincapinones@lemmy.dbzer0.com 7 points 2 years ago

I've recently tried to do that using sunsine and different linux gaming distros and it was awful, the VM was working great for a few minutes and then suddenly crashes and I have to hard stop it.

All the people that I've seen talking about it on the internet are using Windows VMs so I guess that I'm doing something wrong or the only way to do it is through a Windows VM, which I'll not even try.

[-] Sebbe@lemmy.sebbem.se 6 points 2 years ago

I run a gaming Linux VM on my server and it works fine.

[-] Trincapinones@lemmy.dbzer0.com 4 points 2 years ago

Could you explain how? I'm pretty lost in this situation...

load more comments (2 replies)
[-] vividspecter@lemm.ee 3 points 2 years ago* (last edited 2 years ago)

I’ve recently tried to do that using sunsine and different linux gaming distros and it was awful, the VM was working great for a few minutes and then suddenly crashes and I have to hard stop it.

Are you running this with something like libvirtd/qemu? If so, VFIO configurations can get pretty complex. Random crashes seem like MSI interrupt issues (or you've allocated too much RAM to the guest). Or it could be GPU reset issues that would also occur on the (Linux) host, a newer kernel and Mesa version in the guest may help.

Setting on the kernel commandline for the host to workaround MSR interrupt crashes:

kvm.ignore_msrs=1

If you're running on a Windows host or with something like Virtualbox (assuming GPU passthrough is supported by these), YMMV but I wouldn't expect good results.

load more comments (3 replies)
[-] voklen@programming.dev 6 points 2 years ago

I've never done anything like this myself but maybe Sunshine with Moonlight might be worth a look

[-] mesamunefire@lemmy.world 3 points 2 years ago

I got stardew working on a local network and playing on the miyoo mini. It was cool for the novelty, but had terrible performance outside a local network. After only a couple of hops it's unplayable and will disconnect.

load more comments (1 replies)
[-] DaGeek247@fedia.io 6 points 2 years ago* (last edited 2 years ago)

Craft computing has been chasing this for several years now. His most recent attempt being the most successful one. https://m.youtube.com/watch?v=RvpAF77G8_8

load more comments (1 replies)
[-] diminou@lemmy.zip 5 points 2 years ago

You should take a look at https://www.youtube.com/channel/UCp3yVOm6A55nx65STpm3tXQ he does have a serie about doing something like this and go in depth in it

load more comments (2 replies)
[-] yggstyle@lemmy.world 3 points 2 years ago

As others have expressed- were already there. Understand though that the reason this hasn't caught on mainstream is the entire purpose of what you are asking is simple: it runs counter to the standards of commercial capitalism. We are talking about efficiency, self hosting, doing more with less, and cutting strings.

That said- understand that what you are undertaking is not dissimilar from building infrastructure in a company. You are building and expanding to meet your needs. Your needs are unique so there isn't a 'turn key' solution that will fit perfectly... so you need to try things and see what works.

As far as things you are talking about specifically: you are going to ultimately be dipping your toes into the virtualization world... so xcp-ng and proxmox are good choices. If you can get your hands on older copies and uh... source a key or two: esxi is also very beginner friendly but won't be able to upgrade thanks to their new pricing model. You seem like you are aware of the YouTube sphere so let me recommend 2GuysTech and the series on different hypervisors.

Once you decide on a hypervisor it's as 'simple' as building a PC to meet your needs. If you have one already I'd start there to get a feel for how much you can pull out of it to determine how much you may need. You can probably split up a single GPU or just pass it through (cost vs performance.). LLMs are power / resource hungry so that may require it's own GPU.

If power is cheap by you you can look into older server hardware but honestly this can be a messy space to dabble in (noise, heat, power costs.)

From there play with services that fit your needs.

It's very doable and there are some easier paths to take... certainly- but again the thing about homelabs is it's very custom. This is why the community (in general) is willing to help. We all have had to forge the same path.

[-] Takumidesh@lemmy.world 9 points 2 years ago

None of the presented solutions cover the aspect of being in a different place than the rack, the same network is fine, but at a minimum a different room.

How do you deliver high resolution (e.g. 1440p, 144 fps) to multiple monitors with low latency over a network? I haven't seen anything like that accomplished without running fiber from the host.

Eventually, your thin client will need too much power anyway, making the costs rise a lot. It makes sense in an office where you have 500 seats and you can load balance resources.

If someone can show me a multi seat gaming server that has native remote performance (as in you drag windows around in 144 fps, not the standard artifacty high latency behavior of vnc) I'll eat a shoe.

[-] mesamunefire@lemmy.world 7 points 2 years ago

Yep just ping time and latency make this a no go for a vast majority of us.

load more comments (1 replies)
load more comments (8 replies)
load more comments (9 replies)
[-] Codilingus@sh.itjust.works 3 points 2 years ago

Unraid does an excellent job at this. I helped a friend setup a rack mounted server, it runs home assistant, some other containers, and a VM for him to work in, or play games. AMD GPU being passed through.

[-] filister@lemmy.world 3 points 2 years ago

Do you really need multiple VMs, can't you run all at one? The easiest would be to install some windows/Linux on a single machine. Then stream your games with Sunshine/Moonshine and connect over RDP/VPN?

load more comments
view more: next ›
this post was submitted on 15 Jun 2024
98 points (95.4% liked)

Selfhosted

62018 readers
1151 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS