Virtual Machine for Intel HD passthrough (host is NVidia)

If it's not ZDoom, it goes here.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Virtual Machine for Intel HD passthrough (host is NVidia)

Post by MartinHowe »

Is anyone here a VM expert? I would like a freeware way to pass the motherboard GPU (Intel HD 4600) to Windows (10 64 bit) guest on Linux (Mint 20.3) host (NVidia GT 1030). Dual GPUs are enabled in the BIOS and lspci sees them OK. VirtualBox is no good for this now and the older version is buggy as hell.

Please can anyone suggest a VM software for this? I don't mind which software but it must be free, at least for personal use.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by Rachael »

QEMU/KVM are good for this. But I can't help you set it up because I have never done this before.

This should help you get started - but for anything further you're gonna have to use Google. https://wiki.gentoo.org/wiki/GPU_passth ... t_qemu_kvm

Also I am not sure if you'll be able to pass the APU unit (the Intel HD4600). The actual GPU might be the only available device for pass-through this way. You can probably access the APU using the virtio drivers but that might be about it. Again though - seeing as how I never done this before - I don't know.

You might also have to recompile your kernel - luckily though, that takes all of 2 minutes. It's recompiling the kernel modules that is a nightmare, though, unfortunately.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by MartinHowe »

Thanks Rachael. That's a lot of work, mind you; but as it happens it seems VMWare Workstation 16 can be installed free for personal use and it does a reasonable GPU sharing job for the apps I need (UDB and Paint.net), as well as (mostly) being more polished than VB; even GZDoom runs that way, though slowly. I may well go with that. If I can get pci passthrough to work it would be better, as I could employ the redundant Intel GPU which is plenty good enough for these apps.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by Rachael »

I have a rig with a NVidia GTX 1650 and I couldn't stand VMWare's acceleration; it was much too slow for me. Hosted with Ubuntu 21.10 with Windows 10 Pro as a guest. In fact it was so terrible that I ended up caving and making Windows 11 Pro the main system and running my Ubuntu 21.10 as a chrooted system through WSL. I am amazed you're able to tolerate that for something even less powerful. At any rate I am glad you found a solution you are happy with.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by MartinHowe »

Thanks; I do see your point, but I only tried GZDoom for curiosity; when playing I use self-compiled versions of everything built on and for Linux so there's no speed penalty.

The only apps I constantly miss having jumped to Linux are Paint.net and UDB. Paint.net doesn't run at all under WINE and Pinta (Linux clone thereof) is too slow and somewhat buggy, though I use it for general photo editing with a bit of care. UDB on Wine is flaky and if a Linux build is used, there are several crashes or missing functionalities.

