Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to vfio #487

Open
Maziar123 opened this issue Mar 19, 2022 · 7 comments
Open

Switch to vfio #487

Maziar123 opened this issue Mar 19, 2022 · 7 comments

Comments

@Maziar123
Copy link

Hi

Can help me for use optimus-manger when switch to integrated automatically set gpu driver to vfio ??

seems need when logout stop display manager virsh nodedev-detach
and connect it to vfio .....

any help or experience .... ?

@Askannz
Copy link
Owner

Askannz commented Mar 24, 2022

I assume this is a feature request but you need to be more specific. What exactly doesn't work with VFIO?

@Maziar123
Copy link
Author

Maziar123 commented Mar 25, 2022

@Askannz

Need some manual Job ...

we need exactly ONE mode same as integrated but with name and work "VFIO"

when switch to this mode nvidia gpu set with vfio driver after logout ....

@AP1028
Copy link

AP1028 commented May 15, 2022

@Askannz
Basically, we would like to have a easy method to bind and unbind the dGPU with the vfio-pci driver so that GPU passthrough can be achieved more easily.
It would great if there's a mode that is similar to intergrated mode, but with the nvidia GPU loaded with vfio driver instead of powered off, so that dGPU passthrough can be achieved afterward.
When I want to use a VM with GPU passthrough, I switch the mode to VFIO and start the VM. The dGPU is then used by the VM and the iGPU used by Arch Linux host .
When I turn off the VM, I switch the mode back to hybrid so that I can use both GPU in the host again.

The idea is to perform these steps:

  1. Switch Optimus Manager to Integrated, otherwise modprobe -r nvidia will fail.
  2. Unload NVidia drivers
  3. Detach devices
  4. Load VFIO drivers
    (Reverse the steps when switching back to hybrid)

Here's a guide that contains everything including the scripts that are used to achieve the functionality.
https://github.com/mysteryx93/GPU-Passthrough-with-Optimus-Manager-Guide

I hope this can be directly integrated into optimus-manager as an optional feature so that those who need the functionality can achieve dynamic binding with ease.

@Maziar123
Copy link
Author

@Askannz Basically, we would like to have a easy method to bind and unbind the dGPU with the vfio-pci driver so that GPU passthrough can be achieved more easily. It would great if there's a mode that is similar to intergrated mode, but with the nvidia GPU loaded with vfio driver instead of powered off, so that dGPU passthrough can be achieved afterward. When I want to use a VM with GPU passthrough, I switch the mode to VFIO and start the VM. The dGPU is then used by the VM and the iGPU used by Arch Linux host . When I turn off the VM, I switch the mode back to hybrid so that I can use both GPU in the host again.

The idea is to perform these steps:

1. Switch Optimus Manager to Integrated, otherwise modprobe -r nvidia will fail.

2. Unload NVidia drivers

3. Detach devices

4. Load VFIO drivers
   (Reverse the steps when switching back to hybrid)

Here's a guide that contains everything including the scripts that are used to achieve the functionality. https://github.com/mysteryx93/GPU-Passthrough-with-Optimus-Manager-Guide

I hope this can be directly integrated into optimus-manager as an optional feature so that those who need the functionality can achieve dynamic binding with ease.

note :
after 1. (Switch Optimus Manager to Integrated, ....) you must stop display manager and in end return it !

@awsms
Copy link

awsms commented Sep 18, 2023

big +1 for this, AFAIK only supergfxctl has VFIO support

@Maziar123
Copy link
Author

But I have several problems with supergfxctl. The optimus-manager is more flexible as a base

@awsms
Copy link

awsms commented Sep 22, 2023

But I have several problems with supergfxctl. The optimus-manager is more flexible as a base

I don't use supergfxctl because it doesn't recognize my NVIDIA dGPU. I'm trying to implement vfio on optimus-manager, will see what I end up with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants