Author Topic: Windows VMs under Linux with Native Performance  (Read 4851 times)

0 Members and 1 Guest are viewing this topic.

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #25 on: August 10, 2022, 05:24:12 pm »
How much memory do you use in the laptop to get decent performance?

The laptop has 16GB, which I split in two and give 8GB to the VM.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6185
  • Country: ro
Re: Windows VMs under Linux with Native Performance
« Reply #26 on: August 10, 2022, 06:56:21 pm »
First of all wow, great project!  :-+

With the advent of cpu extensions like IOMMU and VFIO we are able to isolate PCIe devices and give them to a virtual machine for it's sole use.

Second, it just happens that today I'm reinstalling all from scratch (posting from a USB live Devuan now), and would be very nice to add looking glass.

I've briefly looked at the https://looking-glass.io/docs/B5.0.1/faq/ and still have questions.

Last time I've tried virtualization, couldn't give the video card to a guest machine no matter what.  The closest I could come was with proxmox (a bare-metal type hypervisor), could pass the GPU, but couldn't install the video drivers in the Windows guest machine.

IIRC it was Error 43 from nVidia driver installer, and after searching about that, it turned out that's an intentional software limitation included by nVidia in their Windows drivers and in the firmware of the videocard.  The only card allowed to passthrough were the very expensive ones, like the Quadro line.  Other cards would have been able to work, unless they were limited by nVidia (for some cards there are even hardware hacks to make the chip present itself as a Quadro).

Would Looking Glass work for a consumer grade nVidia (GeForce GTX760 2GB video RAM + i7 with a second Intel GPU)?
« Last Edit: August 10, 2022, 09:23:02 pm by RoGeorge »
 

Offline krokodyl1220

  • Contributor
  • Posts: 17
  • Country: pl
Re: Windows VMs under Linux with Native Performance
« Reply #27 on: August 10, 2022, 07:23:01 pm »
If you have problems with code 43 there are workarounds, but some months ago Nvidia started supporting vfio out of the box without code 43 on all cards, also consumer. I use GTX 3050 but also successfully used GTX 1050 and Intel integrated GPU with gvt-g.

As far as I can see the GTX 760 is on driver 473 and Nvidia allowed VMs from driver 465, so it should work out of the box :)
« Last Edit: August 10, 2022, 07:31:08 pm by krokodyl1220 »
 
The following users thanked this post: RoGeorge

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #28 on: August 10, 2022, 09:27:20 pm »
If you have problems with code 43 there are workarounds, but some months ago Nvidia started supporting vfio out of the box without code 43 on all cards, also consumer. I use GTX 3050 but also successfully used GTX 1050 and Intel integrated GPU with gvt-g.

As far as I can see the GTX 760 is on driver 473 and Nvidia allowed VMs from driver 465, so it should work out of the box :)

There are exceptions to this.
#1. Laptop NVidia GPUs in some instances require the commonly used and known workaround.
#2. If you want to use custom resolutions the native nvidia "support" locks you out of this feature unless you also use the workaround.
#3. AMD drivers also require this for Vega or later generation GPUs due to a bug which also causes the Code 43 error.

The workaround is to hide the KVM CPUID leaf (not disable these features), and change the KVM vendor_id to something random.

https://passthroughpo.st/apply-error-43-workaround/
 
The following users thanked this post: RoGeorge

Offline krokodyl1220

  • Contributor
  • Posts: 17
  • Country: pl
Re: Windows VMs under Linux with Native Performance
« Reply #29 on: August 11, 2022, 06:56:18 am »
Yes, you are right. I was just replying to RoGeorge. :)
« Last Edit: August 11, 2022, 07:00:44 am by krokodyl1220 »
 

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #30 on: August 11, 2022, 07:04:27 am »
If you have issues again @RoGeorge jump into the VFIO discord, there are tons of very smart people there that are very willing to help you (myself included)

https://discord.gg/f63cXwH
 
The following users thanked this post: RoGeorge

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6185
  • Country: ro
Re: Windows VMs under Linux with Native Performance
« Reply #31 on: August 11, 2022, 10:05:28 am »
Thank you for the invitation, you are too kind.  Sorry for not taking advantage of it.  :-\
In general I won't go on a platform that requires registration to read.  Not a fan of any chat oriented platforms, either.

So far didn't try installing Looking Glass, still working at a clean install with root ZFS across all OSs.  That would probably take many days, since I want to have at least a FreeBSD as a fallback, a Gentoo or Funtoo (something built from sources but not LFS, that would be too demanding to maintain alone as a desktop), maybe a Devuan and an Ubuntu, too, not sure yet.

Meanwhile searched again about virtualization in general, and it seems nVidia got more relaxed about that starting last year:  https://nvidia.custhelp.com/app/answers/detail/a_id/5173  That makes me hope Looking Glass will work with my hardware, too.   :D

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #32 on: August 11, 2022, 10:08:56 am »
Thank you for the invitation, you are too kind.  Sorry for not taking advantage of it.  :-\
In general I won't go on a platform that requires registration to read.  Not a fan of any chat oriented platforms, either.

