As an avid watcher of the L1 techs YouTube channel, I love ingesting information on edge use cases of enterprise or HEDT hardware and applying some of that to my homelab situation. Starting around 2020, I began using VFIO for passing through my GPUs to a Windows VM for remote gaming and image processing.
As Wendell mentioned, with every major kernel revision and new GPU generation, the guide keeps changing, and the bugs are aplenty. I’ve been able to get it to work each time, but essentially have to leave it there, “frozen in time” to ensure reliability.
I’ve decided to go a different route. Linux is now great for gaming and AI processing. Why can’t we leverage the power of having an AMD GPU that follows the DRM specification and pass /dev/dri through to individual containers, including a linux gaming one?
The basics:
Proxmox 8
Xeon E5 2690 v4
128GB DDR4 2133 in quad channel
1TB nVME SSD
1TB SATA SSD
5x 4TB Seagate Enterprise SATA HDDs
AMD RX 5700 XT
10GB NICS
I’ve followed a hundred different resources, but I’ve managed to undo my passthrough setup that blocks most of the GPU drivers and instead use the following lines in the LXC config to pass through the 5700 XT using the host’s built-in amdgpu driver:
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
I then install xrdp, add an appropriately permissioned user to access /dev/dri/*, then install a desktop environment of choice.
I’ve found that Gnome, KDE, and lxqt are all no-go since they do all kinds of goofy things inside Proxmox’s containers. I’ve settled on Cinnamon, which I’ve modded to look a lot like Gnome, my DE of choice.
Lots of other little things need tweaking, like certain permissions, installing additional packages that aren’t included in the meta package for Cinnamon, installing Flatpak manually and using mostly Flatpak apps to avoid messing with the base system too much and getting a lot of Gnome apps without actually installing Gnome and screwing up the DE.
Lastly, I installed Sunshine from Flatpak, which allows me to GAME! It uses /dev/dri for hardware acceleration, and is extremely low latency and seemingly reliable. I can’t say the same about the DEB or AppImage packages, which both have issues using anything but the software renderer, but the Flatpak does seem to do the trick.
Steam is installed and running games!
At the same time I’m running my gaming DE container, I have AgentDVR encoding/decoding camera footage, Jellyfin playing/encoding movies, CodeProject.ai running AI things/stuff, and whatever else I want for the future. I’m even running a KVM with PopOS! as my primary desktop, but utilizing the VirGL GPU display type, for OpenGL desktop acceleration.
I’m getting a guide together on getting all of this done. There’s nothing out there that I’ve seen in a single place, unless I’m missing something. There seem to be guides on xrdp and various desktops, but little to nothing on getting them hardware accelerated, low latency, and gaming, while sharing with the host and other containers.
Let me know what you think. Have you tried this? Is there another resource out there that I’m missing? Why aren’t we doing this?
Thanks!