GTA V on Linux (Skylake Build + Hardware VM Passthrough)

Can I do this on a i5-3570 and a Gigabyte GA-Z77X-D3H Mini-ITX? I'm also running on OpenSUSE LEAP

Hi,

This thread and especially video inspired me to take a plunge for VGA pass-through windows set up.
Thought I'll share my experience and hardware/software list.

I just assembled my new Skylake (i3-6320) CPU and MSI Z170A GAMING PRO (MS-7984) Motherboard desktop.
Had Arch Linux already installed, had no issues loading on new hardware.
I was following guides on Arch Linux forums, vfio.blogspot.co.uk, Arch Wiki, and Google in general. After spending a day and half a night setting this up finally got everything working.

Had no major issues, did not need to deviate from instructions.

One thing which kept me long - I forgot to pass x-vga=on parameter with my video card options, and was wondering why I get no output from GPU, VM is not booting and using one core at 100%.

To pass x-vga=on parameter had to create wrapper around /usr/sbin/qemu-system-x86_64, as described in http://vfio.blogspot.co.uk/.
My script (/usr/sbin/qemu-system-x86_64-vga) looks like this:

#!/bin/bash
exec /usr/sbin/qemu-system-x86_64 \
`/bin/echo "\$@" | \
/bin/sed 's|01:00.0|01:00.0,x-vga=on|g'`

Have not tested VM properly, but it seems OK. I only assigned two vCpus (one core and one thread) to VM, so I'm not sure what performance I will get in games. I'm broke right now, so no better CPU in foreseeable future.
Unigine seems to run OK, will install Fallout 4 and see how it goes.

Other spec's:
Motherboard BIOS: 1.80
RAM: 16 Gb Kingston DDR4 @ 2133 (Dual channel)
SSD: PNY CS1311 240GB (EFI and Arch Linux root partitions, /var is moved to HDD)
Image file: located on SSD in my home folder, in qcow2 format, size - 128 GiB.
2 vCPUS are pinned to 1 and 3 physical CPU's.
Host GPU - Intel HD 530 (Integrated)
Guest (passthrough) GPU - Nvidia GTX 660 Ti 2 Gb (Zotac, not AMP - has no UEFI firmware)
Host OS: Arch, kernel 4.5.4-1-vfio (from Aur) - with i915 VGA Arbiter, ACS Override patches, systemd-boot UEFI bootloader
Emulation and VM management: QEMU 2.5.1-1, libvirt 1.3.4-1
Guest OS: Windows 10 Pro (no license yet, for testing), Legacy BIOS bootloader
Guest RAM: 6 GiB assigned, using 4096 of 2 MiB hugepages (6 GiB VM RAM + 2 GiB VGA RAM)
Host/Guest Networking: libvirt default virtual network bridge (NAT), Guest is using virtio NIC.
Sound: have not configured yet, but nvidia DisplayPort audio does work.
Monitor: Asus VE278Q, Host - HDMI input, Guest - DidplayPort input
Mouse keyboard support: Synergy (Host as Server, Guest as Client)

wow, that's super inspiring and really want me to try out a double Xeon build. For me it would be perfect as I need to use a CAD app that does not have a Linux version and it is a sore spot in my workflow.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

I ended up doing a write up since none of the guides worked for me. I hope it will save someone some time, as I wasted far more than I hoped I would :)

GPU Passthrough with QEMU on Arch Linux

Yeah things have changed a bit the last year. I should really update this post to be more current or maybe the community can help with that.

I tried to also be somewhat distro agnostic but a lot of people found that difficult

1 Like

Yes, it is quite a complex topic to write a guide on, the second part of the article is still a draft months later :)

It might be better to reproduce the how-to here on the forum, and link it here on this thread, instead of linking off to your blog. I can make it a wiki post so the community can update it, or you can duplicate my post and fix the parts of it that need love again?

The part 2, the command line part, I feel like the replies on this topic are still on point as far as the CLI options someone might need for different configs.