So far didn't try installing Looking Glass, still working at a clean install with root ZFS across all OSs.  That would probably take many days, since I want to have at least a FreeBSD as a fallback, a Gentoo or Funtoo (something built from sources but not LFS, that would be too demanding to maintain alone as a desktop), maybe a Devuan and an Ubuntu, too, not sure yet.

Meanwhile searched again about virtualization in general, and it seems nVidia got more relaxed about that starting last year:  https://nvidia.custhelp.com/app/answers/detail/a_id/5173  That makes me hope Looking Glass will work with my hardware, too.   :D

No worries mate, but to clarify, your hardware always would have worked, it was a simple matter of VM configuration. You do not need, nor have you ever needed a Quadro/Tesla, etc for this.

As for being a chat platform, we use it because we render real time live support, there is no other real way to do this.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6185
  • Country: ro
Re: Windows VMs under Linux with Native Performance
« Reply #33 on: August 11, 2022, 11:40:05 am »
Found this video of yours for how the Looking Glass works:  https://youtu.be/U44lihtNVVM

If I got it correctly, the main idea is to use what in an FPGA would have been called a dual-port RAM, here a physical RAM region, addressed once from the guest machine and once from the host machine, so to transfer the video buffer from one OS to the other, except here the dual addressability is implemented in software (while in an FPGA interlocking would have been handled in hardware), yet the RAM buffer is still using DMA transfers to stay fast.

Very clever!  :-+
« Last Edit: August 11, 2022, 11:41:42 am by RoGeorge »
 

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #34 on: August 11, 2022, 12:33:29 pm »
Found this video of yours for how the Looking Glass works:  https://youtu.be/U44lihtNVVM

If I got it correctly, the main idea is to use what in an FPGA would have been called a dual-port RAM, here a physical RAM region, addressed once from the guest machine and once from the host machine, so to transfer the video buffer from one OS to the other, except here the dual addressability is implemented in software (while in an FPGA interlocking would have been handled in hardware), yet the RAM buffer is still using DMA transfers to stay fast.

Very clever!  :-+

Pretty much, however if your host GPU is Intel or AMD (or NVidia once the next FOSS driver drops) you can also use GPU DMA xfers from system ram to GPU ram offloading some of the workload from the CPU
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6185
  • Country: ro
Re: Windows VMs under Linux with Native Performance
« Reply #35 on: August 12, 2022, 05:56:16 pm »
Just FIY, was curious to try LookingGlass and followed the install page:  https://looking-glass.io/docs/B5.0.1/build/#building

For my desktop, which is a former Kubuntu 20.04 LTS migrated to 22.04 LTS (Jammy Jellyfish), some additional packages were needed to compile Looking Glass, apart from the ones listed in the instructions:
Code: [Select]
        # additional packages needed to compile, aside from the ones listed in instructions
        sudo apt install libpipewire-0.3-dev libpulse-dev libsamplerate0-dev

The client built just fine (with the default options).  :)
Will try again this weekend to passthrough the nVidia GTX760, to test Looking Glass.
« Last Edit: August 12, 2022, 05:58:14 pm by RoGeorge »
 

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #36 on: August 12, 2022, 06:02:41 pm »
Just FIY, was curious to try LookingGlass and followed the install page:  https://looking-glass.io/docs/B5.0.1/build/#building

For my desktop, which is a former Kubuntu 20.04 LTS migrated to 22.04 LTS (Jammy Jellyfish), some additional packages were needed to compile Looking Glass, apart from the ones listed in the instructions:
Code: [Select]
        # additional packages needed to compile, aside from the ones listed in instructions
        sudo apt install libpipewire-0.3-dev libpulse-dev libsamplerate0-dev

The client built just fine (with the default options).  :)
Will try again this weekend to passthrough the nVidia GTX760, to test Looking Glass.

This is because you didn't build the current "stable" release of B5.0.1, but rather bleeding edge.
Documentation for Bleeding Edge is at: https://looking-glass.io/docs/bleeding
 
The following users thanked this post: RoGeorge

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #37 on: August 13, 2022, 09:58:28 am »
I am wondering about / researching a few things related to GPUs, virtualization, containerization, etc.   Maybe there are those here who might have the information to some uncertainties I have?

Firstly wow, talk about a wall of text... most of your questions can be answered by just some simple googling.

Secondly open a new thread and don't hijack this one please.
 

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #38 on: August 13, 2022, 12:06:22 pm »
"Firstly wow, talk about a wall of text." -- Do you actually read manpages, linux kernel docs, actual books on linux sysadmin, etc.?  Those are way more than a mere eight paragraphs, do you complain about those?
If one doesn't subscribe to a forum to, you know, read / discuss stuff, what's the point?

You have asked a ton of questions all at once that do not relate directly to "Windows VMs under Linux with Native Performance". They are generic questions with regards to the state of virtualisation under Linux and the various technologies/hardware options.

