[How to] Set up GPU passthrough on notebooks with one click (or two)

I’ve been working on getting GPU passthrough to work on notebooks for quite some time and have created a set of scripts that automate the process to make it easy and accessible. I released everything on GitHub: https://github.com/T-vK/MobilePassThrough

This is what the scripts can do for you:

On the host system (Linux):

  • Automatically install the required dependencies
  • Automatically configure the kernel parameters to support GPU passthrough
  • Automatically install Bumblebee and the Nvidia GPU driver
  • Automatically check if and to what extend your device is compatible with GPU passthrough.
  • Automatically create and configure a virtual machine that is fully configured for GPU passthrough.
  • Automatically download the Windows 10 installation iso from Microsoft.
  • Automatically compile/set up LookingGlass

In the virtual machine (Windows):

  • Automatically install the required drivers (ivshmem and other vfio drivers)
  • Automatically compile/install/start LookingGlass
  • Automatically configure the network
  • Automatically set up RDP
  • Automatically install and autostart LookingGlass

And there is also a lot of less obvious advanced stuff that I managed to fully automate, like:

  • Automatically rebinding the dGPU to the vfio drivers (when the VM starts)
  • Automatically rebinding the dGPU to the nvidia drivers (when the VM exits)
  • Automatically creating a vGPU from the iGPU (when the VM starts) to allow sharing the iGPU with the VM (aka “mediated iGPU passthough” using GVT-g) (So your VM can safe a ton of battery life when it doesn’t need the dGPU.)
  • Automatically remove the vGPU (when the VM exits)
  • And there is a nice configuration file and a script that creates it for you, guiding you through every option

Here’s a screenshot showing the compatibility-check script in action:

On https://gpu-passthrough.com/ I’ve published a list of devices I tested with detail on how far you can get with GPU pass-through on these devices. I’ll update the list when have more time to test further devices or when someone else tested a device and provides me with the data.

Anyway, just wanted to let you know about the project. Maybe you have a notebook that you’d like to try this out on.

13 Likes

Nice work, good job, you are an mvp

2 Likes

Bloody nice, too bad I got rid of my gaming laptop, would’ve been sweet to test :persevere:

Well, I have to thank you. If it wasn’t for you raising awareness on GPU passthrough, I probably wouldn’t even know that it is possible.

1 Like

Blast from the past when a whole new world opened up, this whole thing has evolved nicely :grin:

Anyone think this could run live off a usb stick? I am aware that the speed would suck, but I’m thinking of usb booting all the gaming laptops on display at my local store to get some “try before you buy” time. Then purchase. I don’t need cutting edge graphics and would let me buy a more reasonably priced laptop. It’s this or the external usb-c lightning setup.

I’ve done custom squash-fs debian live. Wondering how much of a pain it would be to do this to Fedora’s live bootable medium.

Yes this is possible and I have done it. You have to install Fedora 29 on a USB stick and then you can run the scripts. So what I mean is you create a Fedora installation stick and then use that to actually install Fedora onto another USB stick.

Doing this from a bare live CD/stick is not possible at the moment. I have looked into it though and there is a way I could create a custom live image that could do the job. It is a lot of work though and I have very little experience with it. Last time I played with it I was really annoyed by how long the build process takes.

Edit:
And keep in mind that for the first time you run the setup script from the MobilePassThrough project, you need an Internet connection to download the required packages. You should only need to do this once though and then you can test the other notebooks without an Internet connection.

Edit2:
If you found a notebook that works with an external GPU, don’t forget to also report it to https://egpu.io .

Big update! I added lots of new features. For example (mediated) iGPU passthrough, so that you can use the iGPU on the host and guest at the same time and so that you can always safe battery life either through Bumblebee (Linux) or through Optimus (Windows). And you can use dma-buf now. The Windows 10 image can be downloaded automatically from Microsoft if you don’t have one yet. And I also managed to automate things inside of the VM now (installing required drivers, enable RDP, installing LookingGlass set up networking, …)
I also made things a lot easier to customize/configure (there is a simple config file now) and very beginner-friendly (there is an interactive script that creates the config file for you guiding you through all the options).

In addition to that I fixed a few bugs and updated the README with (hopefully) very beginner-friendly instructions on how to set everything up.

And before I forget, the list of compatible notebooks has been growing.

6 Likes

very cool man

this is the best type of thread revival

1 Like

I see GS63 7RF compatibility…

Any chance my 6RF will work?

You are probably talking about the MSI GS63VR 7RF REV:1.0 from the list?
It was tested by dreamcast96 (who’s now called ghost) and although it worked, he didn’t get past the infamous error 43, which means he couldn’t make actual use of the Nvidia GPU within the VM. He did however get it work work with a Linux VM.

To answer you question: I would expect the 6RF to have similar if not identical results.
The only 10xx mobile GPU that, to my knowledge, has been passed through successfully so far is the 1050Ti.

1 Like

Is there a way around error 43 or is iommu that much of a paxn in the dick to work with.

There are many ways around error 43. But not all workarounds work on all devices.
I have taken a couple of measures to prevent error 43 with the scripts in this project and I’m planning to add even more.

Maybe it has been some time, but I want to ask. With this setup, can I continue to use my Nvidia dGPU after I close my VM? Because I have some games that I want to run over Linux too.

Yes, when the VM exits, the script should automatically unbind your nvidia GPU from the vfio drivers and bind it to the nvidia drivers making it accessible on the Linux host again.

I haven’t updated the scripts in a while though.
I’m currently planning on adding support for Intel+AMD notebooks. When I do that I’ll to try update the scripts to properly support the latest version of Fedora.

2 Likes