From nobody Tue Jul 28 11:48:14 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 4h8Yd90bmBz6mdrd for ; Tue, 28 Jul 2026 11:48:29 +0000 (UTC) (envelope-from zishun.yi.dev@gmail.com) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h8Yd83b4wz3tBS for ; Tue, 28 Jul 2026 11:48:28 +0000 (UTC) (envelope-from zishun.yi.dev@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20251104 header.b=BrokGlNJ; arc=pass ("google.com:s=arc-20260327:i=1"); spf=pass (mx1.freebsd.org: domain of zishun.yi.dev@gmail.com designates 2607:f8b0:4864:20::1033 as permitted sender) smtp.mailfrom=zishun.yi.dev@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-38dc4553f62so3664487a91.0 for ; Tue, 28 Jul 2026 04:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1785239306; cv=none; d=google.com; s=arc-20260327; b=i29ozN5Qqom/ziIex4OB5cfX/A6tolrikQANBMOcj/cwnaVlQay7iUh5an7A7FD9OU 2lxq0OiemaHHiZwzpn1GFgVjiX2euDOExCTZ5uj9Z0JWS+0f2U5MBftLBarWTPWvG/WG Ko+eWqt0x2AV3QINcXdHCRBKSCfb+yedyoVEEYNIHHAJrgOcwCJUdYYMW5RCQ/00kHnX xxqMMvysAkcp7vG468TfsPkzPCtHQt7BR+AG+3WWLHH7Odv8chTwNw8Y2DUPvkLTR/Yg FlaMYYM9w0iH5Teo8Ogpbl6I3nC3KFIIYc8ujo22BN3gtPRvuT9SMTEQPmow4cZRd/Mk nbXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=9xxocEsItYG2gqTFY3XVXIm0GDCoTBJnuMkInw/nixU=; fh=+h7sNsadiC8HnL9apKk+YSZeCLvYCsUz6PNNMJsPQLU=; b=WTUu2vtxXVIFGSB5RlqLESoJEXodjnONzZplFCcNpVerSRcO6Et5BwCb/bgx75Vupw FyHQwa2ZwQWgi0aBD0ElJ3o7JywLKs4mhtLRa56TJSfPtza1JEXAoylbuoyzza2mffMS h5ffawdpBMDC9wVaK8JeGCGijTv/+0eUrVCwu76fvwek72moe/JmrDFY7e5Ne6lGXtnH VwzrPJfb0+Afy22inYFz5RCU3a3kxoh5iW+b0cAKHIDcQtox/Yb/76pOXHZW235fuyFl hQ8cw4HDgOUXXEUY0n7FlNwQwVRbvV75OHcJt/00hsAUkXAcmXMLs80KG92QVQ5/EO+k oVyg==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785239306; x=1785844106; darn=freebsd.org; h=content-type:cc:to:subject:message-id:date:from:mime-version:from :to:cc:subject:date:message-id:reply-to:content-type; bh=9xxocEsItYG2gqTFY3XVXIm0GDCoTBJnuMkInw/nixU=; b=BrokGlNJCP7vDmpO6IwcnESFGomacodTh8b8poa4t6+B6/b8iJqEvIyPcWvYH5hurF KnCq6jNLmyejdHr8gtRbS/POcDILYVckeORnE616EsZiQPQG8UyRrrQear1om7A79Uqb qlg874HpBSCAENJ1mpIictQrGbJF5yWxzZNgBq6WJ5RUV1cv42YiI1O80zcNjga/HDNA fToMpCq2Jqcfbf01YDWaCEeBdDA7Ys3Ahw3eeWmC7M8F/ujsHRfctSnzMSv4L6yaWvtG 1k3PHpOhrOAfsJ6b0bpgmgY9eJUS9ezEMmWh9+ZjEA5YCHELIer/FsLcdVWBlzoO7Ng3 L6wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785239306; x=1785844106; h=content-type:cc:to:subject:message-id:date:from:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=9xxocEsItYG2gqTFY3XVXIm0GDCoTBJnuMkInw/nixU=; b=ZMCslXJinlsfmhJ/AD/YHi8RdxItkuWSGRDLgBg5kfJdRSEFDoDEHuuRduiOx51/6G VGBXhH5vY7XjhVHn8M/ujxGoIF7lQNXOjcjDnyTFUHo9eMZGLbXIl1By/+BimQ92omXK OswbDSmRD8xtEf2EKrzn2fXMo57ZGRqvEjGMS6cMKDzq0MsPTJKVmp/oeICLcVCPkiiq aLQ3vUgAXSzHHvdIEPpn+YWXjjnzdnMywIzkAb1EeBrVlkPdXcolCwJGhcXCIimJQvGi apjcL1UXKJ+Bu7d9QsSZKwTGgpsVOqIWD8j0tVb7WAt8t/qfF+UJ2LVS6oleq+zlk0Yc ZtsQ== X-Gm-Message-State: AOJu0YyiS7dW9iMKFQFykai2CUqG0oqjkcg1tQBCF1/ySsc7NaAFfU1n OKqxzH8Y2MOXcqR+I+aqcq7qsKHRpXQAZfRs0TVp86XnGjzla60iLniTg/Sh2NZswM/8zQ8Hd73 8bRO5VookrfBtAtrrkcld5Ydfe7HsMFkRr+PzBaIJaLGsNZw= X-Gm-Gg: AR+sD11w17fZ76RtUAqpHHtxqbEUCmC3f68eGbP4bBnEL1qoq+hizAMtJxyREEz4GEN apkCJb+CovABbI7yV6mh3MxtCxfaf7AggK8Xi1xMo67L6x9nseHkp/1ivsUU9CjelsWU3LP7JA/ F8vGnEvCeeJ/r8F1YC0hAqLJuQIttExUOtIHZVFzdSymLf2odEbjxzT0HpdAX7q9s96HkFlSjrA aTDt/jbInJN8vHa2PFTtmHj5vseDnyS4133pmzn1Y3kajpRWgfB8amOBL5FvcRe+cqAObE5XvtS 7psqx3B+1JOO6A3hnr/aGuTovAFqhbmutXDyEct8tj24gcQFFzI9wTewzW961gptfeYnB5xaxVC 4 X-Received: by 2002:a17:90b:2782:b0:38e:5717:9cc8 with SMTP id 98e67ed59e1d1-38f6a45d31emr2494967a91.31.1785239305917; Tue, 28 Jul 2026 04:48:25 -0700 (PDT) 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 From: yi zishun Date: Tue, 28 Jul 2026 19:48:14 +0800 X-Gm-Features: AUfX_mwL_pwGOI3S6ktd-sQZIVtN1hMA8GxR2OEljcRuWr_9_Z_gb5qYRQagK0I Message-ID: Subject: Worth adding another graphics option to bhyve? To: FreeBSD Hackers Cc: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20251104]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TAGGED_FROM(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROMTLD(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1033:from] X-Rspamd-Queue-Id: 4h8Yd83b4wz3tBS X-Spamd-Bar: --- 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