I never run level tests within editors anyway, as I want fine control, and have a shell script framework to actually run tests of levels the way I want them; the levels and resources are stored in the Linux filesystem and accessed for editing via a fake network share (at least in VB; haven't tried it in VW yet).

Since Windows can easily screw up the boot parts of a system, there is no way I will let it be the primary OS, been burned that way too often; plus other reasons that would soon turn into a rant if I listed them here :P

So the next step is to see if Paint.net works well in VMWare this way and try UDB in VMWare when editing some really big level like planisphere 2. Even if that works acceptably, I will still attempt PCI passthrough of the Intel GPU as then VMWare's acceleration won't matter anyway.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by MartinHowe »

UPDATE: Workstation doesn't support PCI passthrough. However, I was pleasantly surprised to find that UDB loaded planisphere2 and I was able to edit it quite easily from within the VM with the file itself on a shared folder on the host. Paint.net worked a lot faster than I thought it would. This is on an i5, so should be even better on an i7 or an AMD CPU. Anyway, job done :D
Blzut3
 
 
Posts: 3144
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by Blzut3 »

Rachael wrote:Also I am not sure if you'll be able to pass the APU unit (the Intel HD4600). The actual GPU might be the only available device for pass-through this way. You can probably access the APU using the virtio drivers but that might be about it. Again though - seeing as how I never done this before - I don't know.
You can, in fact on Broadwell and newer Intel offers GVT-g which allows passing through the iGPU to multiple VMs. Something both AMD and nvidia stubbornly refuse to offer even though they build it into the silicon for a selection of server cards. (Although I hear some a hack has been found to enable it on Maxwell through Turing nvidia cards.)
MartinHowe wrote:UPDATE: Workstation doesn't support PCI passthrough.
i5-4670K or your motherboard not supporting VT-d? Intel really loved segmenting their virtualization features back then.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by MartinHowe »

Blzut3 wrote:
MartinHowe wrote:UPDATE: Workstation doesn't support PCI passthrough.
i5-4670K or your motherboard not supporting VT-d? Intel really loved segmenting their virtualization features back then.
Not the computer (i5-4600, Asus H81M-PLUS) as it supports them and the iGPU is in its own IOMMU group with nothing else; it's the product: VMWare Workstation Player does not offer this feature, presumably to encourage people to use the paid-for version.
Blzut3
 
 
Posts: 3144
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by Blzut3 »

Ah, I see. Yeah QEMU/KVM is the usual for doing pass through. I know you said you have a solution to your particular problem so this is probably useless info, but virt-manager is enough to setup passthrough if you ever decide to experiment with it. You do need to bind the hardware you want to passthrough to vfio which can sometimes be a pain depending on a number of factors, although in your scenario I can't imagine it would be problematic. When I repurposed my brother's Broadwell-S Xeon for our NAS, he wanted move his workstation to a VM and pass through the GTX 960 to a VM (also passed through the main USB controller, audio, one of the NICs, and the second SATA controller) I did run into a few quirks:
  • His board has an option to select the primary GPU but it was broken, so the 960 was always the primary. Had to find some kernel options (video=efifb:off) to get it to ignore the EFI framebuffer and initialize the iGPU otherwise the 960 couldn't be released to vfio.
  • The Ubuntu 20.04 LTS kernel was hard locking when the VM booted. Using the upstream 5.8 build that Canonical provides fixed it (was latest at the time I set this up).
User avatar
KynikossDragonn
Posts: 272
Joined: Sat Dec 12, 2020 10:59 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Void Linux
Graphics Processor: Intel (Modern GZDoom)
Location: Independence, KS, USA
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by KynikossDragonn »

Blzut3 wrote:n fact on Broadwell and newer Intel offers GVT-g which allows passing through the iGPU to multiple VMs.
I'm on NUC6i7kyk and I've had to disable "Virtualization Technology for Directed I/O" because Linux kept whining to me that the firmware was reporting a DMAR range that "couldn't possibly be reserved" and to "contact my vendor they have a bug in their BIOS" but I'm on 0074 of the firmware and it still happens. The iGPU also misbehaves in strange incomprehensible (to me) ways when this is enabled so I hard disable it in the UEFI setup.

It's a shame though, I really was curious if I could pass through the iGPU while it's still being used by the main OS, but of course, I don't think there's Windows XP drivers for Intel Iris Pro 580.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by Rachael »

Windows XP?

If you have to run something that old you might as well just run it on Wine, it's certainly better for it.

GPU passthrough would only be useful for more modern versions of Windows (or Mac) where you cannot run certain games in neither a Wine environment or fully userland virtualized one (i.e. VMWare, or Virtualbox without passthrough - etc). For example, the more recent Call of Duty games.
User avatar
KynikossDragonn
Posts: 272
Joined: Sat Dec 12, 2020 10:59 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Void Linux
Graphics Processor: Intel (Modern GZDoom)
Location: Independence, KS, USA
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by KynikossDragonn »

Rachael wrote:Windows XP?

If you have to run something that old you might as well just run it on Wine, it's certainly better for it.

GPU passthrough would only be useful for more modern versions of Windows (or Mac) where you cannot run certain games in neither a Wine environment or fully userland virtualized one (i.e. VMWare, or Virtualbox without passthrough - etc). For example, the more recent Call of Duty games.
Windows XP specifically for all the DirectMusic needing things. Unreal 2, various old GameMaker shovelware, etc.

I could do with Windows 7, but it would be a headache to bypass System File Protection to "transplant" all the DirectMusic related stuff over into Windows 7.

Either way, it's a sad moot point because evidently the software hates me either way.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by Rachael »

In that case I am not 100% sure on this but you should be able to install a bare copy of XP and update it to 7 - if you find a way to get the passthrough working for your iGPU. Most of the time such upgrades (afaik) will keep some of the old programs and libraries, it's usually the exception not the rule when something is actively removed via a Windows upgrade.

Windows 8 did a lot more of this than Vista/7 did but I don't see any reason why DirectMusic shouldn't survive all the way to an upgrade to a 32-bit version of Win10.
User avatar
KynikossDragonn
Posts: 272
Joined: Sat Dec 12, 2020 10:59 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Void Linux
Graphics Processor: Intel (Modern GZDoom)
Location: Independence, KS, USA
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by KynikossDragonn »

DirectMusic is "sabotaged" in Vista and above because Microsoft deemed the scripting runtime to be a "security flaw". Even if you had installed Windows XP, and the DirectX releases then, the necessary scripting runtimes are stubbed out the moment you progress to Vista and beyond. The only way to undo the stubbing is to copy over the DLL's from Windows XP, and bypass System File Protection status.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: Virtual Machine for Intel HD passthrough (host is NVidia

Post by MartinHowe »

Blzut3 wrote:Ah, I see. Yeah QEMU/KVM is the usual for doing pass through. I know you said you have a solution to your particular problem so this is probably useless info, but virt-manager is enough to setup passthrough if you ever decide to experiment with it. You do need to bind the hardware you want to passthrough to vfio which can sometimes be a pain depending on a number of factors, although in your scenario I can't imagine it would be problematic.
I might try it one day, but it's a huge learning curve and all the articles on how to do it just assume so much prior knowledge and use lots of terms I don't know; in other words it would be a very steep learning curve and I'm not sure it's worth it; something to think about but not for right now; but thanks for mentioning it.
Post Reply

Return to “Off-Topic”