"most of your questions can be answered by just some simple googling." -- Isn't that true about say 98% of things?  That generally doesn't stop people from asking anyway.  And in my case I've spent probably hundreds of hours researching / reading this stuff, so I don't think they qualify as particularly stupid questions though very niche ones wrt. LINUX GPU sysadmin / virtualization / desktop UI etc. which might be obvious to someone working in that field, but I'm pretty sure arcane to even 98% of LINUX users.

I did not mean to imply you have not done your research nor do I think your questions are stupid at all, they are just way left field of what this thread is about. You said it yourself, "very niche" questions, and they deserve their own thread where I would be happy to assist/help, etc.

"Secondly open a new thread and don't hijack this one please." -- As you wish.  Though that seems a rather "entitled" and unfair / unreasoned response.  You're posting this on an electronics forum though your post has nothing at all directly to do with electronics engineering.  Mine, at least, does, since if you didn't notice my use case includes / is motivated by running EDA / ECAD / simulation / CAE tools like Altium under LINUX host while running Windows VM with Native Performance.  And looking at the title of your thread you accuse me of "hijacking" -- it is exactly: "Windows VMs under Linux with Native Performance" -- and THAT is EXACTLY the focus of my questions, running LINUX, using VMs / containers, interoperating with Windows VMs, and achieving Native Performance via whatever means of HW / sysadmin / VM / etc. can be done.
So my post being related to both EDA and the EXACT TITLE TOPIC OF THIS THREAD is hijacking nothing, and
you're being fatuous to suggest I did.

Windows VMs under Linux with Native Performance
This is under the general computers segment of this forum. Please review the kinds of topics that go here before you question the validity of this thread existing here.

If you titled your thread "Looking glass user group chat" or something THEN I'd be somewhat off topic, but so would you relative to an EE forum.  Anyway I had the preconceived notion that looking glass MIGHT be among the best possible "solutions" to my use case, but I wanted to confirm the alternative options / possibilities and ways to optimize the various use cases using any related tools / technologies in conjunction with or alternatively to LG.  Through no fault of your own it's at best a lousy kludge of a work-around solution not because it isn't useful / well though out, but just that it solve a problem by indirect means and IMHO that core problem shouldn't exist to be worked-around but for the crippling of the PC platform by HW / OS makers (GPUs, CPUs, motherboards, MSW, ...) since virtualizing / paravitrualizing / multiplexing GPUs should "just work" seamlessly to desktop / compute use.  And the fact that GPUs are hideously overpriced / hard to source and don't even FIT into typical PCs if you need two just to run a single lousy MSW VM with a half-decent UI / app.  So if I spoke of things reluctantly wrt. your commended solution of spending another $700 for another GPU I can barely use in the box it was for the obvious reason, other than all that your SW sounds as nice as possible.

There are solutions without adding an extra GPU, you do not need to use Looking Glass, and I would be happy to discuss all of this in a thread where it is the topic of discussion.

Anyway carry on with your project advertising or whatever you expect people to talk about here other than the actual nuts and bolts practicalities / options of "Windows VMs under Linux with Native Performance" -- which is what I was actually wondering about and thought would be the subject here .

I have no reason to advertise my project, the goal was to share with people what is possible and help people to find Linux more useful/comfortable.
 
The following users thanked this post: nctnico

Offline krokodyl1220

  • Contributor
  • Posts: 17
  • Country: pl
Re: Windows VMs under Linux with Native Performance
« Reply #39 on: September 11, 2022, 08:25:27 am »
@gnif - somewhere in the project docs there was info that the virtual / emulated display to get rid of the need for dummy plugs was abandoned. Do you have any plans regarding this dummy driver?
 

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #40 on: September 11, 2022, 08:27:56 am »
@gnif - somewhere in the project docs there was info that the virtual / emulated display to get rid of the need for dummy plugs was abandoned. Do you have any plans regarding this dummy driver?

It was never even started, all that was done was some initial proof of concept work. It's still planned if enough funding can be raised to cover my development time & costs.
See: https://github.com/sponsors/gnif
 

Offline krokodyl1220

  • Contributor
  • Posts: 17
  • Country: pl
Re: Windows VMs under Linux with Native Performance
« Reply #41 on: September 11, 2022, 08:38:48 am »
Oh ok, that wasn't clear, thanks for reply. Sometime ago I have stumbled upon this dummy project, perhaps it can be of some help with starting it at all? https://github.com/roshkins/IddSampleDriver
 

Offline gnifTopic starter

  • Administrator
  • *****
  • Posts: 1675
  • Country: au
Re: Windows VMs under Linux with Native Performance
« Reply #42 on: September 11, 2022, 08:45:41 am »
Oh ok, that wasn't clear, thanks for reply. Sometime ago I have stumbled upon this dummy project, perhaps it can be of some help with starting it at all? https://github.com/roshkins/IddSampleDriver

It's actually what was used as the proof of concept :)
 

Offline krokodyl1220

  • Contributor
  • Posts: 17
  • Country: pl
Re: Windows VMs under Linux with Native Performance
« Reply #43 on: September 11, 2022, 08:53:05 am »
Hah, no further comments from me then :D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf