share the graphics card between host and guest

Discussions about using Windows guests in VirtualBox.
Post Reply
mastupristi
Posts: 16
Joined: 21. Jul 2009, 08:41
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, linux 32 nit, linux 64 bit

share the graphics card between host and guest

Post by mastupristi »

I have two PCs. Both run linux host and Windows guest.

PC 1:
CPU: AMD Threadripper 2990WX
RAM: 32GB
GPU: NVIDIA
OS: xubuntu 21.04

PC 2:
CPU: Intel i9-9900
RAM: 32GB
GPU: NVIDIA
OS: xubuntu 20.10

both machines runs Virtualbox 6.1.22.

Although for my work it is better to have a linux machine, I occasionally have to use electronic CAD software. This is the reason why I have the Windows guest VM. Since such software enjoys the hw accelerations that the GPU can provide, I was wondering if there is a way to allow the guest to access the actual GPU.

How can I configure my systems so that the VM guest can access the GPU?

best regards
Max
Max
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: share the graphics card between host and guest

Post by mpack »

All you can do is install the Guest Additions and enable 3D acceleration in the VM settings. That maximizes the graphics performance of the VM.

There is never a way to "share" hardware. One PC has to own the hardware in order to manage it. You can however share a driver, with one PC operating the hardware for real.

If your software needs access to the GPU then you need to be dual booting, not running a virtual machine.
birdie
Posts: 428
Joined: 2. May 2010, 14:19
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: Windows, Linux, other Unixes
Location: Artem S. Tashkinov
Contact:

Re: share the graphics card between host and guest

Post by birdie »

mpack wrote:All you can do is install the Guest Additions and enable 3D acceleration in the VM settings. That maximizes the graphics performance of the VM.

There is never a way to "share" hardware. One PC has to own the hardware in order to manage it. You can however share a driver, with one PC operating the hardware for real.

If your software needs access to the GPU then you need to be dual booting, not running a virtual machine.
PCI-E passthrough (AMD-Vi and Intel VT-d) is no longer an option?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: share the graphics card between host and guest

Post by scottgus1 »

According to the devs, it was only PCI passthrough. PCI-e was not supported. If I remember correctly that code was removed in either 6.0.0 or 6.1.0.

Forum guru PerryG was, I think, the only Virtualbox master to get it going, and reported that the benefit was negligible.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: share the graphics card between host and guest

Post by mpack »

scottgus1 wrote:According to the devs, it was only PCI passthrough.
And it was only ever supported on Linux hosts, and it let a PCI card be dedicated to a single VM just as USB devices still can be. It never allowed sharing, which was the question asked.
Karol
Posts: 2
Joined: 26. Aug 2021, 16:41

Re: share the graphics card between host and guest

Post by Karol »

Kind of expecting what the answer will be, so asking three questions to confirm.

1. There is currently no way in Oracl VM to allow a VM guest running WinXP on a Win10 host to use a National Instruments PCI-GBIP card (not video, but used to communicate with a spectroscope)

2. The option was available up to v6 and only on Linux hosts?

3. What alternative would the wiser/more experienced recommend? Preferably Win10 Host and WinXP guest (current software Win10, spectroscope software WinXP).

I found information that Xen project should enable the PCI card access - will a noob manage to work with Xen Project?

Cheers
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: share the graphics card between host and guest

Post by mpack »

PCI redirection was never supported on Windows hosts, and was almost never successfully used anywhere else.

Btw. you have a Win10 host with PCI slots?? Note that PCIe and PCI are different, and VirtualBox never supported PCIe redirection on any host.

Frankly, if you need to control physical hardware then trying to do it from a virtual machine rarely ends well. Better IMO to buy some "new, old stock" PC from eBay, or buy one of the industrial PCs that still support PCI.
Karol
Posts: 2
Joined: 26. Aug 2021, 16:41

Re: share the graphics card between host and guest

Post by Karol »

Yep, got a G41M-VS3 MOBO with Win10 running smoothly.
To be honest, I was surprised it has a PCI slot when I noticed.
Would you elaborate on why VM - PCI doesn't end well?

I need to run old software as well as use the PCI card. So a VM would allow the use instruments in the background and use current software at the same time.

This is no a one of problem, as there's quite a few instruments that are pretty unique and have potential use in further research, but being custom made in the 70-80's don't really have much of a support as of now.
Will look into Xen Project.

Thanks for your help.
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: share the graphics card between host and guest

Post by Martin »

Another possibility might be a USB GPIB adapter.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: share the graphics card between host and guest

Post by scottgus1 »

Karol wrote:Would you elaborate on why VM - PCI doesn't end well?
At the time this concept was big, it was thought that passing a video card to the VM would be the next best thing since sliced bread. One forum guru PerryG got it running on a Linux host, and reported the effort to get it working was not worth it: the VM's video was pretty standard. (it was a PCI video card, after all).

So it did work, just didn't give the thrills it proposed to be. Mileage might vary on an instrument card, though.

And you have to use a Linux host, so Windows host is out.

The USB adapter suggested by Martin sounds interesting, since USB can be passed into the VM.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: share the graphics card between host and guest

Post by mpack »

Karol wrote: Would you elaborate on why VM - PCI doesn't end well?
In fact what I said was broader: controlling physical hardware from a VM usually doesn't end well.

That's because a VM shares real time with another PC, so can rarely guarantee low latency reponses to events. This upsets many device types.

Some people think of VMs as a convenient alternative to dual booting, which may be true if you don't care about performance. I would be particularly concern that your GPIB interface card might implement protocols that are sensitive to timing. A USB-GPIB card might have a better chance as Martin suggests, but I still believe this is the wrong application area for virtual machines.
Post Reply