Git Product home page Git Product logo

mobilepassthrough's Introduction

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

  • You can either flash the MBPT Live ISO to a USB device and boot it to try it out without actually messing with your system. (Download here or run ./mbpt.sh live build to build it yourself.)
  • Or you can let ./mbpt.sh auto set everything up on your exisitng Linux installation.

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

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 if required (I removed this feature because it was too error-prone. Instead we'll just use nouveau or whatever is installed already.)
  • 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
  • Automatically build an ACPI fake battery (to circumvent Nvidia's Error 43)
  • Automatically patch OVMF with your vBIOS ROM (to circumvent Nvidia's Error 43)

In the virtual machine (Windows)

  • Automatically install the required drivers (ivshmem, other vfio drivers, Intel/Nvidia display 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 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/amd drivers (when the VM exits)
  • Automatically creating a vGPU from the (Intel) 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.)

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

example output

Currently supported distributions

  • Fedora 34
  • Ubuntu 21.04 (Currently not working. Some dependencies won't be installed automatically.)

Limitations

  • The project is currently only really being tested on Fedora and Ubuntu (currently broken). But it has been written in a somewhat distribution-agnostic way, meaning it might just work on other distributions and if not, you might just have to add a new script to scripts/utils/manager-specific/. (For example the project currently supports the package managers dnf and apt, if your distro uses pacman, you have to add a pacman script that can be called the same way as the apt script.)
  • This project currently only supports Windows 10 x64 VMs and hopefully Windows 11 x64 VMs at some point. (For older Windows versions you have to figure out the driver installation etc. on your own.)
  • Only tested for Intel+Nvidia and Intel+AMD systems. (Although the compatibility-check (./mbpt.sh check) should actually work on any hardware.)
  • Expect bugs. I have only tested this on a handful of devices and I have constantly changed the scripts without testing everything every time.
  • Automated vBIOS ROM extraction will fail in most cases. You might have to extract it from a BIOS update. (You may not need the vBIOS ROM though.)
  • This project takes a couple of measures to circumvent Nvidia's infamous Error 43, which you normally see in the Windows device manager when you pass a mobile Nvidia GPU through to a Windows VM. But even with these measures, some systems will still show Error 43.
  • Some AMD GPUs will give you an Error 43 as well (e.g. Radeon RX Vega M GL). I have no idea how to circumvent that one yet.

Measures taken agains error 43

  • Hide that the VM is a VM
  • Change the vendor ID
  • Provide the VM with a fake battery
  • Provide the VM with the vBios ROMs
  • Patch OVMF, hardcoding your dGPU vBIOS ROM in it
  • Installing the latest Nvidia driver
  • (Another measure you can take yourself is installing a recent Nvidia driver in your VM. See this)
  • Other projects that may help, but are very outdated and currently don't work: NVIDIA-vBIOS-VFIO-Patcher, nvidia-kvm-patcher.

How to use?

BIOS/UEFI configuration

  • Enable Intel VT-x / AMD-V as well as Intel VT-d / AMD's IOMMU in the BIOS / UEFI.
  • On some (gaming) notebooks the integrated graphics of the CPU are disabled. If that is the case for you, you need to enable them in the BIOS/UEFI. (Some vendors actually disable the CPU integrated GPU completely and don't offer UEFI options to enable it. Modding your BIOS could potentially fix that. See the "UEFI / BIOS modding" for more information on that.)
  • You might also have to disable secure boot in the UEFI. (Mainly to use Nvida's proprietary driver on Linux while your VM is not running.)
  • It might also be necessary to disable fastboot in the UEFI.
  • It is highly recommended to have your Linux installed/booted in UEFI mode (rather than in legacy mode).
  • If your drive doesn't show up during the installation in UEFI mode, make sure the SATA mode is set to AHCI in the UEFI, even if you don't use SATA.

Installation and configuration

  • Open a terminal and install git and MobilePassThrough by typing the following, pressing enter after each line:
    sudo dnf install git -y # Install git
    git clone https://github.com/T-vK/MobilePassThrough.git # Clone the project
    cd MobilePassThrough # Enter the project directory
    ./mbpt.sh configure # Create a custom config file interactively (optional)
    ./mbpt.sh auto # Dependency installation; kernel param config; bumblebee / nvidia driver installation; windows ISO download; reboot to load new kernel params; create a helper iso with drivers and autounattended config for Windows; create and start VM; install Windows in the VM fully unattended; install drivers and looking glass in the VM automatically; check for error 43 automatically and show a warning if it occurs
  • Once the installation finished you should be able to open Remmina and connect to rdp://192.168.99.2
  • Then in the second terminal run:
    cd MobilePassThrough # Enter the project directory
    cd ./thirdparty/LookingGlass/client/build/ # Enter the directoy containing the looking glass client executable
    ./looking-glass-client # Run the looking glass client
  • From now on, start the VM with ./mbpt.sh start

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

  • 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 to mention the 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, AMIBCP etc. (See "UEFI / BIOS modding" below)

  • 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 if 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, AMIBCP etc. (See "UEFI / BIOS modding" below)

  • 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, AMIBCP etc. (See "UEFI / BIOS modding" below)

  • 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.

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

  • Fix for Ubuntu (Fix file dependency installation)
  • Document all the new features
  • Create a first Beta release
  • Test with an Nvidia notebook
  • Fix automatic Nvidia driver installation in the VM (fix chocolatey)
  • Fix RDP
  • Fix Samba sharing
  • Add virt-install version check because 2.2.1 doesn't seem to support the --xml flag
  • Get rid of the --no-check-certificate workaround for the win iso download
  • Install remix logo package inside of ISO
  • Disable autostart of install promt when booting Live ISO
  • Add pre-built Live ISO to the GitHub releases
  • Move to Fedora 35

Low prio

  • Add nouveau driver compatibility
  • Allow the user to decide if he wants bumblebee or not (for Nvidia GPUs)
  • More detailed output about how the device is muxed
  • Test service auto reboot
  • Create packages (deb, rpm, etc)
  • Add compatibility for Arch, Debian, Pop OS etc...
  • Make this project work better on systems that already have a non-default GPU driver installed
  • Make it easy to uninstall the dependencies and undo the changes to the systm config (like kernel parameters)
  • Find a way to circumvent Error 43 for AMD GPUs like the Radeon RX Vega M GL
  • Reduce the size of the ovmf-vbios-patch Docker image or build it completely outside of docker
  • Make the USB passthrough device selection easier (i.e. display a list of devices that can be selected)
  • Look into hotplugging and check if the GPU can be hotplugged during VM runtime
  • Check if required dependencies are installed for each script
  • Add support for multiple VMs
  • Add support for Linux guests
  • Add support for Desktop PCs

mobilepassthrough's People

Contributors

benjipugh avatar korewachino avatar t-vk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobilepassthrough's Issues

Will this work?

Computer:
MSI-GS70

[Warning] VT-X / AMD-V virtualization is not enabled in the UEFI! This is required to run virtual machines!
[OK] VT-D / IOMMU is enabled in the UEFI.
[OK] The IOMMU kernel parameters are set.
[Success] GPU with ID '01:00.0' could be passed through to a virtual machine!
[Error] Failed to find the IOMMU group of the GPU with the ID 00:02.0! Have you enabled iommu in the UEFI and kernel?
[Success] There are 1 GPU(s) in this system that could be passed through to a VM!

Is Compatible? Name IOMMU_GROUP PCI Address
Yes GK106M [GeForce GTX 765M] 1 pci@0000:01:00.0

[OK] You have GPUs that are not in the same IOMMU group. At least one of these could be passed through to a VM and at least one of the remaining ones could be used for the host system.
[Info] Device name: GS70 2OD
[Info] BIOS version: E1771IMS.70G
[Warning] This system is probably MUX-less. (The connection between the GPU(s) and the [internal display]/[display outputs] is not multiplexed.)
[OK] Logs have been created in /home/phill/MobilePassThrough/logs/GS70 2OD/E1771IMS.70G

Asus GL552VW

Hi there

First - thanks so much for this repo, it's super useful to have all this information in one place! Below is a description of what happened as I tried to get this running, hopefully it will help! Secondly, apologies in advance for the long post, I’ve tried to include everything I ran into in order to find areas where the documentation could be improved.
I've had a go at using it on a clean install of Fedora 35 with an Asus GL552VW. That is an intel i7-6700HQ and an Nvidia 960M.
I'd recommend either pulling the windows-unattended-install branch into main OR adding a big flag on the master readme that this is the branch to currently use, as the master branch currently doesn't work (as referenced in other issues).

In order to get my dGPU to appear in the check script I had to set kernel parameter intel_iommu=on. It would be handy to add this to the readme (both that it needs to be done, and how to set a kernel parameter for newcomers).

I then ran into an issue where spice would give a connection refused, leading to a system hang as you don't start the vm quick enough because the default port in the config script had changed to 5904, but the docs in master still say 5900. I then realised that this is again just due to docs, as I had the git page on master still (my fault).
I then ran "auto" as is referenced in the unattended-win-install branch readme. This failed because SERVICE_NAME was ambiguous and so the service to run on next boot wasn't set - this error occured in /scripts/utils/manager-specific/service/systemd. I tracked this down to line 187 of setup.sh where the command line arguments were in the wrong order at least for my setup. I switched them around and reran but the service is just set to run auto again so nothing happened.
From here I then attempted to run the stages individually to try and work out what was happening. In this case the main issue was that the install was failing because the default vm-file names (such as the windows 10 iso), don't match the file names as downloaded by default in the setup script. This means that the install script doesn't work, but still unloads your dGPU leading to a crash. It was very helpful to have the dry-run parameter to work this out so thanks for that! It would be helpful if the script detected a failed install and didn't unload the gpu however.
The first reason I could see for a failure of the install script was qemu-img not found. I then installed that package separately, perhaps an early step failed to grab it.
The next error became “failed to connect to the hypervisor” from qemu. What seemed to work is installing libvirt from Discover and then importantly rebooting.
This is where I’ve stopped for now as I’m on the edges of what I know without significant further reading. The bottom line is I can’t create a vGPU due to a linux error. The remaining errors that cause the install to fail can be found in the output of my install dry run below. Any pointers of next steps to troubleshoot would be appreciated! I will try and investigate this further when I get more time.

Action: install
> Start mode: qemu
> Using network mode bridged...
> Using MAC address: 52:54:BE:EF:C0:0E...
> Using 7 CPU cores...
> Using 5G of RAM...
> Using a virtual OS drive...
> Removing old virtual disk...
> Creating a virtual disk for the VM...
> Virtual OS drive has 40G of storage.
> Bumblebee is not available...
> Not using SMB share...
> Using dGPU passthrough... 
> dGPU is: 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
> Retrieving and parsing DGPU IDs...
> Not using DGPU vBIOS override...
modprobe: ERROR: could not insert 'kvmgt': No such device
modprobe: FATAL: Module vfio-mdev not found in directory /lib/modules/5.14.18-300.fc35.x86_64
> Creating a vGPU for mediated iGPU passthrough...
bash: line 1: /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/*/create: No such file or directory
> [Error] Failed creating a vGPU. (You can try again. If you still get this error, you have to reboot. This seems to be a bug in Linux.)
> Continuing without mediated iGPU passthrough...
> Loading display-mode-4 plugin...
> Using spice on port 5904...
> Not using QXL...
> Not using Looking Glass...
> Using fake battery...
> Creating fresh OVMF_VARS copy for this VM...
> Not using patched OVMF...
> Not using USB passthrough...
> Using virtual input method 'virtio' for keyboard/mouse input...
> Using RDP...
> Deleting VM if it already exists...
> [Background task] Starting RDP autoconnect...
> Generating qemu-system-x86_64 command (dry-run)...

sudo qemu-system-x86_64 \
  -name MBPT_WindowsVM \
  -machine type=q35,accel=kvm \
  -global ICH9-LPC.disable_s3=1 \
  -global ICH9-LPC.disable_s4=1 \
  -enable-kvm \
  -cpu host,kvm=off,hv_vapic,hv_relaxed,hv_spinlocks=0x1fff,hv_time,hv_vendor_id=12alphanum \
  -mem-prealloc \
  -rtc clock=host,base=localtime \
  -nographic \
  -serial none \
  -parallel none \
  -boot menu=on \
  -boot once=d \
  -k en-us \
  -device ich9-intel-hda \
  -device hda-output \
  -device pci-bridge,addr=12.0,chassis_nr=2,id=head.2 \
  -net nic,model=e1000,macaddr=52:54:BE:EF:C0:0E \
  -net bridge,br=virbr0 \
  -smp 7 \
  -m 5G \
  -drive file=/home/rmurphy/MobilePassThrough/vm-files/windows10.iso,index=1,media=cdrom \
  -drive file=/home/rmurphy/MobilePassThrough/vm-files/mobile-passthrough-helper.iso,index=2,media=cdrom \
  -drive id=disk0,if=virtio,cache.direct=on,if=virtio,aio=native,format=raw,file=/home/rmurphy/MobilePassThrough/vm-files/MBPT_WindowsVM.img \
  -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=pci.1 \
  -device vfio-pci,host=01:00.0,bus=pci.1,addr=00.0,x-pci-sub-device-id=0x1c5d,x-pci-sub-vendor-id=0x1043,multifunction=on,rombar=0 \
  -spice port=5904,addr=127.0.0.1,disable-ticketing \
  -acpitable file=/home/rmurphy/MobilePassThrough/vm-files/fake-battery.aml \
  -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
  -drive if=pflash,format=raw,file=/home/rmurphy/MobilePassThrough/vm-files/OVMF_VARS_VM.fd \
  -usb \
  -device virtio-keyboard-pci,bus=head.2,addr=03.0,display=video.2 \
  -device virtio-mouse-pci,bus=head.2,addr=04.0,display=video.2

Cleaning up...
> Unbinding device ' from the vfio-pci driver, then bind it back to its original driver...
driverctl: no such device: 0000:
> [Error] Seems like the installation failed...

Unclear about displaying error

Hi, I tried your script and following install guide but got error. Many error and I don't know which one is critical one. And I can not find guide to installing on ubuntu. Do I need change something? How about displaying VM, do I need connect my laptop to external screen for gpu passthrough?

Thank you for updating this guide.

Trying it out on Arch Linux

I've successfully made qemu work in arch and setup kvm. Came across your program and setup everything as describe in the readme. When I run ./start-vm.sh, both my monitors go black (this happens after unbinding the pci). Any idea why it's happening? I use optimus-manager instead of bumblebee and I tried setting mode to intel, hybrid and nvidia. Same result.

Device: Aspire VX5-591G (muxed, according to compability-check).

I'll try to fix it myself in the coming days but posting this if there's clarity somewhere.

Is it possible to create a vgpu from amd iGPU?

Hi, I would like to know if this feature:

Automatically creating a vGPU from the (Intel) 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.)

it is also possible for amd iGPU.

My system is AMD + NVIDIA

qemu error "Group 1 is not viable"

When running start_vm.sh (Fedora 30) I get:

> Loading config from /home/d/MobilePassThrough/user.conf
> Using a virtual OS drive...
> Bumblebee works fine on this system. Using optirun when necessary...
> Retrieving and parsing DGPU IDs...
39b9
> Loading vfio-pci kernel module...
> Using Looking Glass...
> Calculating required buffer size for 1920x1080 for Looking Glass...
> Looking Glass buffer size set to: 32M
> Starting IVSHMEM server...
*** Example code, do not use in production ***
> Adjusting permissons for the IVSHMEM server socket...
> Not using DGPU vBIOS override...
> Not using SMB share...
> Using dGPU passthrough...
> Unbinding dGPU from nvidia driver...
> 0000:01:00.0
0000:01:00.0 /sys/bus/pci/devices/0000:01:00.0/driver/unbind
> Binding dGPU to VFIO driver...
> Not using mediated iGPU passthrough...
> Using spice on port 5900...
> Using QXL...
> Not using USB passthrough...
> Using virtual input method 'usb-tablet' for keyboard/mouse input...
> Starting the Virtual Machine...
0+1 records in
0+1 records out
2 bytes copied, 4.0757e-05 s, 49.1 kB/s
QEMU 3.1.1 monitor - type 'help' for more information
(qemu) qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,x-pci-sub-device-id=0x39b9,x-pci-sub-vendor-id=0x17aa,multifunction=on: vfio 0000:01:00.0: group 1 is not viable
Please ensure all devices within the iommu_group are bound to their vfio bus driver.
DNSMASQ terminated
0+1 records in
0+1 records out
2 bytes copied, 6.2173e-05 s, 32.2 kB/s
ip_forward disabled
> Binding dGPU back to nvidia driver...

Where I see it fail in start_vm is whilst trying to unbind the dGPU. In /sys/bus/devices/0000:01:00.0/ there is no driver folder, and therefore no unbind file. driver/unbind is however present for the iGPU.

lspci -nnv output might be giving a clue as to why this is:

00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:591b] (rev 04) (prog-if 00 [VGA controller])
	Subsystem: Lenovo Device [17aa:39b9]
	Flags: bus master, fast devsel, latency 0, IRQ 130
	Memory at a2000000 (64-bit, non-prefetchable) [size=16M]
	Memory at b0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at 6000 [size=64]
	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] [10de:1c20] (rev ff) (prog-if ff)
	!!! Unknown header type 7f
	Kernel modules: nouveau, nvidia_drm, nvidia

lshw -c video output only shows the iGPU:

  *-display                 
       description: VGA compatible controller
       product: HD Graphics 630
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 04
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:130 memory:a2000000-a2ffffff memory:b0000000-bfffffff ioport:6000(size=64) memory:c0000-dffff

lsiommu output:

IOMMU Group 0 00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:5910] (rev 05)
IOMMU Group 10 02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821AE 802.11ac PCIe Wireless Network Adapter [10ec:8821]
IOMMU Group 11 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 10)
IOMMU Group 12 04:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961 [144d:a804]
IOMMU Group 1 00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 05)
IOMMU Group 1 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] [10de:1c20] (rev ff)
IOMMU Group 1 01:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev ff)
IOMMU Group 2 00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:591b] (rev 04)
IOMMU Group 3 00:14.0 USB controller [0c03]: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller [8086:a12f] (rev 31)
IOMMU Group 3 00:14.2 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem [8086:a131] (rev 31)
IOMMU Group 4 00:16.0 Communication controller [0780]: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 [8086:a13a] (rev 31)
IOMMU Group 5 00:17.0 SATA controller [0106]: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] [8086:a103] (rev 31)
IOMMU Group 6 00:1c.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #3 [8086:a112] (rev f1)
IOMMU Group 7 00:1c.3 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #4 [8086:a113] (rev f1)
IOMMU Group 8 00:1d.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #9 [8086:a118] (rev f1)
IOMMU Group 9 00:1f.0 ISA bridge [0601]: Intel Corporation HM175 Chipset LPC/eSPI Controller [8086:a152] (rev 31)
IOMMU Group 9 00:1f.2 Memory controller [0580]: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller [8086:a121] (rev 31)
IOMMU Group 9 00:1f.3 Audio device [0403]: Intel Corporation CM238 HD Audio Controller [8086:a171] (rev 31)
IOMMU Group 9 00:1f.4 SMBus [0c05]: Intel Corporation 100 Series/C230 Series Chipset Family SMBus [8086:a123] (rev 31)

Compatibility check:

[OK] VT-X / AMD-V virtualization is enabled in the UEFI.
[OK] VT-D / IOMMU is enabled in the UEFI.
[OK] The IOMMU kernel parameters are set.
[Success] GPU with ID '01:00.0' could be passed through to a virtual machine!
[Success] GPU with ID '00:02.0' could be passed through to a virtual machine!
[Success] There are 2 GPU(s) in this system that could be passed through to a VM!

Is Compatible?  Name                              IOMMU_GROUP  PCI Address
Yes             GP106M [GeForce GTX 1060 Mobile]  1            pci@0000:01:00.0
Yes             HD Graphics 630                   2            pci@0000:00:02.0

[OK] You have GPUs that are not in the same IOMMU group. At least one of these could be passed through to a VM and at least one of the remaining ones could be used for the host system.
[Info] Device name: 80YY
[Info] BIOS version: 5XCN22WW
[OK] This system is probably MUXed. (The connection between the GPU(s) and the [internal display]/[display outputs] is multiplexed.)

qemu error: cannot support legacy mode due to existing devices at address 1f.0

Hi! Awesome work you've done here. I just tried running this on my Thinkpad E590 running Fedora 34. The steps setup check configure and iso all worked fine but when I ran ./mbpt start I got the following error :

qemu-system-x86_64: -device vfio-pci,bus=pcie.0,addr=02.0,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/1205058e-1fd4-11ec-840b-e86a64ff767e,x-igd-opregion=on,rombar=0,display=on: IGD device 1205058e-1fd4-11ec-840b-e86a64ff767e cannot support legacy mode due to existing devices at address 1f.0
qemu-system-x86_64: vfio_err_notifier_handler(0000:03:00.0) Unrecoverable error detected. Please collect any data possible and then kill the guest

Running spicy -h localhost -p 5900 opened up two black windows with no content.

During setup I used all the default values except for the amdgpu driver for the dGPU and setting the right PCIe addresses from lspci (00:02.0 for the Intel iGPU and 03:00.0 for the AMD dGPU)

Have you run into this issue before? Sorry if this is something simple I missed.

Some more system info:

[~/opt/MobilePassThrough (master)]: uname -r
5.13.19-200.fc34.x86_64
[~/opt/MobilePassThrough (master)]: ./mbpt.sh check
lspci: -s: Invalid slot number
[OK] VT-X / AMD-V virtualization is enabled in the UEFI.
[OK] VT-D / IOMMU is enabled in the UEFI.
[OK] The IOMMU kernel parameters are set.
[Success] GPU with ID '00:02.0' could be passed through to a virtual machine!
[Success] GPU with ID '03:00.0' could be passed through to a virtual machine!
[Success] There are 2 GPU(s) in this system that could be passed through to a VM!

Is Compatible?  Name                                                    IOMMU_GROUP  PCI Address
Yes             WhiskeyLake-U GT2 [UHD Graphics 620]                    19           pci@0000:00:02.0
Yes             Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]  15           pci@0000:03:00.0

[OK] You have GPUs that are not in the same IOMMU group. At least one of these could be passed through to a VM and at least one of the remaining ones could be used for the host system.
[Info] Device name: 20NB0029GE
[Info] BIOS version: R0YET42W (1.25 )
[Info] This system is probably MUX-less. (The connection between the GPU(s) and the [internal display]/[display outputs] is not multiplexed.)
[OK] Logs have been created in /home/julian/opt/MobilePassThrough/logs/20NB0029GE/R0YET42W (1.25 )
If you found a notebook that appears to be GPU passthrough compatible, please open an issue on Github and let me know.
You may now proceed and run './mbpt.sh configure' as mentioned in the README.

the lspci -s: invalid slot number in the first line here seems suspicious to me.

I'd be happy to provide more details and can send you the full check logs if you want.

Error creating the live ISO

While trying to create the iso using the ./mbpt.sh live build command, I get an error
Host OS: Fedora 34 (running on a Fedora 35 host in a distrobox container but the same happens on Fedora 35)
The error:
`> Downloading Fedora ISO...
--2022-01-16 16:17:34-- https://download.fedoraproject.org/pub/fedora/linux/releases/34/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-34-1.2.iso
Resolving download.fedoraproject.org (download.fedoraproject.org)... 67.219.144.68, 185.141.165.254, 38.145.60.20, ...
Connecting to download.fedoraproject.org (download.fedoraproject.org)|67.219.144.68|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://mirror.karneval.cz/pub/linux/fedora/linux/releases/34/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-34-1.2.iso [following]
--2022-01-16 16:17:36-- https://mirror.karneval.cz/pub/linux/fedora/linux/releases/34/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-34-1.2.iso
Resolving mirror.karneval.cz (mirror.karneval.cz)... 89.102.0.150, 2a02:8301:0:2::150
Connecting to mirror.karneval.cz (mirror.karneval.cz)|89.102.0.150|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2007367680 (1.9G) [application/octet-stream]
Saving to: ‘/home/linux/MobilePassThrough/MobilePassThrough/live-iso-files/Fedora-Workstation-Live-x86_64-34-1.2.iso.part’

/home/linux/MobilePassThrough/MobilePassThrough/live-iso-fi 100%[=========================================================================================================================================>] 1.87G 2.46MB/s in 14m 9s

2022-01-16 16:31:45 (2.25 MB/s) - ‘/home/linux/MobilePassThrough/MobilePassThrough/live-iso-files/Fedora-Workstation-Live-x86_64-34-1.2.iso.part’ saved [2007367680/2007367680]

Rebuilding the ISO adding kernel parameters and some files...
Traceback (most recent call last):
File "/usr/bin/editliveos", line 74, in
from imgcreate.fs import *
File "/usr/lib/python3.9/site-packages/imgcreate/init.py", line 19, in
from imgcreate.live import *
File "/usr/lib/python3.9/site-packages/imgcreate/live.py", line 35, in
from imgcreate.fs import *
File "/usr/lib/python3.9/site-packages/imgcreate/fs.py", line 35, in
from imgcreate.util import *
File "/usr/lib/python3.9/site-packages/imgcreate/util.py", line 23, in
from errors import *
ModuleNotFoundError: No module named 'errors'
mv: cannot stat '/home/linux/MobilePassThrough/MobilePassThrough/live-iso-files/mbpt-*.iso': No such file or directory
`

Uninstall?

First off I really appreciate the work being done here. Really awesome stuff. However unfortunately, I wasn't able to get this working right away and don't have time to troubleshoot. Is there in easy way to uninstall?

Cannot unbind driver without killing the GUI

This has been my issue for a long time, whenever the script (or manually) tries to unbind the driver, it will not work and hang with 100% CPU usage, and at worse the kernel will panic and the whole system freezes. The only solutions that I found are:

  • Method 1:
    • Kill the gui (display-manger or isolate multi-user) through tty3
    • unbind manually or run the script (using screen to keep it running in the bg)
    • start the gui
    • go back to screen
  • Method 2:
    • just blacklisting the driver

My intent is that I want to be able to run the vm and pass the GPU to it, and then bring it back to me when the vm isn't running, which I think is also one of the features in this script. So far I tried both master and unattended-win-install (which I think is the one being worked on). I do not like the first method as it's a pain to close all apps then re-open them each time the vm starts/shutdown.

Setup:

  • Lenovo Thinkpad P50
  • Intel HD P530 and Nvidia Quadro M2000M
  • OS: Fedora 34 and 35
  • kernel: 5.14.9-300.fc35.x86_64 (F35)
  • nvidia drivers tested: nouveau and the proprietary one.

LookingGlass Failed to map memory

After following the guide in the readme to a tee (only thing i changed was the amount of storage and CPU's, i gave it 50gb and 2cpu's) LookingGlass seems to not have the right permissions?

I'm running Fedora 34

./looking-glass-client # Run the looking glass client
77023651 [I] main.c:2282 | main | Looking Glass (B3)
77023697 [I] main.c:2283 | main | Locking Method: Atomic
77024390 [I] wayland.c:334 | waylandEarlyInit | SDL_VIDEODRIVER has been set to wayland
77258695 [I] ivshmem.c:127 | ivshmemOpenDev | KVMFR Device : /dev/shm/looking-glass
77258811 [E] ivshmem.c:172 | ivshmemOpenDev | Failed to open: /dev/shm/looking-glass
77258826 [E] ivshmem.c:173 | ivshmemOpenDev | Permission denied
77258829 [E] main.c:1889 | lg_run | Failed to map memory

Issue command not found.

As you requested...

I tried to run your automatic script but I get some errors:
".......utils/Fedora/29/kernel-param-utils: No such file or directory
after this, it installed a lot of updates and stuff....and at the end errors again.
".........utils/Fedora/29/set-kernel-params: command not found"
".........utils/Fedora/29/nvidia-setup: command not found"

I copied all the script files in both utils and 29 folders to be sure they are everywhere and I get the same errors.

Dell Precision 3541 - Compatible

`[OK] The IOMMU kernel parameters are set.
[OK] VT-X / AMD-V virtualization is enabled in the UEFI.
[OK] VT-D / IOMMU is enabled in the UEFI.
[Success] GPU with ID '01:00.0' could be passed through to a virtual machine!
[Success] GPU with ID '00:02.0' could be passed through to a virtual machine!
[Success] There are 2 GPU(s) in this system that could be passed through to a VM!

Is Compatible? Name IOMMU_GROUP PCI Address
Yes GP107GLM [Quadro P620] 1 pci@0000:01:00.0
Yes CoffeeLake-H GT2 [UHD Graphics 630] 2 pci@0000:00:02.0

[OK] You have GPUs that are not in the same IOMMU group. At least one of these could be passed through to a VM and at least one of the remaining ones could be used for the host system.
[Info] This system is probably MUX-less. (The connection between the GPU(s) and the [internal display]/[display outputs] is not multiplexed.)
If you found a notebook that appears to be GPU passthrough compatible, please open an issue on Github and let me know.
You may now proceed and run './mbpt.sh configure' if you haven't already.
`

Support for Fedora 30

Can you please add support for Fedora 30. I created a symbolic link with $ ln -s MobilePassThrough/utils/Fedora/29 MobilePassThrough/utils/Fedora/30 to get the script working but it fails at the nvidia driver installation.

$ ./setup.sh 
Updating software...
Letzte Prüfung auf abgelaufene Metadaten: vor 0:19:19 am Di 04 Jun 2019 23:39:44 CEST.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Installing some useful tools...
Letzte Prüfung auf abgelaufene Metadaten: vor 0:19:24 am Di 04 Jun 2019 23:39:44 CEST.
Das Paket wget-1.20.3-1.fc30.x86_64 ist bereits installiert.
Das Paket curl-7.64.0-7.fc30.x86_64 ist bereits installiert.
Das Paket vim-enhanced-2:8.1.1413-1.fc30.x86_64 ist bereits installiert.
Das Paket screen-4.6.2-8.fc30.x86_64 ist bereits installiert.
Das Paket git-2.21.0-1.fc30.x86_64 ist bereits installiert.
Das Paket crudini-0.9-3.fc28.noarch ist bereits installiert.
Das Paket lshw-B.02.18-19.fc30.x86_64 ist bereits installiert.
Das Paket msr-tools-1.3-11.fc30.x86_64 ist bereits installiert.
Das Paket sysfsutils-2.1.0-26.fc30.x86_64 ist bereits installiert.
Das Paket tunctl-1.5-20.fc30.x86_64 ist bereits installiert.
Das Paket remmina-1.3.4-1.fc30.x86_64 ist bereits installiert.
Das Paket samba-2:4.10.4-1.fc30.x86_64 ist bereits installiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Installing virtualization software...
Letzte Prüfung auf abgelaufene Metadaten: vor 0:19:27 am Di 04 Jun 2019 23:39:44 CEST.
Das Paket qemu-2:3.1.0-8.fc30.x86_64 ist bereits installiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Installing the Windows VirtIO Repository...
--2019-06-04 23:59:13--  https://fedorapeople.org/groups/virt/virtio-win/virtio-win.repo
Auflösen des Hostnamens fedorapeople.org (fedorapeople.org)… 2610:28:3090:3001:5054:ff:fea7:9474, 152.19.134.199
Verbindungsaufbau zu fedorapeople.org (fedorapeople.org)|2610:28:3090:3001:5054:ff:fea7:9474|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 609
Wird in »/etc/yum.repos.d/virtio-win.repo« gespeichert.

/etc/yum.repos.d/virtio-win.repo                            100%[=========================================================================================================================================>]     609  --.-KB/s    in 0s      

2019-06-04 23:59:13 (42,8 MB/s) - »/etc/yum.repos.d/virtio-win.repo« gespeichert [609/609]

Installing virtio-win...
Letzte Prüfung auf abgelaufene Metadaten: vor 0:19:31 am Di 04 Jun 2019 23:39:44 CEST.
Das Paket virtio-win-0.1.171-1.noarch ist bereits installiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Upgrading to latest virtio-win...
Letzte Prüfung auf abgelaufene Metadaten: vor 0:19:34 am Di 04 Jun 2019 23:39:44 CEST.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Installing virt-viewer so you can connect to the VM for the windows installation
Letzte Prüfung auf abgelaufene Metadaten: vor 0:19:37 am Di 04 Jun 2019 23:39:44 CEST.
Das Paket virt-viewer-8.0-1.fc30.x86_64 ist bereits installiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Adding kernel parameters...
Adding kernel parameters to enable IOMMU on Intel/AMD CPUs...
addKernelParam: No action required. "iommu=1" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
addKernelParam: No action required. "amd_iommu=on" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
addKernelParam: No action required. "intel_iommu=on" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
Adding a kernel parameter to prevent bluescreens when a VM does MSR reads / writes directly...
addKernelParam: No action required. "kvm.ignore_msrs=1" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
Adding a kernel parameter to tell dracut to load vfio-pci first...
addKernelParam: No action required. "rd.driver.pre=vfio-pci" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
TODO: check if /etc/dracut.conf.d/vfio.conf is necessary / make sure it onyl happens once
(Re)building initramfs for the current kernel...
Applying the kernel parameter changes...
Generating grub configuration file ...
device-mapper: reload ioctl on osprober-linux-nvme1n1p3  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sda3  failed: Device or resource busy
Command failed.
Found Windows Boot Manager on /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Disable Nouveau drivers
addKernelParam: No action required. "nouveau.modeset=0" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
Kein Treffer für Argument: xorg-x11-drv-nouveau
Keine Pakete zum Entfernen markiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Install third party repositories
Letzte Prüfung auf abgelaufene Metadaten: vor 0:20:00 am Di 04 Jun 2019 23:39:44 CEST.
Das Paket fedora-workstation-repositories-29-2.fc30.noarch ist bereits installiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Install third party repositories
Enable the NVIDIA driver repository
Copr repo for bumblebee owned by chenxiaolong                                                                                                                                                                 5.0 kB/s | 3.5 kB     00:00    
Fedora Modular 30 - x86_64                                                                                                                                                                                     35 kB/s |  25 kB     00:00    
Fedora Modular 30 - x86_64 - Updates                                                                                                                                                                          116 kB/s |  23 kB     00:00    
Fedora 30 - x86_64 - Updates                                                                                                                                                                                   38 kB/s |  24 kB     00:00    
Fedora 30 - x86_64                                                                                                                                                                                             42 kB/s |  25 kB     00:00    
RPM Fusion for Fedora 30 - Nonfree - NVIDIA Driver                                                                                                                                                             56 kB/s | 9.9 kB     00:00    
virtio-win builds roughly matching what was shipped in latest RHEL                                                                                                                                            3.0 kB/s | 3.0 kB     00:00    
Fehler: 
 Problem: package akmod-nvidia-3:418.74-1.fc30.x86_64 requires xorg-x11-drv-nvidia-kmodsrc >= 3:418.74-1, but none of the providers can be installed
  - conflicting requests
  - package xorg-x11-drv-nvidia-kmodsrc-3:418.74-1.fc30.x86_64 is excluded
(try to add '--skip-broken' to skip uninstallable packages)
Enable the Bumblebee repository
Die Paketquelle wurde erfolgreich aktiviert.
Install Bumblebee
Copr repo for bumblebee owned by chenxiaolong                                                                                                                                                                 5.0 kB/s | 3.5 kB     00:00    
Fedora Modular 30 - x86_64                                                                                                                                                                                    147 kB/s |  25 kB     00:00    
Fedora Modular 30 - x86_64 - Updates                                                                                                                                                                           33 kB/s |  23 kB     00:00    
Fedora 30 - x86_64 - Updates                                                                                                                                                                                   39 kB/s |  24 kB     00:00    
Fedora 30 - x86_64                                                                                                                                                                                            139 kB/s |  25 kB     00:00    
RPM Fusion for Fedora 30 - Nonfree - NVIDIA Driver                                                                                                                                                             71 kB/s | 9.9 kB     00:00    
virtio-win builds roughly matching what was shipped in latest RHEL                                                                                                                                            3.0 kB/s | 3.0 kB     00:01    
Das Paket akmod-bbswitch-0.8-2.fc30.x86_64 ist bereits installiert.
Das Paket bumblebee-3.2.1-2.fc29.x86_64 ist bereits installiert.
Das Paket primus-0.2-1.gitd1afbf6.fc29.noarch ist bereits installiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
Make Bumblebee avialable to the current user
gpasswd: Benutzer »bumblebee« ist nicht vorhanden.
Enable Bumblebee
Block nvidia-fallback service
Allow using external monitor for notebooks that have the port wired to the dGPU directly
Letzte Prüfung auf abgelaufene Metadaten: vor 0:00:03 am Di 04 Jun 2019 23:59:59 CEST.
Das Paket intel-gpu-tools-2.99.917-41.20180618.fc30.x86_64 ist bereits installiert.
Abhängigkeiten sind aufgelöst.
Nichts zu tun.
Fertig.
No protocol specified
Unable to connect to ":0".
Attempting to extract the VBIOS ROM of the Nvidia GPU
This will probably fail. If you know how to fix it please open an issue and tell me.
[  177.317986] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) NOUVEAU(0): [drm] failed to set drm interface version.

[  177.318023] [ERROR]Aborting because fallback start is disabled.
You should probably reboot now!
But first make sure you didn't get any errors above.
After the reboot you might want to run the compatibility-check script.
 ./compatibility-check.sh 
[sudo] Passwort für tom: 
[   54.076703] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) NOUVEAU(0): [drm] failed to set drm interface version.

[   54.076740] [ERROR]Aborting because fallback start is disabled.
[OK] VT-X / AMD-V virtualization is enabled in the UEFI.
[OK] VT-D / IOMMU is enabled in the UEFI.
[OK] The IOMMU kernel parameters are set.
[Warning] GPU with ID '01:00.0' could be passed through to a virtual machine, but only together with the following devices: 
IOMMU Group 1 02:00.0 3D controller [0302]: NVIDIA Corporation GM204M [GeForce GTX 980M] [10de:13d7] (rev a1)
[Warning] GPU with ID '02:00.0' could be passed through to a virtual machine, but only together with the following devices: 
IOMMU Group 1 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM204M [GeForce GTX 980M] [10de:13d7] (rev a1)
[Success] There are 2 GPU(s) in this system that could be passed through to a VM!

Is Compatible?  Name                       IOMMU_GROUP  PCI Address
Yes             GM204M [GeForce GTX 980M]  1            pci@0000:01:00.0
Yes             GM204M [GeForce GTX 980M]  1            pci@0000:02:00.0

[Warning] All GPUs in this system are in the same IOMMU group. This would make GPU pass-through difficult (not impossible) because your host machine would be left without a GPU!
[Info] Device name: GT80S 6QE
[Info] BIOS version: E1814IMS.113
[OK] This system is probably MUXed. (The connection between the GPU(s) and the [internal display]/[display outputs] is multiplexed.)
[OK] Logs have been created in /home/tom/Downloads/MobilePassThrough/logs/GT80S 6QE/E1814IMS.113
If you found a notebook that appears to be GPU pass-through compatible, please open an issue on Github and let me know.

Asus K550JK

This laptop (Asus K550JK), that is similar to the already listed ASUS G751JM passed the compatibility-check.sh

CPU: Intel Core i7-4710HQ
dGPU: GTX 850M
iGPU: Intel® HD Graphics 4600

Thank you for your work,
Best regards.

Any high-end laptops that should work?

Could you give me a list of working laptops? preferably high-end? I need a new one and really wanted to do a gpu passthrough on it, but it is almost impossible to test this setup before buying it

script for desktops?

This looks pretty sick for setting up a GPU passthrough, my question is will it work with a normal desktop out of the box?

parameter 'x-pci-stub-device-id' expects an int64 value or range

After running sudo ./start-vm.sh and exiting once, trying to start the vm again using sudo ./start-vm.sh results in the following error:

qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,x-pci-sub-device-id=0x,x-pci-sub-vendor-id=0x,multifunction=on,romfile=/home/samkg/Documents/MobilePassThrough/vm-files/vbios-roms/vbios.rom: Parameter 'x-pci-sub-device-id' expects an int64 value or range

Doing a sudo reboot seems to fix it, but it is annoying to not be able to start up the vm multiple times in succession.

Is there any known fix for this?

Requesting for aid loading display service, and loading GPU driver to VFIO.

Hi, i have a Clevo Notebook and installed clean fedora running alongside KDE neon and Windows 10, no additional configuration here apart from the ones used from the mbpt.sh script, but still i am facing a few problems, first is about looking glass and then when trying to bind GPU to VFIO and thus i'd need some help understanding so maybe its me too that is missing something in here.

When running ./mbpt.sh check:
mbpt_check.txt
All seems good so far.

To configure everything like normal i proceeded with mbpt.sh, once everything was done i continued on to connecting to RDP and the starting the looking client which gave me an error:
looking_glass_error.txt

Now for the trivial VFIO problem i even have this same issue on KDE neon honestly.
When running ./mbpt.sh start it goes well and display-Spice comes up, should i use instead of looking glass, if yes what TLP port do i use?
Meanwhile VFIO fails to bind the GPU giving me issue: vfio 0000:01:00.0: failed to open /dev/vfio/1: No such file or directory, then it tries to unbind and idles at there.

Output after running mbpt.sh start:
mbpt_start.txt

To maybe help a little i w'd like to show my IOMMU group and which driver my GPU is currently bound:
IOMMU_grouping.txt
GPU_driver_bind.txt

My laptop is a Clevo P65_67SE
Running fedora 34;
CPU:Intel I7-4820HQ;
dGPU: Nvidia GTX 970M;
iGPU:intel hd 4600;
Ram:16Gb DDR3;

Any help is much appreciated :).
Thank you for everything so far.

service not enable

Creating a temporary service that will run on next reboot and continue the installation...
/home/pun/MobilePassThrough/scripts/utils/manager-specific/service/systemd: line 12: /etc/systemd/system/${SERVICE_NAME}.service: ambiguous redirect
Failed to enable unit: File /home/pun/MobilePassThrough/mbpt.sh: Invalid argument

Kde Neon - failed to install packages

Got this error message while trying to run ./mbpt.sh auto

[Error] Failed to install packages providing the following executables automatically: x86_64-w64-mingw32-g++ upx

Dell Inspiron 5548 (almost there?)

Hello!
Looks like this notebook are supposed to work however it wont (yet!).
Setup:
Fresh fedora 34 install
Fresh MobilePassThrough install

./mbpt.sh check
lspci: -s: Invalid bus number
[OK] The IOMMU kernel parameters are set.
[OK] VT-X / AMD-V virtualization is enabled in the UEFI.
[OK] VT-D / IOMMU is enabled in the UEFI.
[Success] GPU with ID '00:02.0' could be passed through to a virtual machine!
[Success] GPU with ID '04:00.0' could be passed through to a virtual machine!
[Success] There are 2 GPU(s) in this system that could be passed through to a VM!

Is Compatible?  Name                                                                               IOMMU_GROUP  PCI Address
Yes             HD Graphics 5500                                                                   N/A          pci@0000:00:02.0
Yes             Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile]  13           pci@0000:04:00.0

[OK] You have GPUs that are not in the same IOMMU group. At least one of these could be passed through to a VM and at least one of the remaining ones could be used for the host system.
[Info] This system is probably MUX-less. (The connection between the GPU(s) and the [internal display]/[display outputs] is not multiplexed.)
If you found a notebook that appears to be GPU passthrough compatible, please open an issue on Github and let me know.
You may now proceed and run './mbpt.sh configure' if you haven't already.

looks promising...

./mbpt.sh start
> Action: start
> Start mode: qemu
> Using network mode bridged...
> Using MAC address: 52:54:BE:EF:BB:E3...
> Using 3 CPU cores...
> Using 12G of RAM...
> Using a virtual OS drive...
> Virtual OS drive has 40G of storage.
> Bumblebee is not available...
> Not using SMB share...
> Using dGPU passthrough... 
> dGPU is: Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile]
> Retrieving and parsing DGPU IDs...
> Not using DGPU vBIOS override...
> Not using mediated iGPU passthrough...
> Loading display-mode-4 plugin...
> Using spice on port 5904...
> Not using QXL...
> Not using Looking Glass...
> Using fake battery...
> Not using patched OVMF...
> Not using USB passthrough...
> Using virtual input method 'virtio' for keyboard/mouse input...
> Using RDP...
> Loading vfio-pci kernel module...
> IOMMU group for passthrough is 
lspci: -s: Invalid bus number
> Unbinding device '04:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile] [10...' from its driver, then bind it to the vfio-pci driver...
> [Background task] Starting the spice client at localhost:5904...
> [Background task] Starting RDP autoconnect...
> Starting the Virtual Machine using qemu...
QEMU 5.2.0 monitor - type 'help' for more information
(qemu) 

hmn... looks good!

Screenshot from 2022-01-12 17-43-05

err... well.. not sure what is happening....
please help? :)

Also tried:

./looking-glass-client
[I]    784370129              main.c:1064 | main                           | Looking Glass (B4)
[I]    784370161              main.c:1065 | main                           | Locking Method: Atomic
[I]    784387595           ivshmem.c:127  | ivshmemOpenDev                 | KVMFR Device     : /dev/shm/looking-glass
[E]    784387614           ivshmem.c:168  | ivshmemOpenDev                 | Failed to map the shared memory device: /dev/shm/looking-glass
[E]    784387622           ivshmem.c:169  | ivshmemOpenDev                 | Invalid argument
[E]    784387625              main.c:711  | lg_run                         | Failed to map memory

External display output no longer works on MUXed laptop

I am running Fedora 34 and ran your script by renaming the F30 scripts to 34 and it works fine, although GDM no longer detects my external display.
Specs:

  • HP OMEN 15 ce-020tx (2018)
  • NVIDIA GeForce GTX1050
  • Intel Core i7-7700HQ (w/ Intel UHD630)
    intel-virtual-output throws No VIRTUAL outputs on ":0". and X throws [drm] Failed to open DRM device for pci:0000:01:00.0: -19

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.