I'd like to also cover the case where someone has two radeon adapters and wants to use one with the VM and one with linux.

1 Like

It's probably best to have all resources as the more info the better on a topic like this. My blog is easy to follow but very specific while the Arch wiki has a ton of info to go through and is still quite specific. It would be good to have something in between, most common scenarios covered and also multiple distros.

Dual radeon cards shouldn't be difficult at all, I have blacklisted all devices specifically so I believe all I would have to do is add an extra device to the list.

Don't have the will to come back to this right now after the hell I went through to set it up :) Maybe when ZEN and Polaris comes out I will have to come back to it.

@wendell: Just signed up to thank you for the tutorial and the video. I'm actually running this type of setup for over 4 years now, and I don't want to look back to the dark times when I had to dual-boot. I had written a popular how-to on doing this under Xen, and a year ago a similar one to yours using KVM, both over at the Linux Mint forum.
Still, I learned a thing or two reading through your tutorial, in particular the trick with the "intel_iommu=igfx_off" to remove the integrated Intel graphics from the IOMMU.
Ubuntu and Linux Mint ship with kernel 4.4, with the option to update to 4.8. This is what I'm running now. The new kernel may help with some issues that would require for example an ACS patch.
I am actually curious to see what happens when you remove the "pcie_acs_override=downstream" option. If you run ArchLinux and the linux-vfio kernel, the ACS override patch is already applied to the kernel, so your command line makes sense. However, I'm not aware of that ACS patch being applied to a standard kernel, so I would be surprised if that would work in any other distribution or even the standard ArchLinux kernel. Hope I haven't repeated something that had been discussed here (haven't read through the entire thread).

Thanks again for making this great technology more accessible. To me running Windows on bare metal is like riding in a car without a seat belt - it's alright as long as it doesn't crash.

1 Like

@wendell, great write up! I was running into an issue on my skylake and got it resolved through your guide here. Now if I could just figure out how to run two of these machines. I have two of the same video card to pass to my guests (easy since they have the same IDs for exclusion) they're both controlled by vfio-pci but the second machine hates me and refuses to utilize the video card. I shall prevail!

Keep up the great work!

(update for this coming 2017!!!!!!!!!!111one!!)

Can't wait to see this continued and expanded upon!

I'm looking at doing this in Fedora.

Hi !

I'm new here and I'd like (of course) to get hardware passthrough working. I've tried once before and failed. I was trying on integrated graphics but my cpu does not have any (doh!). Now I want my linux host to use an RX480 (the card I'm currently running on) and passtrough a GTX 760 (that I also possess but not currently plugged in). all via a intel i7 3930K processor and i do have 16GB of ram (F3-19200CL9Q-16GBZMD to be exact.) and an Asrock X79 Extreme 6/GB motherboard.

I'm currently running a freshly installed ubuntu 17.04 pretty much stock. haven't touched the kernel or anything yet.

first off, is this set of components a set that allows for hardware passthrough at all?

and how do I view the guide/tutorial? clicking on "show full post" doesn't work for me : it just loads infinitely.

Thank you all

Inb4 someone says to make a new thread.

I beleive everything that was under show more is in post 2.

The show more thing must have not worked, so he posted everything in post 2.

Also, welcome to the community!

here: https://tekwiki.beylix.co.uk/index.php/VGA_Passthrough_with_UEFI%2BVirt-Manager

Not that it matters, but a spelling mistake. D:

1 Like

Got it working a few days ago with Windows 10 Creators edition and was able to pass through a GTX 980ti with the new ID spoofing. When I get done with work I'll see about an updated write up for Fedora with my specific setup which should be common. i7 6700k and Nvidia GPU.

I was getting 100+FPS on Atilla, 60-70 FPS on squad.

2 Likes

I did : https://forum.level1techs.com/t/need-help-on-setting-up-hardware-passthrough-on-ubuntu-3930k/115090
but noone replied :cry:

Where's that?