Play games in Windows on Linux! PCI passthrough quick guide

Not really sure, you can in theory install drivers for anything, but that doesn't mean the device will actually work and it will be found. If you have a "pci device" and "multimedia audio device" then you are passing both the gpu and the audio controller on it, that should be fine.

What are you using to hold the gpu from being loaded on linux? vfio, pci-stub? What kernel version is your debian on? You do passthrough both your graphics controller and audio controller on it right?

On Nvidia there was this extra step for spoofing some id, because otherwise the card detects that it is being loaded in a VM and doesn't load. I'm not sure how this works, because I have an AMD card and I don't have to do this.

errorcode 43 was device no longer recognized/not found iirc

Try installing synergy as a server on Windows with linux being a client of that server, I'm not sure where I read that, but it's supposedly the better setup as well, if it also solves your graphics problem good then!

Thank you! I think im getting everything work now, I have one last problem, is there any ways to remove/add devices afterwards from/to vm? I would like to change my mouse to other but cant find anything from virtual machine GUI.

EDIT: got that working too :D

Nice, glad you sorted it out

Hmm, sorry for spamming this thread but i cant get my audio working :( I have done the pulseaudio configs explained in the tutorial, but when i edit client.conf and add default-server 127.0.0.1 i cant hear sounds from debian. Aand also the sounds from windows quest arent working. Whit or whithout pulse configurations..

EDIT: so i worked this out by using ac97 and alsa mode :)

well, @SgtAwesomesauce helped me how to fix it, also he made really good posts about passthrou

Hey all, I was going through the process of attempting to passthrough my RX480 on my Fedora 25 install running the latest kernel and patches. I have a 7700k on a Aorus Gaming 5 mobo and have enabled IOMMU and turned it on in Fedora with intel_iommu=on. The problem I am having now, is after I stub the RX480 I can't boot, All I get is a black screen with a scrambled frame Screenshot of the screen as you can see in the linked image. I've installed the Intel drivers before I stubbed the RX480. Has anyone else ran across this issue? I have also tried to boot to init 3 only to get the same screen. The rig is completely unresponsive. Any help would be appreciated.

Cheers!

Have you moved your monitor outputs to the motherboard and changed your default video device in the UEFI?

Thanks for the reply, yes, I changed the primary display over to the iGPU and unhooked the monitors from the discrete card and plugged them into the iGPU ports on the mobo. After digging into to late last night undid everything and went back through dmesg and I did find some errors:

[   20.225344] DMAR: DRHD: handling fault status reg 3
[   20.225351] DMAR: [DMA Read] Request device [00:02.0] fault addr 70002000 [fault reason 05]   PTE Write access is not set
[   20.225865] [drm] GPU HANG: ecode 9:0:0xe6ccd35a, reason: Hang on render ring, action: reset
[   20.225870] [drm] GPU crash dump saved to /sys/class/drm/card1/error
[   20.225928] drm/i915: Resetting chip after gpu hang
[   20.226369] [drm] RC6 on
[   20.243177] [drm] GuC firmware load skipped

They only appears when iommu is turned on, so I believe there may something buggy with the UEFI of this board (Aorus Gaming 5 z270) . I submitted a bug over to freedesktop.org to see if its something that can be fixed on the OS side or wait for a UEFI fix from Gigabyte. I'm not sure if there is a work around other than dropping another discrete card in and using that one for Fedora. Thoughts?

Edit: Grammar...

@GrayBoltWolf Have you seen any occurrences where even after removing all the displays the display only appears on the console and not on the monitor hooked to the passed through GPU?

Still interesting for me! Would be nice if you can answer this

The hardware inside the KVM will appear different based on what resources you give the KVM, case in point: on my system my host CPU is a AMD 8370 (8 core) of which I give 6 cores to the Windows KVM, Windows sees this CPU as a AMD 6300 series (6 core) because that's all of the resources I'm giving it, same with the MB, most of the resources stay with the host system but I do pass a USB controller, a NIC, and a few other devices to the KVM physically instead of providing them virtually....as far as I can tell Win 10 has no clue running in a KVM what MB I'm using.

But....if you have used your Windows key on your host hardware, then install Linux and install Windows in the KVM Windows will in most cases see that as a new install and require a new key....

Hope that helps.

1 Like

If you see a console in the virt-manager window then you haven't removed all the display devices.

I removed that as well and still no output to the video card, are there any screenshots I can supply to get you a better idea of what I am looking at?

Does any thing need to be done to improve CPU allocation to the VM or does it just work? I'm looking to create a virtualized windows environment for gaming while enjoying the security and relative privacy Linux provides as the host OS.

A screenshot of the screen where you add and remove devices would be helpful.

Take a look at this thread. Just use the amount of cores and threads that your host has and it will be fine.

What CPU do you have?

Thank you. actually i haven't made a system yet, but am researching virtualizing windows over Linux because I want to get away from windows and its telemetry. I am trying to figure out what is the best way to go about getting hardware that will give a great gaming experience in the windows VM.

Here you go

Lots of cores, lots of RAM, an AMD graphics card for your VM, two monitors, another pair of keyboard and mouse :slight_smile:

I'm currently using kernel 4.10, but i'm not sure if the ACS patch is required for my iommu groupings.

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GP104 High Definition Audio Controller [10de:10f0] (rev a1)
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 760] [10de:1187] (rev a1)
02:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)

/sys/kernel/iommu_groups/1/devices/0000:00:01.1
/sys/kernel/iommu_groups/1/devices/0000:02:00.1
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:02:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.0