Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

GPU Passthrough on multi GPU machine

Need help with peripherals or devices?
Post Reply
Message
Author
Prajwal
Posts: 2
Joined: 2022-05-25 08:03

GPU Passthrough on multi GPU machine

#1 Post by Prajwal »

So I am experimenting some new things,
Recently I came across this GPU passthrough concept
I tried to pass through single NVIDIA RTX-3060 from host (buster) to virtual machine (stretch), and this was successful. :D

Now I am increasing my experiment scope,
Lets say I have 2 NVIDIA RTX-3060 on host, and I want to passthrough one NVIDIA RTX-3060 to virtual machine and keep one NVIDIA RTX-3060 for host. :(

I found same question for AMD GPU,
https://www.reddit.com/r/VFIO/comments/ ... s/h1xothb/
but it was of no use. :roll:

I also searched for GPU passthrough using PCI id's but did not found any relevant options. :cry:

Is it possible to passthrough single GPU on multi GPU machine (GPU's are same) ?
Is it possible to passthrough single GPU on multi GPU machine (GPU's are different) ?

Thanks in advance for your help 8)

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: GPU Passthrough on multi GPU machine

#2 Post by CwF »

Prajwal wrote: 2022-05-25 08:26 Is it possible to passthrough single GPU on multi GPU machine (GPU's are same) ?
Is it possible to passthrough single GPU on multi GPU machine (GPU's are different) ?
Yes and yes, most of the time, on right hardware...
Search on this forum for 'vfio'. It's come up.

I was very hopeful for dynamic allocation, had a triple, last mention from me was likely about the unbind process breaking. I hear Intel is working on it, with AMD gpu's no less, go figure. MxGPU with SR-IOV was promising..

Fixed config with different gpu's is all I do now. I've learned that success is particular, and it's a moving target.

Prajwal
Posts: 2
Joined: 2022-05-25 08:03

Re: GPU Passthrough on multi GPU machine

#3 Post by Prajwal »

@CwF First of all thanks for your quick response.
Yes and yes, most of the time, on right hardware...
Search on this forum for 'vfio'. It's come up.
Using 'vfio' was a success.

ref:
https://gist.github.com/davesilva/44527 ... 2fe852b340
https://wiki.archlinux.org/title/PCI_pa ... h_via_OVMF

As per my understanding vfio conf file uses Device ID.
Is there anyway that I can use pci id's instead of device id?

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: GPU Passthrough on multi GPU machine

#4 Post by CwF »

Prajwal wrote: 2022-05-27 04:09 Is there anyway that I can use pci id's instead of device id?
Not really, think of vfio as a 'driver'. A device can have more than one suitable driver, hence the 'pre' declarations, and AMD's amdgpu/radeon choice, etc. 'lspci -k' will list all, and the one in use.. Secondarily you can specify pci address to declare one of many to use, but the device pciid is used as the primary identifier.

So you can define these things for boot but that kills easy portability. I was going for post boot dynamic allocation and prior to Xorg 19 it worked. My fuzzy conflation prone memory goes back to 'stub' prior to vfio-pci, in the end using sysfs to unbind broke so I did use similar gpu's with the different pciid's, even though the sound was the same, it worked.

For windows a genuine Quadro works every time without tweaks. That OVMF article is much more complete than when I started doing it. Most of it is extraneous stuff, I did say 'particular'! OVMF is mostly a gpu dependent choice, standard bios does work on Q35 and even fx machines, depending. Again, I had professional purpose so portability is paramount, so I reduced, or boiled down to Xeon/Quadro works every time. Other platforms are hit and miss. Avoid ACS overrides messiness with better platforms, forget huge-pages. Do use the QXL video in addition to passed gpu's, it provides a fall back for video and kbm and windows and linux guest work fine with both. An additional eth port vfio passed allows simpler communications and allows seamless multi-monitor multi-OS control using x2x or x2vnc.

It can help to use a motherboard with per slot rombios control and turn off the slots you want to pass. This may need a VGA bios to be extracted to file and declared in the guest xml. You can flip host gpu's as part of this, but again, unbind and reset issues come up.

Virt-manager now has xml editing now! The simplest is using it for all things with only the iommu=on and the few vfio declarations.

With science/engineering type software accessing usb and serial port equipment for which only windows software is available the virtual machine is a very good method to get it all in one box, while providing horsepower to obsolete things formerly impossible. For development or isolation needs with linux guest it is also on target. For Windows games, not so much.

Have fun!

Post Reply