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

Dell Inspiron 5548 (almost there?) #25

Open
XxGMTxX opened this issue Jan 12, 2022 · 7 comments
Open

Dell Inspiron 5548 (almost there?) #25

XxGMTxX opened this issue Jan 12, 2022 · 7 comments

Comments

@XxGMTxX
Copy link

XxGMTxX commented Jan 12, 2022

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
@T-vK
Copy link
Owner

T-vK commented Jan 13, 2022

Have you ran the install commad yet?
From your post it looks like you went from running the check straight to starting the VM.
So you'd be missing two steps there: setup (to install the dependencies) and install to create the VM. You might wanna run ./mbpt auto which handles this automatically.

@XxGMTxX
Copy link
Author

XxGMTxX commented Jan 14, 2022

Have you ran the install commad yet?

Yes!

From your post it looks like you went from running the check straight to starting the VM. So you'd be missing two steps there: setup (to install the dependencies) and install to create the VM. You might wanna run ./mbpt auto which handles this automatically.

I did it. I used sudo ./mbpt auto. I will try again on a fresh install (messed too much with this one) and report back.

Looks like something wrong is happening when the script tries to unbind the dGPU. I will try to log everything, will take a few days thou.

@T-vK
Copy link
Owner

T-vK commented Jan 15, 2022

One more thing that you might wanna check is if your GPU model has the reset bug.
And if it does, this kernel module might help:
https://github.com/gnif/vendor-reset

@XxGMTxX
Copy link
Author

XxGMTxX commented Jan 15, 2022 via email

@XxGMTxX
Copy link
Author

XxGMTxX commented Jan 15, 2022

1 - Fresh Fedora 34 install
2 - Fedora updated
3 - Installing git and configuring stuff

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)

first hiccup. Looks like we have a pre pre-requirement.

generate-vm-config.sh: line 30: crudini: command not found

