You are not logged in.

#1 2017-03-05 13:28:16

mikaelbrun
Member
From: Tistedal/ Norway
Registered: 2016-01-01
Posts: 43

PCI passthrough setup

Since there still is games out there not compatible with linux, I want to try pci passthrough with a virtual machine.
Now I am dualbooting.

I have read some guides, and tried to understand as much as I can, but there is still some holes I need some help with.

One of my biggest concerns is that if I can "disconnect" my chosen passthrough card when entering virtual mode, and reattach it when living the Virtual environment.
And if so, what is the best way to do this. I have read some things about vfio-pci but don't really understand all of it.

Hope my problem is clear, and some of you have some good answers for this.

Offline

#2 2017-03-05 13:38:35

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: PCI passthrough setup

Do you mean that you only have one graphics card that you want to share between both the live and VM environments? If so then I don't believe that this is possible, you need a separate graphics card (or IGPU) for each.

Don't forget that you also need a motherboard, CPU and BIOS/UEFI that all support passthrough.

Last edited by Slithery (2017-03-05 14:22:38)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-03-05 13:47:35

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,147

Re: PCI passthrough setup

There have been some people that had limited success with dynamically binding / unbinding  one videocard , but linux graphics stack is not really ready for it.

If you want to try, make sure your host is accessible remotely AND you have a second system available.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2017-03-05 14:05:12

mikaelbrun
Member
From: Tistedal/ Norway
Registered: 2016-01-01
Posts: 43

Re: PCI passthrough setup

If I have to set one system for gaming in virtual machine, and one for gaming in linux, then I don't see the point.
I have two graphics cards, and planned for my best card to be used as pci passthrough in VM and the same card in Arch when gaming there. Ofcourse with out having to reboot between those two.

If I have to reboot everytime I want to change, then I can keep my dualbooting.

Offline

#5 2017-03-05 14:52:31

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,147

Re: PCI passthrough setup

I have two graphics cards, and planned for my best card to be used as pci passthrough in VM and the same card in Arch when gaming there. Ofcourse with out having to reboot between those two.

Switching one card between host and guest is what i meant by dynamically bunding/unbinding one videocard.

You'll have to use scripts to do the switching and it will be a very experimental setup .
I mentioned needing remote / ssh access and a second system available to make sure you could still access the main system.

If the switching videocards between host and guests fails, you may end up with  a system that just shows a black screen.

------------------------------------------
If you want reliable on-the-fly switching of graphics cards, you should not look into archlinux with pci passthrough .

Hypervisors like Xen and vmware ESX also have pci passthrough support.
Their code runs closer to the bare metal and can switch pci express cards a lot better.

If you go this way, linux and windows would be running as hypervisor guest machines.

TL;DR :
neither windows nor linux are for time being reliable enough to do this in a host/guest setup.
use a dedicated hypervisor as host instead, making linux & windows hypervisor gests.

Last edited by Lone_Wolf (2017-03-05 14:53:21)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2017-03-05 16:23:00

mikaelbrun
Member
From: Tistedal/ Norway
Registered: 2016-01-01
Posts: 43

Re: PCI passthrough setup

Lone_Wolf wrote:

You'll have to use scripts to do the switching and it will be a very experimental setup .

I often feel gaming on linux in general is expermintal.

I will look into the Xen and vmware ESX before I decide what to do. Since installing Windows takes ages, I want to make sure it will work :-).
If my Arch gets wacked, the installation time isn't that enoying, and backup is ofcourse mandatory.

Offline

#7 2017-03-05 19:48:10

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: PCI passthrough setup

mikaelbrun wrote:

I have two graphics cards, and planned for my best card to be used as pci passthrough in VM and the same card in Arch when gaming there. Ofcourse with out having to reboot between those two.

This should be doable, with the caveat that any desktop session and application which uses the better GPU on Linux will need to be closed before passing the GPU to Windows VM and then the VM will need to be closed before using the GPU on Linux.

If you don't want to close Linux desktop to start Windows (which isn't much more convenient than rebooting I guess), you can setup the weaker card as the primary display in BIOS and use it for the Linux desktop and all applications you want to preserve while running Windows on the better GPU.

Now the only remaining question is how to make use the better GPU on Linux when Windows isn't running. The simplest way is to temporarily start a second desktop session (or at least an X-server) on the better GPU and connect it to the keyboard and mouse of the primary desktop session with something like x2x or synergy.

A more convenient solution would be using something like bumblebee or PRIME to offload rendering of selected applications to the better GPU when it is available but still have this applications running in the primary desktop session and displayed on the primary (weak) GPU with the rest. Quick googling shows that recently somebody even got such setup to work but this looks like new experimental feature tested by maybe five people in the whole world so far so getting it to work may be interesting wink

As for Xen and VMware, I'm not sure what benefit they would bring. The hard part is dynamically adding/removing GPUs to the Linux graphics stack and throwing some hypervisor into the mix doesn't solve it unless the HV can virtualize the GPU for both systems at once. I'm pretty confident that some solutions of this kind are available, but I'm not sure if they have good enough performance for gaming. And, obviously, this isn't PCI passthrough anymore.

Last edited by mich41 (2017-03-05 20:10:55)

Offline

Board footer

Powered by FluxBB