You are not logged in.

#1 2018-12-09 13:19:53

slole
Member
Registered: 2018-11-26
Posts: 14

Multigpu switching without reboot

The goal:
Dynamically switch wich gpu is being used by the X server to be able to use my gtx 1060 on both vm and host without reboot (very much like: https://arseniyshestakov.com/2016/03/31 … x-restart/).

My hardware:
    - gtx 1060
    - gtx 750
    - radeon hd 7750
    - ryzen 5 2600x

My previous solution:
I just used the hd 7750 for the host and gtx 1060 was always bound to the vfio_pci driver.

Other notes:
    - I use lightdm and i3-gaps
    - I use the proprietary nvidia drivers for my gtx 1060
    - I am running a nearly fresh installation of arch

q1: Where should I start?
q2: Is it even feasable?
q3: Is this even the right place to ask this?

Thank you for all your responses in advance.

EDIT: fixed link

Last edited by slole (2018-12-10 18:52:33)

Offline

#2 2018-12-10 08:45:44

rokups
Member
Registered: 2017-02-14
Posts: 3

Re: Multigpu switching without reboot

You can not yank GPU from under X without restarting it. That link is dead, but i assume it is talking about using some weak GPU for desktop (like intel) + using PRIME to dedicate some applications to AMD gpu. Your good gpu is nvidia so that will not be possible as nvidia driver does not support PRIME fully.

Anyhow to migrate GPU between VM/host you have to bind pci device to appropriate driver. "vfio-pci" for VM and "nvidia" for host. I have a handy script: https://gist.github.com/rokups/8f04e8a3 … 79e72a4896
Call it like "flipdriver nvidia 05:00.0".

Offline

#3 2018-12-10 09:03:47

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Multigpu switching without reboot

rokups wrote:

That link is dead

There was just a paranthesis at the end. Without that, you can open the link. https://arseniyshestakov.com/2016/03/31 … x-restart/


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2018-12-10 11:36:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Multigpu switching without reboot

TLDR: If you use FOSS drivers with DRI3 you now can do this:

nvidia proprietary driver doesn't support this, nouveau driver does (but performance will likely be bad)


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


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2018-12-10 18:53:22

slole
Member
Registered: 2018-11-26
Posts: 14

Re: Multigpu switching without reboot

rokups wrote:

Anyhow to migrate GPU between VM/host you have to bind pci device to appropriate driver. "vfio-pci" for VM and "nvidia" for host. I have a handy script: https://gist.github.com/rokups/8f04e8a3 … 79e72a4896
Call it like "flipdriver nvidia 05:00.0".

Thanks for the script.

Offline

#6 2018-12-10 18:54:54

slole
Member
Registered: 2018-11-26
Posts: 14

Re: Multigpu switching without reboot

Lone_Wolf wrote:

TLDR: If you use FOSS drivers with DRI3 you now can do this:

nvidia proprietary driver doesn't support this, nouveau driver does (but performance will likely be bad)

Yeah... I noticed that note, I was just wondering if there is a workaround.

Offline

Board footer

Powered by FluxBB