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

nvm, neither my cpu or motherboard suppord IOMMU. But i have an fx6300 and asrock 970 lying around which I can swap and they both support IOMMU.

I have been thinking about trying this for a year or so now, so glad to see a video on it. I had actually forgot about this recently, so thanks @wendell. I have mostly compatible hardware as well and generally run Arch Linux on a day to day basis.
Plus with me starting to move my storage off to my new NAS(running arch, using zfs), I may even try passing through and booting off of my window install which is on a secondary ssd :D

I might get a second lower end amd or nvidia card to run linux under. I currently have a watercooled r9 290x as my main card running 2 2560x1440 x-star monitors and 1 1920x1200 monitor.

This has also given me interesting ideas to attempt to setup a(preferably 10gb but I need to read into this more) host only network adapter with the virtio-net driver, then write some type of application to scrape the framebuffer in windows to return back to the linux host. That way we wouldn't need to go and take up a full monitor just for windows :)

Looking into the synergy source code, it actually looks fairly clean so it would be cool to try and adapt the code to work for that purpose. However at that point I would basically be reimplementing all of the underlying protocol to VNC called RFB...

The output of dmesg|grep -e DMAR -r IOMMU:
[ 3.621621] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40

I can't seem to find an AMD example of what the output should be. Is this output line enough to confirm that the IOMMU tables are working? (I asked the seller to run the command for me)

I'm having trouble trying to get this to work on Linux. I've tried multiple distros but they all freeze at a certain point at the startup. I've started a thread here:
https://forum.teksyndicate.com/t/help-running-linux-guest-under-arch-linux-qemu-kvm-vga-passthrough/88273

I have Windows 8.1 working almost completly stable using this guide and the arch forum thread guide, but now I want to use my graphics card in (Arch) Linux..

If someone could help me out, that would be great. Thanks

So he is checking in Linux to see if it is enabled?

I'm not sure you can find out without enabling IOMMU in the grub configuration then rebooting and checking by running

 find /sys/kernel/iommu_groups/ -type l

If after running this command you get a output that looks kinda' like this....

/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
/sys/kernel/iommu_groups/2/devices/0000:00:02.0
/sys/kernel/iommu_groups/3/devices/0000:00:16.0
/sys/kernel/iommu_groups/4/devices/0000:00:1a.0

Then IOMMU is loaded and working and verifies that your MB does indeed have all the necessary tables.


The procedure to edit grub is as follows...

"The first thing we need to do on the host is enable the IOMMU. To do this, verify that IOMMU support is enabled in the host BIOS. How to do this will be specific to your hardware/BIOS vendor. If you can't find an option, don't fret, it may be tied to processor virtualization support.

Next we need to modify the kernel commandline to allow the kernel to enable IOMMU support. This will be similar between distributions, but not identical.

On Fedora we need to edit /etc/sysconfig/grub. Find the GRUB_CMDLINE_LINUX line and within the quotes add either intel_iommu=on or amd_iommu=on, depending on whether your platform is Intel or AMD. You may also want to add the option iommu=pt, which sets the IOMMU into passthrough mode for host devices. This reduces the overhead of the IOMMU for host owned devices, but also removes any protection the IOMMU may have provided again errant DMA from devices. If you weren't using the IOMMU before, there's nothing lost. Regardless of passthrough mode, the IOMMU will provide the same degree of isolation for assigned devices.

Save the system grub configuration file and use your distribution provided update scrips to apply this configuration to the boot-time grub config file. On Fedora, the command is:"

 grub2-mkconfig -o /etc/grub2.cfg

Reboot and run the find /sys/kernel/iommu_groups/ -type l command if you get IOMMU groups returned then it's good to go.


I cut and pasted this info from http://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-3-host.html

I'm at work so don't have access to my Linux box to run the command you posted to tell you the output....but if the seller does what I posted above and gets the IOMMU groups output then it's a go on the MB.

So I'm at home now and ran the command you posted.

dmesg|grep -e DMAR -r IOMMU:.....the output I get is this.

grep: IOMMU: No such file or directory

But if I run....find /sys/kernel/iommu_groups/ -type l

My output is this.....

