virtio-nvgpu — modul az NVIDIA GPU hozzáférésének biztosítására KVM virtuális gépekből

A virtio-nvgpu project is developing a virtio device that allows access to NVIDIA GPUs from guest systems running under the KVM hypervisor, with minimal performance loss. It includes a kernel module loaded in the guest system and a virtio device running on the host environment. The kernel module code is written in C and distributed under the GPLv2 license, while the virtio device code is written in Rust and distributed under the Apache 2.0 license.

According to developers' estimates, performance loss when accessing the GPU does not exceed 2%. High speed is achieved by redirecting ioctl calls to the native NVIDIA driver and operating at the ABI level of the NVIDIA driver, without translating requests at the API level. On the guest system side, standard libraries and high-level NVIDIA drivers operate in user space.

A kernel module is loaded in the guest system that provides device files /dev/nvidiactl, /dev/nvidia0…N, /dev/nvidia-uvm and forwards ioctl() and mmap() calls through a virtqueue to a handler on the host-side environment, which passes them to the host's NVIDIA driver. To eliminate context switches between the host system and the virtual machine, command buffers are reflected (mmap) in shared memory, accessible to both the host environment and GPU.

Unlike exclusive GPU access passthrough (VFIO Passthrough), the virtio-nvgpu project provides shared access to a single GPU from multiple instances. virtuális gépekhez, and unlike virtio-gpu (Venus, VirGL), it operates through ABI passthrough to the NVIDIA driver rather than at the level of translating Vulkan and OpenGL graphics APIs. The downsides of virtio-nvgpu include the lack of full isolation based on IOMMU (guest systems operate through the host’s NVIDIA driver and are limited only by ioctl call filtering) and the dependency on the NVIDIA driver ABIs (the ABI changes with each version and requires adaptation of virtio-nvgpu).

The capabilities of virtio-nvgpu are sufficient for rendering, video encoding, and computations using the Vulkan, OpenGL, NVENC, and CUDA APIs. Its primary use case includes creating cloud gaming services or virtual workstations, where a game or graphical application runs in virtuális gépben, amelyben a renderelés zajlik, az NVENC használatával történik a kimenet hardverkódolása, és a kimenet tömörített videófolyamban kerül átadásra a távoli felhasználónak.

Forrás: opennet.ru

Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster