-
Notifications
You must be signed in to change notification settings - Fork 21
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
Requesting for aid loading display service, and loading GPU driver to VFIO. #31
Comments
Looking at your start log, the first thing that needs be addresses is
I'm not sure what's causing that. You could try disabling iGPU passthrough for now in your config. |
Hi, thank you for responding, i commented on vm.sh file, with "#" the respecting iGPU lines and functions, please notify if anything's missing. The output after a reset turns out to be the same except with the part of the iGPU: Also in order for the script to work properly better choice is to restart the system, but then when i try to do it even when stopping(ctrl+z) and then kill it (kill -SIGKILL "PID"), won't do any justice, it just fails, would you know of away to circumvent the problem please? |
What I meant was set SHARE_IGPU to false in the user.conf file. There shouldn't be a need to modify the vm.sh file. |
Also that did work, i think really the problem is on my pc, its a 4rth gen and gvt-g isn't still supported so perhaps it might be cause of dat, oh well anyways, really i think even if i passthrough the dGPU i still might have its performance just without the accelerated iGPU on the OS perhaps, so do you know of a way for me to sucessfully bind the gpu, on qemu? i searched a little and even found a forum were it was on /etc/libvirt/qemu.conf but no success thus far.. Really don 't get it, do you know if i could try attaching some start and teardown script to vm.sh or something of some way?
Guess i do it the painfull way then.. Thank you so far. |
It would be interesting to see the output of mbpt start with SHARE_IGPU set to false. MobilePassThrough/scripts/main/vm.sh Line 779 in 1527df2
I like the idea of a hook/plugin mechanism in the vm.sh to add custom functionality, especially for start/teardown purposes. But at the moment that's not supported. Edit: Edit 2: sudo modprobe vfio
sudo modprobe vfio_pci
sudo modprobe vfio_iommu_type1
sudo driverctl --nosave set-override "0000:01:00.0" vfio-pci And then check which driver that GPU is using by running: driverctl list-devices | grep 01:00.0 Or alternatively check |
Would that affect the process or no? Just curious since you said it wasn't really an issue.
I will be honest i did this first on the command line and well i might have made kind of a mess, though i will be explaining on the process while i am showing you what i mean. After another force reboot i went to start again "./mbpt.sh start" and shows me this: I accidentally closed the issue, could you open it again please? Thank you and an apology for any confusion made.. |
No, it's fine, just ignore it.
That's weird indeed. Maybe we should take a look at your
That network error must be coming from here: MobilePassThrough/scripts/main/vm.sh Lines 137 to 139 in 1527df2
Can you share the output of |
Don't know what is exactly, but i had a certain guess so here's what i have, i only ran the modprobe commands you sent to me inside the terminal, executed dmesg both before and after modprobe commands: After: dmesg after trying to bind to vfio.txt //Now here vfio does show something yet seems bound to noveau, is this because i am only running through the terminal without echo??(example: echo <vendor_code> <device_code> > /sys/bus/pci/drivers/vfio-pci/new_id)?
Sure here: it seems to show same thing as when loading the VM so you got that right, weird is that this did not happen before, maybe system is broke or did it pop up out of the blue or was it bypassing the problem? really dk.. |
I'm not sure what the implications of those libvirtd segfault errors in your dmesg are, but I would think that they aren't related to the binding issue. Regarding the dracut error, I'm not sure of the implications either, but maybe updating the kernel or just booting with an older kernel version could get rid of it. Regarding the network errors: Did you mess with any of the conf files in
The only caveat would be that you have to run it from a privileged terminal, but can't use sudo because
|
I too don't have any idea too now xp, but i just updated the kernel btw, dratcut still seems to fail starting somehow, i did this only with the gpu bound to noveau since now i am starting to think about doing something else here were explain below (*), however libvirt after repairing qemu.conf mentioned down below seems to have fixed libvirt smh.
yeah i did a mistake, sorry about that i ended up messing up qemu.conf inside /etc/libvirt to see if it w'd fix the dGPU binding problem but no, now its back to normal, with the output being pretty much the same as before.. Here, the corrected output of mbpt start if you wanna see: mbpt.sh_start_log.txt
Hmm i searched on your scripts and /scripts/utils/common/tools/driver-util already indeed has these commands so i thought since it may do when starting the VM now i think thats not the problem when trying to bind the GPU unless ${DRIVER} doesn't get to the right directory because in my case instead of /sys/bus/pci/drivers/vfio-pci/bind it is called /sys/bus/pci/drivers/virtio-pci/bind,meaning vfio-pci doesnt exit and is instead virtio-pci, i don't really know about that for sure but i am leaving all inside the script by default to try make the least of a mess, i could still try doing it inside the terminal, but i think on your script does should do about the same no? (*)->here is were i explain what i was talking about up in the top. |
I think it might be important to fix that dracut error because it is responsible for some of the vfio stuff: MobilePassThrough/requirements.sh Line 18 in 1527df2
Maybe you can try to google how to fix your dracut or maybe how to reset it. It could explain why the I used to automatically install and set up Bumblebee in earlier iterations of this project, but after adding support for AMD GPUs and making the project more distribution-agnostic it got too complicated for me. This is how I used to do it: MobilePassThrough/utils/Fedora/34/bumblebee-setup Lines 1 to 37 in 3e35715
I'm not sure if it would still work, but maybe it does. Looking at vm.sh there still appears to be some code that was required to support Bumblebee: MobilePassThrough/scripts/main/vm.sh Lines 267 to 283 in 1527df2
Generally all drivers should be supported. I think I have tried radeon, amdgpu, nvidia and nouveau. Edit: I think I forgot to answer your question regarding what happens if you bind to the vfio driver before the VM starts. For most notebooks (almost all in recent years) your screen and ports are fed by the frame buffer of the iGPU. This means even if you unbind the dGPU driver entirely, your screen wouldn't just go blank. |
Solved, i guess and to give credit were its due i found the solution here in case it helps somebody else: https://bugzilla.redhat.com/show_bug.cgi?id=1967457 But VFIO ain't cope with that, when i launched it the same error "/dev/vfio/1:no file or directory" came again, so well guess i am gonna advance to plan B, of Bumblebee+nvidia.
Thank you for the explanation, and guidence so far, now it seems its up to me now, also one question about my dGPU, today i understood that a GPU without UEFI support makes process harder to do, did you ever had any success with gpu's of this kind?
Neet B-), i always thought of something like that too since i know that specially cause in this PC when you install Win10 in order to run smooth even with dGPU drivers u need to install iGPU acceleration meaning even tho they disconected they still will work spareted just not quite like 2 VGA gpu's in a PC.
Now that i remember i did too when following tut. on YT but using scripts, thats y i did not think that right lol. But ofc i did not have such succes doing a passthrough afterwards.
Maybe in the future, for now really we need as a community to concentrate into getting a complete experience close to baremetal and doing it the easier way starting from the one you provide, install Win11 on it so then i won't need to worry by the year of 2025 when win10 ends for me to "forcefully" install it just so to get updates.. But really i feel like only want linux on my PC now. Well will try keep you updated once i make any progress here, for now really no sucess.. |
Great to hear that you managed to fix the dracut issue.
I'm just asking because I should probably add this to the setup scripts so other people don't run into the same issue. Now after fixing the dracut error and rebooting and running:
is `/sys/bus/pci/drivers/vfio-pci´ still missing? If it does exist now, it would be nice to see the output of:
otherwise there is still a deeper issue going on with vfio. In that case I would like to start by checking your kernel parameters ( Regarding Bumblebee, I'd advise you to first get it running without Bumblebee and once you got it, then try it with Bumblebee. I don't think that Bumblebee is going to simply things, but add a lot of complexity, potentially making it more difficult to find the root cause. Regarding dGPUs that don't support UEFI, I haven't tried that yet. I think mbpt automatically creates UEFI-based VMs because the legacy method has a bunch of disadvantages and supporting both would complicate things a lot for me. I think we have a very high chance of being able to work around Nvidias error 43 with mbpt. |
I only did:
Just executed the modprobe commands and checked afterwards, in the respective directory and yes now vfio-pci indeed exists now, with bind, unbind, module folder, new_id, remove_id, uevent and unbind, also alongside it "virtio-pci" under /sys/bus/pci/drivers still exists, hope it won't interfere with vfio.. I still give you what i have inside cmdlide:
Makes sence, i'll save it for later then.
yeah idk either xp, we'll see then, i think we can do it based on what i already could before so. And thus surpass code 43. |
Alright, thanks for the info regarding dracut. :) Glad to see you can finally load the vfio-pci driver. The virtio-pci driver is an entirely different driver that wouldn't interfere. In order to revert the driver override, you can use: MobilePassThrough/scripts/main/vm.sh Line 931 in 1527df2
(In your case with 0000:01:00.0 of course.)
Looking at your kernel parameters I'm a bit shocked. There are a lot of parameters missing that mbpt should have set for you. Does It should have set those 5 parameters found in here (not the amd one of course): MobilePassThrough/requirements.sh Lines 16 to 28 in 1527df2
That could explain a lot of things, even the issue errors with your iGPU. |
Glad i could help smh hehe.
Its not working, idk whats going on here,after doing
From what it showed me, no errors were found except when downloading ISO, which i doubt that could problem no?
Additionally here's what i have inside requirements.sh in a .txt: requirements_sh.txt |
We absolutely need to address the missing kernel parameters first. driverctl might very well just be failing because the kernel params are missing. So mbpt setup thinks the kernel parameters are already set because they are in your /etc/default/grub file. Try applying them like this:
And then reboot to check if the parameters have been applied successfully by checking /proc/cmdline again. If that didn't work can you tell me if you installed fedora in uefi or legacy mode? |
I ran it differently from what you asked but it changed the grub.
From what i notice its on UEFI really. On here https://itsfoss.com/check-uefi-or-bios/ i ran the command you see below and indeed it shows these respective folders.
Also i tried ur modprobe commands on KDE neon and even though i couldn't have any sucess unseting the override and launch the VM it could at least reboot so maybe or either its a bug or mb we could be missing something like a blacklist of noveau? No? |
Now that the kernel parameters have been set correctly, can you try manually binding again using And check which driver is loaded in lspci then. It would also be worth it to check dmesg again, now that the kernel parameters are set. I only tested mbpt with the default settings, usually on a fresh install. The only exception is installing the Nvidia proprietary driver, but other than that I haven't tested what happens when you change other configs. It shouldn't matter if you use Gnome or KDE. I have tested it on a fresh install of the Fedora KDE spin before without problems. But Ubuntu support with mbpt still pretty flaky. The automatic dependency installation doesn't work yet and there might other issues. |
Sorry for the late response.. i ended up busy for the day. Here's what happens.
On lspci:
Idk really whats going on here.. unlucky me if its my PC, sh*T. |
At this point I would advice you to try the mbpt live iso to rule out that it's a misconfiguration. Also, I hopefully fixed the Windows ISO download now, so booting from the stick should automatically create a GPU passthrough VM on the stick and install Windows in it. |
One last question can you just tell me how to create the iso file inside another disk, like i have 2 local SDD's on my laptop and i intend to create it inside of the second onr since we are creating 64GB ISO am i right? And then flash with a imager inside an external HDD cause i got no pen drives big enough at hand..Wonder an HDD could still work really lmao. Also did you try live ISO recently? because right before doing this in an installation it'd give me an issue regarded in this #26 type of issue. |
The ISO file itself is only going to be ~2.1GB in size. 64GB are required for when you boot it and it downloads Windows and creates a VM. I've never tried it on an HDD, but theoretically it should work. You can flash it to using:
Regarding #26 that should be fixed with the commit I just pushed. |
So by now i've been attempting to test the live build, and so i thought i could leave some update of what i've been attempting: First flashing with When launching the live build, on my laptop no sucess, first i had to launch without no UEFI boot, not a problem just saying, and then when running the script it gave some erros plus it just could not get the kernel params set up cause Virtualalization on this PC is not enabled on the bios it seems.... So i went to plan B, using my decade old resurrected PC, so far i've tried live build on HDD as since i don't have 64Gb pen drive but it still needs a local drive to install the VM so it can be even my 8Gb pen drive, but even then its rough, kinda like a hit or miss, the script runs but for example when trying to open something to mannualy mount a drive to install the VM or opening up a browser to install the missing .iso, i can't open them. But i went up to get all the configs right and so far it went up till failing to get to launch the VM due to not having a windows.iso, and so far i could not manage to put any myself. Idk however if on my PC it w'd also work great too cause it only has a single GPU and without scripts it could also cause problems no? |
Try flashing it again using You might want to run The live version currently doesn't mount anything but the drive you boot it from. So it can only create the VM on that drive. I'll have to look into improving on that in the future. The windows iso download should be fixed btw. If it is missing mbpt should automatically download a Windows 10 iso from Microsoft. A PC with only one GPU will probably be problematic unless it has a dGPU and an iGPU. But even the, mbpt hasn't been tested very well on desktop PCs. |
Find my hard drive:
Attempting same thing again still fails and then from here its were i tried also diferent combs., which also gave me the same error. |
I think you need to remove the number at the end. |
Now i ended up updating the repository, only 7 hours after seeing you updating, cleared some storage a currently i have 12Gb on my main SSD, and tried again: But still no success thus far, the same issue comes over again, does it appear for you on your tests? |
Sorry for all the issues. I will try to reproduce and figure out where this error is coming from tomorrow. |
No problem, i will keep workin on my end too and give any news in case i succed. Btw On KDE neon btw lspci v when i bind to vfio does show that it is connected to vfio driver, with other modules loaded but i can t lauch the VM, mb because of old nvidia drivers? Idk but that could mean something, that theres hope for sure! |
That is good news indeed, there is definitely hope. :) I just pushed another commit fixing a bunch of things. There were a few bugs and one of them was that an incompatible version of |
Sorry i took a while unfornatly i lost access to the linux distros, grub in reorvery mode, no way to recover it.. and had to wipe both fedora and kde away, now i am back with Fedora 34. Heres the whole replicate of what happened:replicate.txt |
I just found something interesting that I must have forgotten about. MobilePassThrough/requirements.sh Line 19 in da8c37e
Then run ./mbpt.sh setup again, reboot and see if that fixes it? |
Tried it but it did not work, i removed the comment: Also i tried from your other branch were your script installs bumblebee and nvidia but seemed to not work, issue due to not finding the device, you will see later in the file but its bound to vfio currently, this was also a issue when i tried on KDE it seems but i quite don't understand this problem really, so i don't think neither bumblebee(or is it?) and nvidia are malfunctioning, but one thing, could you tell me from where is it trying to find the device? If it is in this format Leaving my outputs if you wanna see: After commenting on VM and setting iGPU: Lastly as i was experimenting with different configs i also saw there was “user.conf” and as you mentioned before this is an easy way to enable/disable iGPU passthrough, i also uncommented the settings inside start_vm.sh, so i did it together with default.conf igpu_share set to false and here again are my results. mbpt_sh start: lspci -v show the same as before now My overall impression is that doing this way my PC just works better,rebooting works fine, bind and unbind also works, kinda, but the whole setup in order to work still requires some further tweaks, i am up to even learn a bit of bash just to see if i can configure all here, i don't want to have you do all the work really, but yeah i am a total noob in this regard. But for this PC it really needs a switcher to bind/unbind gpus cause the default way for this here will cause instability and malfuntions requiring some force shutdowns. Update: On main branch now lauching the VM it starts without looking glass yet, but it binds to vfio now at least, i can't yet boot to windows, will have to try putting an .iso or something. Update 2: installed windows inside the VM, the script did it automatically and all the scripts were installed too i also in this instalation changed the password(will probably reenstall afterwards), however the display acceleration seem to not be enabled i tried getting virtio drivers for windows and they did not install here.. what am i missing here? |
Sorry for the late response. I'm a bit busy at the moment. I think the folder is created in
I don't understand what you mean. It finds the device using lspci I think.
Once you get that fixed, there is no need to modify the vm.sh to not use the iGPU.
Yeah, Looking Glass is not very reliable at the moment. Also RDP support is a bit flaky as well since Remmina changed a bit.
I'm not entirely sure, but it should have installed the virtio drivers automatically from the generated helper iso in MobilePassThrough/helper-iso-files/mbpt-helper.bat Lines 12 to 14 in 7102471
|
No problem, really you have been enough help really thanks to you i learned a lot and now i even am enough confident to build a VM myself if anything happens here. I think its fair to first tell you my status, so for now GPU passthrough is working with your scripts, but with a bit of a mix of configs, though i believe from what i have thats being used from your unnatained-win-install is bumblebee and nvidia drivers. Then i ran the script from the main branch, made the installation first and then it ran pretty well no error code 43, Now some times after when rebooting doing a boot the OS gets stuck so that way i need to ctrl alt del and then bam it runs back again. So yeah it will be quite the work or just patience alone.
Yes i checked it later and indeed it is instaled. I have now no idea what else could appart from it being the dGPU not connected to a display. |
Thanks for the update, glad to hear you got it working somehow. :) About the virtual display, it probably depends on what kind of virtual display it is. There is the one that can be created via dma-buf which might not be available on your CPU and there is the QXL one which is created for the spice client during the installation process and then there is the one Windows creates when an RDP connection is established. And finally there are external dummy adapters that you can plug into a physical port to make the OS think there is a real display connected. |
My apology, so much to try being specific and at the end i failed specifiyng from where it was, by issues on gpu utilization i meant on the guest i'll leave below a picture of what happens, also optirun can fail sometimes too i just now on my 1st attempt booting the OS and then starting the VM it failed giving me the usual /dev/vfio/1: file missing, after that another reboot and worked again so its 100% not there but its fine, its pretty doable. You can see the CPU at 100% and GPU polishing some nails haha, this is more noticiable when playing a game btw, also resolution is set to 800x600 locked.
Let me guess the lack of intel-GVTg support? I can not really see any other reason it could it could prevent the DMA buffer from acessing to the system, am i right? Sorry i did only a quick search and did not really understand what it does specifically since the wiki generalized a bit. I found info on that in here:https://01.org/linuxgraphics/gfx-docs/drm/driver-api/dma-buf.html
Might this be the only way really.. here, i have logs from using my VM after a start and then closing it:
that one works, never tried gaming but its not like using one that the system uses by itself, animations are disabled and so might be any 3D rendering.
Yeah that might be my last hope from what i can see for now, well at least i made a GPU passthrough, just out of curiosity did you ever try doing it with your script? even through HDMI or something? |
By default, MobilePassThrough/scripts/utils/common/plugins/display-mode-4 Lines 8 to 22 in 7102471
Basically, if dma-buf is available, it uses dma-buf, otherwise it'll use qxl. I'm not 100% sure that your CPU doesn't support gvt-g and dma-buf. I think there are different versions of it and maybe your CPU just supports an older version that I might have to add support for. Can you run the following:
and then check if there is anything in this directory?
I have used those dummy plugs a few years ago, but I'm not sure why exactly I needed them. I think it was on a notebook that wasn't muxed. |
No qxl option is there so i suppose the code does it by itself right? w'd it be wise to put qxl=true there though or is it just redundant?
So i ran it and gave me some errors. My iGPU adress:
in the directories:
Is it really necessary, for it to render at 1080p or w'd a connection directly on to the dGPU work, like i intend with a simple mini dp adapter? Also would that work if connected to a screen through the iGPU even if the iGPU is not passing through. Sorry for the many questions its just this is all so niche and complicated.. |
Okay and
And then change your user.conf to use that new display mode. |
If i am right this is the grub configuration from "unnatained-win-install" branch too. But yeah the VM i am using is from the "main" branch already, to not confund.
Never mind, regarding the Dummy adapter i think i finally understood what it does and for what its needed for.
So first and foremost after checking the files and content inside them, i created new user.conf file and edited from there like you said some days ago and first tried display-3, it worked great but looking glass indeed did not want to, showing only the purple window with its logo meaning no windows display was working, then i created display-6 with the content you provided and changed again inside user.conf and yeah QXL worked great, resolution changed sucessfully too but yeah performance was worse than with spice alone, now its 2x screens and one being at 1080p, thus CPU was still being the only one utilized really so that means only missing thing to do is connecting to the dGPU. |
Okay I think it's safe to assume then that gvt-g is not available on your CPU. I don't know if connecting a display to one of the ports is really gonna help. I'm just skeptical about one of the ports being wired directly to the dGPU, but I would love to be proven wrong. Theoretically there should be a way to solve this in software, maybe there is some sort of Windows application that can force other applications to use the dGPU. |
The sad truth really, i even tried to see if messing up on user.conf, setting up iGPU passthrough to auto to see if it w'd work but no, it gave me the
Yeah its a 5050 chance to work really.. I am more than enough happy to see this passing through the dGPU though. But if it doesn't then i might consider selling this one and upgrading to a new one, however it seems i can't choose anything equal or below 50 series card like 3050 cause manufacturers seem to not put video out there.. it will be quite the investment tho, in order to buy one for something like this.
Will have a look then but i hardly believe there's such a thing on windows ahha more could i expect to have a solution from the linux side but again with no gvt-g then its pretty much null from there too.. Will leave any updates if anything works out, if not then i close the issue because for current status your repository works really well except that on my PC it decided to bitch out at the end kek. |
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.
The text was updated successfully, but these errors were encountered: