The venus protocol facilitates the translation of Vulkan API calls via the virglrenderer. To use it, the virgl-server package must be installed on the host.
The Vulkan option is represented by an enum with values such as 'venus-512' and 'venus-1024'. This is to allow for the potential addition of another Vulkan implementation in the future. The number indicates the memory window in MiB for Venus. Signed-off-by: Markus Frank <[email protected]> --- src/PVE/QemuServer.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index cf195ccc..2b358e9f 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -160,6 +160,12 @@ my $vga_fmt = { qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware) ], }, + vulkan => { + description => 'Enable vulkan by using the venus protocol.', + type => 'string', + enum => ['venus-512', 'venus-1024', 'venus-2048', 'venus-4096', 'venus-8192'], + optional => 1, + }, memory => { description => "Sets the VGA memory (in MiB). Has no effect with serial display.", type => 'integer', @@ -1499,6 +1505,15 @@ sub print_vga_device { $pciaddr = print_pci_addr($vgaid, $bridges, $arch); } + my $venus = ""; + if ($vga->{vulkan} && $vga->{vulkan} =~ /^venus-(\d+)/) { + my $virgl_memory_window = $1; + $venus = ",hostmem=${virgl_memory_window}M,venus=on,blob=on"; + + die "You need to use virtio-gl to enable vulkan (venus) support!\n" + if $vga->{type} !~ /^virtio-gl/; + } + if ($vga->{type} eq 'virtio-gl') { my $base = '/usr/lib/x86_64-linux-gnu/lib'; die "missing libraries for '$vga->{type}' detected! Please install 'libgl1' and 'libegl1'\n" @@ -1507,9 +1522,12 @@ sub print_vga_device { die "no DRM render node detected (/dev/dri/renderD*), no GPU? - needed for '$vga->{type}' display\n" if !PVE::Tools::dir_glob_regex('/dev/dri/', "renderD.*"); + + die "missing virgl render server for vulkan (venus)! Please install 'virgl-server'.\n" + if $vga->{vulkan} && !-e "/usr/libexec/virgl_render_server"; } - return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}"; + return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}${venus}"; } sub vm_is_volid_owner { -- 2.47.3 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
