2 ms·
Wine does tend to clutter the file associations a bit :( It’s probably possible to work around that but understandable that you don’t want to. Steam Proton is
by jchw 7y ago
Wine does tend to clutter the file associations a bit :( It’s probably possible to work around that but understandable that you don’t want to.
Steam Proton is great since it doesn’t do that and is mostly automatic. I was surprised to see Direct3D 11 titles running just fine at 60 FPS and maxed out settings, very cool.
And yeah, GPU passthrough is kind of the holy grail for desktop VMs. It’s definitely a little tricky, but once you have a good setup going it’s hard to beat. There’s a lot of guides. NixOS really shines here because your entire configuration can be declaratively configured, making your setup easily reproducible and surfacing all of the configuration in one place, but it’s obviously not distro dependent in any way and will work fine on Debian or Ubuntu.
Some downsides:
- Not all machines can VT-d, some can but are not stable. This is better today than ever.
- Your VM GPU needs to be in its own IOMMU group. Modern motherboards tend to do this basically automatically it seems, though its not guaranteed and if not your only workaround is a patch that lets you “split” the groups in an unsafe way that breaks isolation.
- Audio is tricky. Looking Glass does not forward SPICE audio today, so most folks configure qemu to output directly to PulseAudio. If you are using a physical display this approach obviously still works. You can also attempt to forward a USB audio device, or use audio over HDMI/DisplayPort.
edit: I hopped on my desktop. Here's my former NixOS configuration for GPU passthrough, to give you an idea of what kinds of system level configuration is needed:
# IOMMU configuration
boot.kernelParams = [ "amd_iommu=on" "pcie_aspm=off" ];
boot.kernelModules = [ "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
boot.extraModprobeConfig = ''
options vfio-pci ids=10de:13c2,10de:0fbb
options kvm ignore_msrs=1
'';
boot.postBootCommands = ''
# Enable VFIO on secondary GPU
for DEV in "0000:0a:00.0" "0000:0a:00.1"; do
echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
done
modprobe -i vfio-pci
# Setup Looking Glass shared memory object
touch /dev/shm/looking-glass
chown john:kvm /dev/shm/looking-glass
chmod 660 /dev/shm/looking-glass
'';
virtualisation = {
libvirtd = {
qemuOvmf = true;
# To make the PULSE Qemu audio driver work.
qemuVerbatimConfig = ''
namespaces = []
nographics_allow_host_audio = 1
user = "john"
group = "kvm"
'';
};
};
The virtual machine itself also needs some configuration. It will need to use UEFI with a properly-equipped TianoCore image to initialize the GPU. Also, to set the audio driver to something other than SPICE. Finally you need to add the PCI devices, this can be done trivially through the UI as long as you know the PCI IDs of your card.