4 - Installed crudini. Configure again. Everything default except iGPU and dGPU addresses and configurations (pass gDPU and don't pass iGPU). No errors now.

./mbpt.sh configure
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!IF IN DOUBT WITH ANY OF THE FOLLOWING, JUST PRESS ENTER TO USE THE RECOMMENDED/DEFAULT VALUE!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Where should the VM files be saved? [${PROJECT_DIR}/vm-files]:

Directory set to '${PROJECT_DIR}/vm-files'
Config will be created at /home/gmt/MobilePassThrough/user.conf'
What should the name of the VM be? [MBPT_WindowsVM]:
Set VM_NAME to 'MBPT_WindowsVM'
Where to save the VM drive image? [${VM_FILES_DIR}/${VM_NAME}.img]:
Set DRIVE_IMG to '${VM_FILES_DIR}/${VM_NAME}.img'
How big should the VM drive image be? (At least 40G is highly recommended; Can't be changed wihtout a reinstall) [40G]:
Set VM_DISK_SIZE to '40G'
Path to your Windows installation iso. (If it doesn't exist it will be downloaded to that location automatically.) [${VM_FILES_DIR}/windows10.iso]:
Set INSTALL_IMG to '${VM_FILES_DIR}/windows10.iso'
How many CPU cores should the VM get? (e.g. 8 or auto; auto equals [AVAILABLE CORES]-1 but uses 16 cores max) [auto]:
Set CPU_CORE_COUNT to 'auto'
How much RAM should the VM get? (e.g. 16G or auto; auto equals [FREE RAM]-1G but uses 16G max) [auto]:
Set RAM_SIZE to 'auto'
The PCI address of your dGPU as obtained by 'lspci' or 'optimus lspci'. (E.g. 01:00.0 or auto to detect it automatically) [auto]: 04:00.0
,> Set DGPU_PCI_ADDRESS to '04:00.0'
The PCI address of your iGPU as obtained by 'lspci'. (E.g. 00:02.0 or auto to detect it automatically) [auto]: 00:02.0
Set IGPU_PCI_ADDRESS to ',00:02.0'
Pass the dGPU through to the VM. (true, false or auto to enable if more than one GPU is in this system) [auto]: true
Set DGPU_PASSTHROUGH to 'true'
Share the iGPU (only supports Intel atm) with the VM to allow using Optimus within the VM to save battery life (true, false or auto to share it only if available) [auto]: false
Set SHARE_IGPU to 'false'
Path to a dGPU ROM. (Optional; Can help avoid error 43) []:
Set DGPU_ROM to ''
Path to a iGPU ROM. (Optional; Can help avoid error 43) []:
Set IGPU_ROM to ''
Patch OVMF with your dGPU ROM if you supply one. (Highly recommended to avoid Error 43) [true]:
Set PATCH_OVMF_WITH_VROM to 'true'
MAC address to use (e.g. 11:22:33:44:55:66 or auto to generate it automatically) [auto]:
Set MAC_ADDRESS to 'auto'
Network mode to use? Only supports bridge at the moment. [bridged]:
Set NETWORK_MODE to 'bridged'
Path to a folder to share with the VM via SMB. (Optional) []:
Set SMB_SHARE_FOLDER to ''
Virtual input device mode for keyboard and mouse. (if usb-tablet doesn't work properly, you may want to switch to virtio) [virtio]:
Set VIRTUAL_INPUT_TYPE to 'virtio'
Location of the unmodified OVMF_VARS.fd. [/usr/share/OVMF/OVMF_VARS.fd]:
Set OVMF_VARS to '/usr/share/OVMF/OVMF_VARS.fd'
Location of the unmodified OVMF_CODE.fd. [/usr/share/OVMF/OVMF_CODE.fd]:
Set OVMF_CODE to '/usr/share/OVMF/OVMF_CODE.fd'
Where to create Creating a copy of OVMF_VARS.fd (containing the executable firmware code and but the non-volatile variable store) for the VM? [${VM_FILES_DIR}/OVMF_VARS_VM.fd]:
Set OVMF_VARS_VM to '${VM_FILES_DIR}/OVMF_VARS_VM.fd'
Location of helper iso or where to create it. [${VM_FILES_DIR}/mobile-passthrough-helper.iso]:
Set HELPER_ISO to '${VM_FILES_DIR}/mobile-passthrough-helper.iso'
Max screen width with Looking Glass. [1920]:
Set LOOKING_GLASS_MAX_SCREEN_WIDTH to '1920'
Max screen height with Looking Glass. [1080]:
Set LOOKING_GLASS_MAX_SCREEN_HEIGHT to '1080'
Version of Looking Glass to use (B4 is highly recommended) [B4]:
Set LOOKING_GLASS_VERSION to 'B4'
Display mode to use (e.g. 1 or 2 ... see scripts/utils/common/plugins) [4]:
Set DISPLAY_MODE to '4'
Enable spice. (Leave this on unless you know what you're doing!) [true]:
Set USE_SPICE to 'true'
Port to use for spice. [5904]:
Set SPICE_PORT to '5904'
Automatically start a Spice client when the VM starts. [true]:
Set USE_SPICE_CLIENT to 'true'
Provide the VM with a fake battery (Highly recommended to avoid Error 43) [true]:
Set USE_FAKE_BATTERY to 'true'
Tool to use to start/install the VM. (qemu or virt-install) [qemu]:
Set VM_START_MODE to 'qemu'
List of USB devices to pass through. (Semicolon separated, e.g. vendorid=0x0b12,productid=0x9348;vendorid=0x0b95,productid=0x1790) []:
Set USB_DEVICES to ''

5 - Installing for real! Downloading... Installing... Downloading... Installing... at the end:

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

hmn.. lets dig in... looks like setup.sh line 187 creates a service that calls "/mbpt.sh auto"

CreateAutoStartService "${PROJECT_DIR}/mbpt.sh auto" "MobilePassthroughInitSetup"

after reboot...

systemctl -t service -a

yep.. service not created... lets run /mbpt.sh auto manually.

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

hmn... again... ok lets ./mbpt.sh setup manualy then reboot...

./mbpt.sh setup

[Skipped] Executable dependencies are already installed.
[Skipped] File dependencies are already installed.
Adding general kernel params...
addKernelParam: No action required. "iommu=1" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
addKernelParam: No action required. "kvm.ignore_msrs=1" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
addKernelParam: No action required. "rd.driver.pre=vfio-pci" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
Adding Intel CPU-specific kernel params...
addKernelParam: No action required. "intel_iommu=on" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
Adding AMD CPU-specific kernel params...
addKernelParam: No action required. "amd_iommu=on" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
Adding Intel GPU-specific kernel params...
addKernelParam: No action required. "i915.enable_gvt=1" already exists in GRUB_CMDLINE_LINUX of /etc/default/grub
[Skipped] Fake ACPI SSDT battery has already been built.
[Skipped] VBiosFinder is already set up.
[Skipped] Looking Glass is already set up.
[Skipped] Helper ISO for auto unattended Windows install, config and driver installation already generated for the current files.
[Skipped] Windows ISO has already been downloaded.
[Skipped] Image 'ovmf-vbios-patch' has already been built.
No reboot required.

now... ./mbpt.sh check

[Error] The iommu kernel parameters are missing! You have to add them in order to use GPU passthrough!
[OK] VT-X / AMD-V virtualization is enabled in the UEFI.
[Warning] VT-D / IOMMU might possibly not enabled in the UEFI. This feature is required to check which devices are in which IOMMU group and to use GPU passthrough!
[Success] GPU with ID '00:02.0' could be passed through to a virtual machine!
[Error] Failed to find the IOMMU group of the GPU with the ID 04:00.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 HD Graphics 5500 N/A 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.)

failed... ok... changed the grub boot command removing the "amd_iommu=on" as its a intel cpu. Now it works.

GRUB_CMDLINE_LINUX="i915.enable_gvt=1 intel_iommu=on rd.driver.pre=vfio-pci kvm.ignore_msrs=1 iommu=1 rhgb quiet"

Check again

./mbpt.sh check
[sudo] password for gmt:
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.

Ok looks good again. Lets move forward to installing the VM "./mbpt.sh install". VM installs. After a reboot vm kinda works... Looking glass don't.

/looking-glass-client
[I] 449278345 main.c:1064 | main | Looking Glass (B4)
[I] 449278386 main.c:1065 | main | Locking Method: Atomic
[I] 449338146 ivshmem.c:127 | ivshmemOpenDev | KVMFR Device : /dev/shm/looking-glass
[E] 449338185 ivshmem.c:168 | ivshmemOpenDev | Failed to map the shared memory device: /dev/shm/looking-glass
[E] 449338199 ivshmem.c:169 | ivshmemOpenDev | Invalid argument
[E] 449338206 main.c:711 | lg_run | Failed to map memory

image

looks like dGPU is not working... hmn... Im kinda stuck now. Any ideias?

@XxGMTxX
Copy link
Author

XxGMTxX commented Jan 15, 2022

ah... looks like i have the infamous error 43!
image
:_( am i dead in the water?

@T-vK
Copy link
Owner

T-vK commented Jan 16, 2022

Sorry for all those bugs. Glad you managed to sort them out though.

You could try using a vbios rom for your dGPU. You might also wanna checke older/newer drivers and also from different sources (Windows Update, notebook manufacturer's website, AMD's website).
I have a Dell XPS 15 with an AMD GPU and I'm getting error 43 on that one as well. The only way for me to get rid of it was to install the driver and then not reboot, but if I don't reboot, I can't seem to actually use the GPU.

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

2 participants