From nobody Tue Jul 28 11:59:34 2026 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h8YtB5ChHz6mflW; Tue, 28 Jul 2026 11:59:46 +0000 (UTC) (envelope-from vermaden@interia.pl) Received: from smtpo75.interia.pl (smtpo75.interia.pl [217.74.67.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4h8Yt93SJ9z3wN6; Tue, 28 Jul 2026 11:59:45 +0000 (UTC) (envelope-from vermaden@interia.pl) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=interia.pl header.s=dk header.b=Yno3v5fT; spf=pass (mx1.freebsd.org: domain of vermaden@interia.pl designates 217.74.67.75 as permitted sender) smtp.mailfrom=vermaden@interia.pl; dmarc=pass (policy=none) header.from=interia.pl Date: Tue, 28 Jul 2026 13:59:34 +0200 From: vermaden Subject: Re: Worth adding another graphics option to bhyve? To: yi zishun , FreeBSD Hackers Cc: "freebsd-virtualization@freebsd.org" X-Mailer: interia.pl/pf09 In-Reply-To: References: X-Originating-IP: 45.148.42.19 Message-Id: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=dk; t=1785239977; bh=UgpMJctf0gmBlIvg5mH0gNlWqrqXkc5HZbxvchf7otg=; h=Date:From:Subject:To:Message-Id:MIME-Version:Content-Type; b=Yno3v5fT7Iy4csBUZkxKwW0US16i4YbQSdFxatGvLnlNp++xE5sPezF7SBUR1wI3O /AhJzrRmQoqLav4lIgAdhkUXJFimFJZ2x35hHzpr/y1MaLW/69saTH0teW8ZCiPSi1 HEGSGVhHz7By4nGODKltxxPUGRKDhEzHv8yFuhqo= X-Spamd-Result: default: False [-2.42 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_HAM_SHORT(-0.99)[-0.989]; NEURAL_HAM_LONG(-0.93)[-0.934]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[interia.pl,none]; R_SPF_ALLOW(-0.20)[+ip4:217.74.64.0/22]; R_DKIM_ALLOW(-0.20)[interia.pl:s=dk]; RWL_MAILSPIKE_GOOD(-0.10)[217.74.67.75:from]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[interia.pl]; TO_DN_SOME(0.00)[]; SUSPICIOUS_AUTH_ORIGIN(0.00)[]; FREEMAIL_TO(0.00)[gmail.com,freebsd.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; HAS_XOIP(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[interia.pl:+]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org,freebsd-virtualization@freebsd.org]; TAGGED_RCPT(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FREEMAIL_ENVFROM(0.00)[interia.pl]; ASN(0.00)[asn:16138, ipnet:217.74.64.0/22, country:PL]; DWL_DNSWL_NONE(0.00)[interia.pl:dkim] X-Rspamd-Queue-Id: 4h8Yt93SJ9z3wN6 X-Spamd-Bar: -- Temat: Worth adding another graphics option to bhyve? Data: 2026-07-28 13:48 Nadawca: "yi zishun" Adresat: "FreeBSD Hackers" ; DW: freebsd-virtualization@freebsd.org; > Hi, hackers > > As the title suggests, briefly speaking, the proposed option > is a combination of "vhost-user-gpu" and another display > backend (for example, a D-Bus backend). > > Currently, bhyve has two main approaches for graphics > rendering and display. One is fbuf+VNC for 2D graphics, > and the other is GPU passthrough mainly for 3D workloads. > Both approaches have some obvious drawbacks. For > example, fbuf is non-accelerated and VNC does not > support zero-copy transfer, which makes fbuf+vnc have > poor performance. GPU pci passthrough has excellent > performance. But due to its exclusive use, the host > cannot access the GPU anymore, not to mention > supporting multiple VMs. > > I understand why these two designs exist: because > bhyve is part of the base system, we cannot introduce > GPL-licensed software or heavy graphics dependencies. > So it is better, if there is an option, with a minimal > implementation without any heavy dependence, but still > can use modern graphics stack render and display > capabilities, and can support multiple VM. > > My motivation for this proposal stems from my GSoC > work on udmabuf. With the underlying zero-copy buffer > sharing mechanism now in place, I wanted to explore > how bhyve could natively utilize it to overcome the > current performance bottlenecks in graphics rendering > and displaying. > > For rendering, we can implement a device which > presents itself to the guest kernel as a virtio-gpu > device, but does not process any commands internally, > the main virtqueue is handled by a separate userspace > program, vhost-user-gpu. And the device > communicates to vhost-user-gpu using vhost-user > protocol. One implementation of vhost-user-gpu is > rust-vmm's vhost-device-gpu, which processes the data > and sends the rendered image back to QEMU/bhyve for > display, and currently supports gtk and dbus backend as > far as I know. We can then implement a new display > backend, dbus backend, to dispatch the display to > another program, too. But we can't introduce dbus into > the base system, so maybe we need another out-of-tree > small proxy to do the conversion. > > In conclusion, this approach dispatches the actual > rendering and display tasks to two separate programs. > bhyve only presents itself as a virtio-gpu device from the > guest's point of view, and communicates to the two > programs internally. This option is minimal, modular, and > secure, leveraging the modern graphics stack to support > multiple VMs without requiring dedicated hardware > support, while providing the benefits of virtio-gpu. > > I would appreciate any feedback and discussion on the > feasibility of this approach. If the idea is considered > worthwhile, I am willing to invest the time and effort > required to implement it. > > Best, > Zishun Yi Hi, the thing You mentioned is - as much as i like Bhyve - one of the biggest issues with Bhyve - and its really obvious after you migrate from VirtualBox into Bhyve world for example. Personally I would love to see such thing happening - if only You can invest that time - it will not be a wasted time - its very valuable and important thing. Thanks, vermaden