T-vK / MobilePassThrough

Make GPU passthrough on notebooks easy and accessible!
170 stars 19 forks source link
automated check compatibility dgpu gpu igpu mediated passthrough script vm

MobilePassThrough

Introduction

The goal of this project is to make GPU passthrough on x64 notebooks/tablets as easy and accessible as possible.
To achieve that goal I have written a collection of scripts accessible via mbpt.sh

MBPT vs MBPT Live

Either way it is 100% automated, no user interaction required:

On the host system (Linux):

In the virtual machine (Windows)

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

Screenshot of the compatibility check (./mbpt.sh check)

example output

Currently supported distributions

Limitations

Measures taken agains error 43

How to use?

BIOS/UEFI configuration

Installation and configuration

How to use mbpt.sh

$ ./mbpt.sh help
mbpt.sh COMMAND [ARG...]
mbpt.sh [ -h | --help ]

mbpt.sh is a wrapper script for a collection of tools that help with GPU passthrough on mobile devices like notebooks and convertibles.

Options:
  -h, --help       Print usage

Commands:
    auto         Automatically run check, setup and install
    configure    Interactively guides you through the creation of your config file
    check        Check if and to what degree your notebook is capable of running a GPU passthrough setup
    setup        Install required dependencies and set required kernel parameters
    install      Create and install the VM
    start        Start the VM
    live         Create / Flash a Live ISO image of this project
    vbios        Dump the vBIOS ROM from the running system or extract it from a BIOS update

Examples:
    # Install required dependencies and set required kernel parameters
    mbpt.sh setup

    # Check if and to what degree your notebook is capable of running a GPU passthrough setup
    mbpt.sh check

    # Interactively guides you through the creation of your config file
    mbpt.sh configure

    # Generate a helper iso file that contains required drivers and a helper-script for your Windows VM
    mbpt.sh iso

    # Create the VM and install Windows in it (Will overwrite an older instance if one exists!)
    mbpt.sh install

    # Start the VM
    mbpt.sh start

    # Create a Live ISO
    mbpt.sh live buid

    # Flash a Live ISO to the USB drive /dev/sdx
    mbpt.sh live flash /dev/sdx

    # Print the qemu command that would have been used to start the VM
    mbpt.sh start dry-run

    # Print the qemu command that would have been used to install the VM
    mbpt.sh install dry-run

    # Print the libvirt XML that would have been used to start the VM
    mbpt.sh start get-xml

    # Print the libvirt XML that would have been used to install the VM
    mbpt.sh install get-xml

    # Dump the vBIOS ROM of the GPU with the PCI address 01:00.0 to ./my-vbios.rom (This will most likely fail)
    mbpt.sh vbios dump 01:00.0 ./my-vbios.rom

    # Extract all the vBIOS ROMs of a given BIOS update to the directory ./my-roms
    mbpt.sh vbios extract /path/to/my-bios-update.exe ./my-roms

Hardware requirements to get GPU-passthrough to work on mobile

Potentially useful hardware tools

USB Programmer for BIOS/UEFI flashing or unbricking EDID Dummy Plugs for HDMI and Mini DisplayPort can be used to make your dGPU write to the framebuffer so that you can use Looking Glass. (Your dGPU needs to be connected to your external HDMI or Display Port for that to work though... This may be possible with some UEFI/BIOS modding.)

List of devices tested for GPU-passthrough compatibility

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

UEFI / BIOS modding

By modding your BIOS/UEFI, you can make features available and change settings that are hidden or non-existent by default. For example: show VT-d settings, show secure boot settings, show muxing related settings and much more. There is a good collection of modding tools on this site here in the BIOS / UEFI tools section.
There are many BIOS modding forums out there with lots of people who are more than willing to help even if you're a complete beginner.

Credits

Credits to Wendell from Level1Techs for his GPU passthrough 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!!

Credits to korewaChino for adding support for Ubuntu!

Credits to Cole Robinson for giving me a lot of incredibly valuable hard to find information on virt-install!

TODO

High prio

Low prio