Skip to content
Make GPU pass-through on notebooks easy and accessible!
Branch: master
Clone or download
Latest commit 9b2b51f Mar 9, 2019

README.md

MobilePassThrough

Introduction

The goal of this project is to make GPU pass-through on notebooks as easy and accessible as possible.
To achieve that goal I have created a collection of scripts that automate:

  • The installation of required dependencies
  • The changes required to the kernel parameters
  • The installation of Bumblebee and the Nvidia GPU driver
  • The checking required to find out to what extend your device is compatible with GPU pass-through.
  • The extraction of your GPU's VBIOS ROM
  • The creation and configuration of a virtual machine that is fully configured for GPU pass-through.
  • The required rebinding of the GPU to either the vfio drivers (when the VM starts) or the nvidia drivers (when the VM exits).

Limitations

  • The project is currently only compatible to Fedora 29 out of the box.
  • Your device needs to have an Intel CPU and an Nvidia GPU. (The compatibility-check script should work on any hardware. The other scripts would need some adjustment though.)
  • Expect bugs. I have only tested this on a handful of devices and I have constantly changed the scripts without testing everything every time.
  • VBIOS ROM extraction will likely fail because the nvidia kernel module is loaded. (You may not need the VBIOS ROM though.)
  • There is no scripted way to get rid of Error 43, which you might see in the Windows device manager when you pass a mobile GPU through to a Windows VM.

Screenshot of the compatibility-check script

example output

Usage

  • On the computer you want to check you first have to go to the UEFI and enable virtualization. On AMD CPU systems: AMD-V and IOMMU. And on Intel CPU systems: VT-x and VT-d. (Beware: Some motherboard vendors get pretty creative when it comes to giving these options other names.)
  • You should enable the internal GPU of the CPU so that you have two (one for the host one for the guest system) (some vendors actually disable the CPU internal GPU completely and don't offer UEFI options to enable it)
  • You might also have to disable secure boot in the UEFI.
  • It might also be necessary to disable fastboot in the UEFI.
  • Next you need to install Fedora 29.
  • Download this project and run the setup.sh script:
# Run this in a terminal
sudo dnf install git -y
git clone https://github.com/T-vK/MobilePassThrough.git
cd MobilePassThrough
sudo ./setup.sh
  • Reboot.
  • Run the compatibility-check.sh found in the MobilePassThrough folder that was created when you executed the git command.
  • Change the options at the top of the start-vm.sh script to your liking. (Make sure the path to to your windows iso is correct. ) (If you don't have a VBIOS ROM, don't use the GPU_ROM option.)
  • Run the start-vm.sh script. (The first time you run it, it will create the VM for you and start it, the next time ti will simply start the existing VM.

Requirements to get GPU-passthrough to work on mobile

  • Device needs to be (mostly) compatible with Linux.
    Note: most Laptops should be these days

  • At least two GPUs (typically Intel's iGPU and an Nvidia GPU)
    Note: If you have Thunderbolt 3, you might be able to use an eGPU. See: https://egpu.io
    Note2: Theoretically it's possible to get this to work with only one GPU, but then you wouldn't be able to use your host system directly while running the VM, not the mention like 50 other issues you'll run into.

  • CPU needs to support Intel VT-x / AMD-V
    Note: Unless your notebook is like 10 years old, the CPU should support this.
    Note2: If it supports Intel VT-d / AMD's IOMMU it should automatically also support Intel VT-x / AMD-V.

  • Chipset to support Intel VT-x / AMD-V
    Note: Unless your notebook is like 10 years old, it should support this.
    Note2: If it supports Intel VT-d / AMD's IOMMU it should automatically also support Intel VT-x / AMD-V.

  • BIOS/UEFI option to enable Intel VT-x / AMD-V must exist or it has to be enabled
    Note: Unless your notebook is like 10 years old, it should support this.
    Note2: If it supports Intel VT-d / AMD's IOMMU it should automatically also support Intel VT-x / AMD-V.
    Possible workaround: Modding your BIOS/UEFI using tools like UEFITool, AMI Aptio MMTool etc.

  • CPU needs to support Intel VT-d / AMD's IOMMU
    Note: If you have an Intel CPU, you can check if it's in this list.

  • Chipset to support Intel VT-d / AMD's IOMMU
    Note: If your CPU/chipset is from Intel, you search it in this list to check it it supports VT-d.

  • BIOS/UEFI needs to support Intel VT-d / AMD's IOMMU
    Possible workaround: Modding your BIOS/UEFI using tools like UEFITool, AMI Aptio MMTool etc.

  • When using an iGPU + dGPU setup, the iGPU needs to be enabled or the BIOS/UEFI needs to have an option to do so.
    Possible workaround: Modding your BIOS/UEFI using tools like UEFITool, AMI Aptio MMTool etc.

  • The GPU you want to pass through, has to be in an IOMMU group that doesn't have other devices in it that the host system needs.
    Possible workaround: You might be able to tear the groups further apart using the ACS override patch, but it's no magic cure, there are drawbacks.

  • When using an Nvidia dGPU for the passthrough, you'll most likely have to patch your GPU VBIOS ROM using NVIDIA-vBIOS-VFIO-Patcher or the OvmfPkg using arne-claey's OvmfPkg patch or path the Nvidia driver using nvidia-kvm-patcher.
    Note: Loading modded VBIOS ROMS should be pretty safe as the ROM gets deleted after every GPU shutdown anyway.
    Note2: The nvidia-kvm-patcher is pretty buggy and very outdated and you'll most likely not get it to work especially with recent drivers. I haven't had any success with any driver so far.
    Note3: I haven't been able to get arne-claey's OvmfPkg patch to build on my Fedora machine so far.
    Note4: I haven't been able to get NVIDIA-vBIOS-VFIO-Patcher either yet.

The last point really seems to be the biggest hurdle, but since it's just a software issue, it should be possible to get this to work.
We just need some smart people to fix one of these patches or to make them more accessable.

In order to force your GPU to create a frame buffer while not having an external monitor hooked up, you can get fairly cheap EDID Dummy Plugs for HDMI and Mini DisplayPort. You need that frame buffer in order to use Looking Glass. (This plug might not be required on all systems though.)

GPU-passthrough Device Compatibility List

Check out: https://gpu-passthrough.com/

Credits

Credits to Wendell from Level1Techs for his GPU pass-through guides/videos and Misairu-G for his Optimus laptop dGPU passthrough guide. Without them I would have never even thought about creating this project. Thank you so much!!

You can’t perform that action at this time.