Virtio GL VirGL encoding/decoding

jasonwch

New Member
Feb 13, 2025
6
0
1
Hi all, I've setup both Win11 and Linux Mint VM on PVE latest version, and also performed "apt install libgl1 libegl1" on host

Then I've chose VirGL for both VM. But seems I cannot get h264/h265 capability on both machine.

Why I assume I do not have those encoding, because I use Rustdesk to remote in the machine, and Rustdesk have h264/h265 encoding available if I switch to use GPU passthrough on Win11 VM. But then I switch back to VirGL, those options went away.

On Linux Mint VM:
vainfo shows:
Code:
vainfo
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/virtio_gpu_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 24.2.8-1ubuntu1~24.04.1 for virgl (Mesa Intel(R) UHD Graphics 630 (CML GT2))
vainfo: Supported profile and entrypoints
      VAProfileNone                   :    VAEntrypointVideoProc


Did I miss something?
 
VirGL is a dead technology, it maybe works with some Linux guests for OpenGL acceleration. It hasn’t seriously been worked on and hasn’t had working Windows drivers since XP. Modern server GPU (Intel and nVIDIA) both support some form of virtualization.

This works though: https://github.com/JHRobotics/softgpu for Windows 9x
 
Last edited:
VirGL is a dead technology, it maybe works with some Linux guests for OpenGL acceleration. It hasn’t seriously been worked on and hasn’t had working Windows drivers since XP. Modern server GPU (Intel and nVIDIA) both support some form of virtualization.

This works though: https://github.com/JHRobotics/softgpu for Windows 9x
So except from GPU passthrough, no way to get on hardware encoding?

The reason why I didnt turn on is for Windows is fine, but if I turn on passthrough for my Linux (Mint), it still didnt do the encoding.

I'd prefer to use virtual graphic and enable encoding. If not, any way I can enable encoding for Linux on Intel HD 630 (iGPU) passthrough? some driver needed?
 
vGPU (SR-IOV) is not GPU passthrough. VirGL is for OpenGL, not stream encoders.

You can virtualize most Intel GPU - https://www.intel.com/content/www/us/en/support/articles/000093216/graphics/processor-graphics.html

 
Thanks for Intel driver, may I know how about inside guest Linux Mint? I can see it's using i915, mesa driver inside. Any needs to update?

And do you mean GVT-g is SR-IOV but not GPU passthrough (I am using GVT-G setup and able to split the GPU for Windows and Linux guest)

And back to VirtGL, I can see h264/h265 should be possible as below?

Post in thread 'VirGL hardware accelerated h264/h265' https://forum.proxmox.com/threads/virgl-hardware-accelerated-h264-h265.137023/post-743564
 
Last edited:
You may need the current Intel drivers inside a Linux guest, they are built in to most kernels, the setup above should work for any recent guest OS.

Correct, GVT-g is like SR-IOV that you are not passing the entire GPU exclusively for 1 guest.

I see by patching the QEMU binary you can pass some h264 functions through OpenGL/Mesa in Linux, but your applications need to be able to use the limited VA-API. Maybe ffmpeg may be able to use it. But I don’t think it is really functional for most end users, you could use containers at that point as well.
 
You may need the current Intel drivers inside a Linux guest, they are built in to most kernels, the setup above should work for any recent guest OS.

Correct, GVT-g is like SR-IOV that you are not passing the entire GPU exclusively for 1 guest.

I see by patching the QEMU binary you can pass some h264 functions through OpenGL/Mesa in Linux, but your applications need to be able to use the limited VA-API. Maybe ffmpeg may be able to use it. But I don’t think it is really functional for most end users, you could use containers at that point as well.
thanks, I am now using gvt-g and seems vainfo shown h264 encoding supported. However, Rustdesk still not offer H264 as an option, do you think I need to switch driver being used in Linux Mint guest, or it's Rustdesk issue?