1,LibVF.IO可以提高虚拟机的vGPU性能。LibVF.IO可以自动创建和管理中介设备(宿主机和虚拟机共享的物理GPU),识别NUMA节点,解析/管理IOMMU设备,将虚拟功能分配给虚拟机等。
感觉和Intel GVT-g开源类似?但Intel GVT-g只针对Intel集中显卡,而LibVF.IO支持所有显卡?待确定。
2,LibVF.IO的支持情况,宿主机支持Ubuntu 20.04桌面版,虚拟机可以用Windows 10 LTSC。
3,Nvidia的consumer Ampere GPUs不支持。
Intel i915驱动:6代到9代在这里:https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide
AMD MxGPU GPU-IOV模块驱动:https://github.com/GPUOpen-LibrariesAndSDKs/MxGPU-Virtualization/,虽然目前完全可用,但AMD GPU设备的虚拟化功能有不少缺点:
最新支持该驱动的AMD GPU是AMD Tonga架构S7150,而该架构于2017年终止支持(EOL)。
AMD还生产了其他支持MxGPU的GPU,他们拒绝公开发布这些GPU的开源驱动程序代码。
AMD拒绝支持目前的开源代码,为了GPU-IOV模块在现代内核版本上可用,需要签出pull request 24:https://github.com/GPUOpen-LibrariesAndSDKs/MxGPU-Virtualization/pull/24
重点是:该文不建议当前将AMD GPU设备用于虚拟化目的。
4,AMD供应商基本上忽略了内核中的标准开源接口,而使用不同的API,另外,AMD拒绝发布开源代码来支持较新的显卡,并且在消费级显卡上以固件级别锁定了这些(虚拟化)功能。Nvidia和Intel GPU的最新消费级显卡可以获得解锁(虚拟化功能)支持。
重点是,可以尝试用Nvidia和Intel GPU的最新消费级显卡来实现vGPU?
https://github.com/DualCoder/vgpu_unlock
https://github.com/Arc-Compute/libvf.io
5,Intel GPU的GVT-g是一个死胡同,只支持到第10代Comet Lake集显。
https://github.com/torvalds/linux/blob/2f111a6fd5b5297b4e92f53798ca086f7c7d33a4/drivers/gpu/drm/i915/intel_gvt.c#L44-L60
static bool is_supported_device(struct drm_i915_private *dev_priv) { if (IS_BROADWELL(dev_priv)) return true; if (IS_SKYLAKE(dev_priv)) return true; if (IS_KABYLAKE(dev_priv)) return true; if (IS_BROXTON(dev_priv)) return true; if (IS_COFFEELAKE(dev_priv)) return true; if (IS_COMETLAKE(dev_priv)) return true; return false; }
后续的第11代Rocket Lake采用SR-IOV(即只支持GVT-d,不再支持GVT-g)。
https://github.com/intel/gvt-linux/issues/190
https://www.intel.com/content/www/us/en/support/articles/000058558/graphics.html
6,消费级显卡上有虚拟化功能,但是被厂商锁死了,以方便在不同的市场上实现不同的价格差异。这是厂商的一种商业行为,会受到需求发展和竞争对手做法的影响,比如当普通消费者对vGPU需求的激增,当竞争对手开始放开消费级显卡的vGPU功能,就会形成新的市场规范,但当前,在消费级显卡上实现vGPU,需要捣鼓各种小技巧(比如vgpu_unlock,libvf.io),估计在稳定性上多半没有厂商直接支持的好。
7,nvidia quadro专业卡可以使用vGPU,nvidia最新的一些消费卡上也提供有相应的vGPU功能选项。libvf.io几乎适用于除Ampere以外的所有新发布的Nvidia消费卡,像DG1/DG2这样的Intel GPU也支持,还支持一些AMD消费卡(但局限性比较多)。
https://arccompute.com/blog/libvfio-commodity-gpu-multiplexing/
https://news.ycombinator.com/item?id=28944426
Big news in one gpu many VMs! https://t.co/Nys4kguHWG this lays a lot of groundwork to be able to do even more around sharing a GPU with multiple different virtualized VMs
— wendell (@tekwendell) October 15, 2021
https://forum.level1techs.com/t/libvf-io-a-commodity-gpu-multiplexing-tool-driven-by-vfio-yaml/177192/14
https://github.com/Arc-Compute/libvf.io
https://discuss.linuxcontainers.org/t/vms-virgl-and-or-mdev-gpu-acceleration/12550/2
https://looking-glass.io/
网友评论已有0条评论, 我也要评论