ipaqmaster / vfio

A script for easy pci and usb passthrough along with disks, iso's and other useful flags for quick tinkering with less of a headache. I use it for VM gaming and other PCI/LiveCD/PXE/VM/RawImage testing given the script's accessibility.
GNU General Public License v3.0
189 stars 11 forks source link

tee: /sys/bus/platform/drivers/efi-framebuffer/unbind: no device match #9

Closed Marietto2008 closed 3 years ago

Marietto2008 commented 3 years ago

Let's focus here. As I said,my scenario is like this : I have 3 graphic cards. a) chipset intel integrated with the mobo,aorus pro and I boot the pc with this card,that has been set as default on the bios 2) rtx 2080 ti 3) gtx 1060. Now,I want to pass the 2080 ti from the host to the vm os,that in this experiment is linux elementary os (ubuntu derivate). I do like this :

root@loziomario-Z390-AORUS-PRO:/home/loziomario/Scrivania/new-passt/ipaqmaster# ./main -image myWin10VM.qcow2 -imageformat qcow2 -pci 'NVIDIA' -run

-taskset    not specified, guest gets full host CPU:    (8) with (16) threads.
-memory     not specified, will use half host total:    16018 MB
-bios       not specified, using discovered default:    /usr/share/OVMF/OVMF_CODE.fd
-image(s)   specified, using disks this run.
        1  myWin10VM.qcow2,format=qcow2

No network arguments (-bridge/-nonet) specified, using a NAT adapter for VM networking this run.
PCI:
  Matched:  01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1e04] (rev a1)
  IOMMU Group:  1
    [INFO] Detected driver nvidia is using this device. It will be re-bound on VM exit.
[VGA controller]
Video device [10de:1e04] appears to be in use by the host (Display-manager, efi-framebuffer[virtual consoles] or otherwise).
At the current time I'll need to stop your display manager to continue.
If you don't think the host is using this [RIGHT NOW] then there may be an error.
Stopping display-manager and unbinding console drivers in 5 seconds...
^CPCI:
  Matched:  01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1e04] (rev a1)
  IOMMU Group:  1
    Rebinding 10de:1e04 to driver:  nvidia

as u can see your script wants to stop my display manager. why ? I don't need that it did that. So,I have commented out this line :

#sudo systemctl stop display-manager ; export dm="seen"

and this is what happened next :

tee: /sys/bus/platform/drivers/efi-framebuffer/unbind: no device match
 Console drivers unbound, host may be headless
    Unbinding from: 
tee: '/sys/bus/pci/devices/0000:01:00.0/driver/unbind': File or directory not found
    Binding to:     vfio-pci
ipaqmaster commented 3 years ago

Hi,

The script is only designed for one graphics card I haven't had the time to add support for multi card support right now, but its planned. I don't think it would be difficult to hack/slash the script to support multiple cards but without a machine in front of me its a bit of a challenge.

You've also used the keyword 'NVIDIA' in the PCI arguments which would likely match your 2080ti and 1060 which may not be desired and end up passing through both cards. You'll have to specify either the vendor:class of the device you want to pass through or the model name as it appears in the output of lspci

tee: /sys/bus/platform/drivers/efi-framebuffer/unbind: no device match
 Console drivers unbound, host may be headless
    Unbinding from: 

This section Is the script trying to unbind the efi-framebuffer which is used for the virtual consoles. I've found without doing this on a host who's using the cards prevents a memory mapping error when qemu starts.

tee: '/sys/bus/pci/devices/0000:01:00.0/driver/unbind': File or directory not found
    Binding to:     vfio-pci

This section is it trying to unbind the GPU but it appears to already be unbound, which while not expected by the script, should not stop it from continuing.

Other than the display-manager being stopped I don't see any show-stopping error. (Though the rebind attempt at the end would probably get confused). Are you able to post the entire output from that run?

Marietto2008 commented 3 years ago

I think that your script is good technically,but it is not good in the way it has been shown. I mean that for the final,unexperienced user,it's a little pain in the ass. it should be more user friendly and it should do most of the job without ask to the user to interact with the qemu arguments. I have a basic knowledge of the bash scripting. But your code is too much intricated for me. I'm not able to understand what it does and when. For this reason,I'm trying to do the same as you,but starting from scratch and using the workflow that you have seen. At the moment im stuck here :

https://www.reddit.com/r/VFIO/comments/nd8hrj/audio_unknown_audio_driver_jack_audio_warning/

you should keep the things simple even if you are a good coder. Mostly because u are a good coder,you could try to put yourself in the shoes of those who are not. I really want to understand the method that you have used,but I'm not able to do it by reading your code. I would like if you want to write the most relevant parts in a synthetic way,like I did here :

https://www.reddit.com/r/VFIO/comments/nbnwbc/one_step_away_from_the_definitive_guide_to_load/

ipaqmaster commented 3 years ago

Script improvement is planned however free time is a difficulty. As this issue has reached an end I'll close it now.