/sys/kernel/iommu_groups/1/devices/0000:00:02.0
/sys/kernel/iommu_groups/2/devices/0000:00:09.0
/sys/kernel/iommu_groups/3/devices/0000:00:0a.0
/sys/kernel/iommu_groups/4/devices/0000:00:0b.0
/sys/kernel/iommu_groups/5/devices/0000:00:0d.0
/sys/kernel/iommu_groups/6/devices/0000:00:11.0
/sys/kernel/iommu_groups/7/devices/0000:00:12.0
/sys/kernel/iommu_groups/7/devices/0000:00:12.2
/sys/kernel/iommu_groups/8/devices/0000:00:13.0
/sys/kernel/iommu_groups/8/devices/0000:00:13.2
/sys/kernel/iommu_groups/9/devices/0000:00:14.0
/sys/kernel/iommu_groups/10/devices/0000:00:14.1
/sys/kernel/iommu_groups/11/devices/0000:00:14.2
/sys/kernel/iommu_groups/12/devices/0000:00:14.3
/sys/kernel/iommu_groups/13/devices/0000:00:14.4
/sys/kernel/iommu_groups/14/devices/0000:00:14.5
/sys/kernel/iommu_groups/15/devices/0000:00:15.0
/sys/kernel/iommu_groups/15/devices/0000:07:00.0
/sys/kernel/iommu_groups/16/devices/0000:00:16.0
/sys/kernel/iommu_groups/16/devices/0000:00:16.2
/sys/kernel/iommu_groups/17/devices/0000:01:00.0
/sys/kernel/iommu_groups/17/devices/0000:01:00.1
/sys/kernel/iommu_groups/18/devices/0000:02:00.0
/sys/kernel/iommu_groups/19/devices/0000:03:00.0
/sys/kernel/iommu_groups/20/devices/0000:04:00.0
/sys/kernel/iommu_groups/20/devices/0000:04:00.1
/sys/kernel/iommu_groups/21/devices/0000:05:00.0
/sys/kernel/iommu_groups/21/devices/0000:05:00.1

Of course this is on Fedora....

I'm not gonna pretend that most of whats in this post is over my head because it is but I am determined to get it working i have read through the initial post and some of what is posted in the links but i am having trouble getting started i know my x99 system supports VT-d and all and i have 2 gpu's one for linux or more specifically manjaro 15.09 using kernel 4.1 but i dont get where wendel gets the i915 number from to enable iommu i mean i could just be dumb but i cant seem to find an answer but determined to find one

@Wendell

Just one question, will this work on OpenSUSE 13.2 ?

@undergroundop

I think he's talking about disabling the kernel for the intel graphics so the amd card can take over.

Link: Disable intel i915 and nouva nvidia kernel module

It seems from what he said if your using kernel 4.1 or later you can use whatever distro you want but the steps you take to get there may very slightly depending what distro it is and such

Not Wendell but....yes it will work with openSuse 13.2 in fact can be done through the GUI using YaST and never touching the command line. There is a thread here on the Tek that was on the topic.

https://forum.teksyndicate.com/t/gpu-passthrough-with-kvm-have-your-cake-and-eat-it-too/82250

There was originally a companion video that has been removed but lots of good info can be found in the thread.

This link may contain the answers you are searching for....

The problem with the i915 driver (as I understand it) is that it has built in support for legacy VGA which modern computers no longer use, and to use the device in a pass through scenario the support needs to be disabled so the host OS can take control over the driver and hardware which I think is called VGA arbitration, I have to admit it's a little over my head, I do know the kernel has to be patched to make it work and the patch is available here.

@blanger

Nice! I wonder if I can request the video.

@98816532803902107698

Can I has your video?

Not really sure that the video is necessary, if your using Suse 13.2 and have used YaST before, it's not that difficult to figure out, I did a test install of 13.2 months ago to try YaST out you basically just follow any guide that will work but instead of doing your work in the CLI/terminal you do it in YaST it was pretty simple.

This might help you.... http://opensuse-guide.org/yast.php

My question isn't so much the problems with the i915 driver as it is how to I take the kernel parameters that wendel wrote and apply them to my system

Sorry I don't have a clue....maybe @wendell will chime in.

i915.preliminary_hw_support=1
Bassically I wanna know what line I would input on my x99 based system using the 5820k or if I do not need to include this line in my kernel parameters at all

I appreciate the help though I'll keep searching or just wing it and hope I don't screw something up

its ok i figured it out but now im stuck I don't understand how to make a polkit rule for libvert. Whatever sorry I don't have the wikia open cause,my internet went down and I'm typing this on my phone but I went ahead and started it using sudo which should do the same thing but I got to the point where it says enter the command
find /sys/kernel/iommu_groups/ -type l
But I got no output at all I'm why or how to fix that

Did you turn on IOMMU in the grub configure file then reboot? (AMD_IOMMU=ON or Intel_IOMMU=ON)