News for hackers. Stuff that matters.
Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by lostmsu on Wednesday August 24, 2022 @02:53PM (#32584059)
What does it do? Does it let one pass a virtual GPU to the guest without complete PCI-passthrough? E.g. will I be able to share host GPU between the host system and guests?
Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by amelius on Wednesday August 24, 2022 @06:52PM (#32586905)
How secure is that? Are users of a GPU completely isolated from eachother? Will there be side-channel attacks possible?
Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by ArcVRArthur on Wednesday August 24, 2022 @07:04PM (#32587028)
GVM uses IOMMU for compartmentalization:

This page has a comparison of the various IO assistance modes GVM can make use of (see comparison of assistance modes, the Mdev Mode section, and the SR-IOV Mode section):

https://openmdev.io/index.php/Virtual_IO_Internals

This will probably also play a role in future developments like SIOV (Scalable IO Virtualization):

https://lwn.net/ml/linux-kernel/20190222021927.13132-1-baolu...

Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by amarshall on Wednesday August 24, 2022 @06:58PM (#32586974)
It’s mostly up to the specific hardware and its host-side drivers. I’d say that GPU compute security is a very under-studied area compared with CPU compute.
Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by ArcVRArthur on Wednesday August 24, 2022 @07:10PM (#32587103)
Ya, that's accurate. The precise driver implementation matters a lot. Having said that there are some good 'best practices' that seem to make a difference. In my opinion 'IOMMU Aware Mediated Device' could also make some much needed improvements here as it would allow for more granular IOMMU allocations - perhaps this mode could help further support the 'App VMs' use-case using shared work queues without breaking IO virtual address translation:

https://lwn.net/ml/linux-kernel/20190222021927.13132-1-baolu...

Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by ArcVRArthur on Wednesday August 24, 2022 @03:09PM (#32584276)
Ya, that's exactly correct. :)
Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by Melatonic on Wednesday August 24, 2022 @04:15PM (#32585161)
What about one GPU with multiple VM?

Annoying t hing right now is that you have to pony up for the fancy nvidia cards plus insane nvidia licensing for their multiGPU virtualized cards. AMD at least makes you only pay for the hardware but its still super pricey.

Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by ArcVRArthur on Wednesday August 24, 2022 @04:30PM (#32585333)
Ya, you can use multiple VMs. Here is a video I took of a laptop with LibVF.IO and an early pre-release version of GVM installed - at the start of the video you can see a fullscreen Windows VM and then I back out and open another compartmentalized 'app VM' (browser):

https://streamable.com/gd45bh

Both VMs are actually based on Windows (one simply doesn't have explorer.exe running) and each has it's own virtual GPU attached.

This laptop has a Nvidia graphics processor inside but it also works with laptops that have an Xe Intel graphics processor. I'm hoping at some point it will work well on AMD too.

Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by lostmsu on Tuesday September 06, 2022 @05:24PM (#32743392)
Can I run CUDA in the guest OS (Windows)?
Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by kbumsik on Wednesday August 24, 2022 @06:06PM (#32586410)
Sounds very interesting! Do VMs work with a display session (Xorg) too?

Some GPU-enabled applications require an X server with a physical HDMI/Displayport attached.

Re:LibVF.IO: Add support for GPU Virtual Machine (GVM) by ArcVRArthur on Wednesday August 24, 2022 @07:01PM (#32587005)
Ya! You can use VMs that use X11 in the guest without issue. X11 also works on the host. Wayland is also working on the host - I haven't tested yet with Wayland guests yet so that's something to try.