Skip to content

Commit 391e32b

Browse files
Dorinda Basseystefano-garzarella
authored andcommitted
vhost-device-gpu: Add Initial Implementation
This program is a vhost-user backend daemon that provides VIRTIO GPU device emulation as specified in the VIRTIO Spec v.1.2 https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html This crate utilizes the rutabaga crate from crosvm with some minor modification to rutabaga crate to fix compilation. This crate depends on this PR[rust-vmm/vhost#239] that implements support for QEMU's vhost-user-gpu protocol. This device uses the rutabaga_gfx crate to offer two rendering backends: 1. Virglrenderer: - Rutabaga translates OpenGL API and Vulkan calls to an intermediate representation and allows for OpenGL acceleration on the host. 2. Gfxstream: - GLES and Vulkan calls are forwarded to the host. These backends can be used by simply changing the `--gpu-mode` command line option. This crate also includes some modifications from libkrun virtio-gpu device https://github.com/containers/libkrun/tree/main/src/devices/src/virtio/gpu Fixes: #598 Co-authored-by: Dorinda Bassey <[email protected]> Co-authored-by: Matej Hrica <[email protected]> Signed-off-by: Dorinda Bassey <[email protected]> Signed-off-by: Matej Hrica <[email protected]>
1 parent b7321b7 commit 391e32b

File tree

14 files changed

+4652
-2
lines changed

14 files changed

+4652
-2
lines changed

staging/Cargo.lock

Lines changed: 189 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[workspace]
22
resolver = "2"
33
members = [
4+
"vhost-device-gpu",
45
"vhost-device-video",
56
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"coverage_score": 74.82,
2+
"coverage_score": 79.80,
33
"exclude_path": "",
44
"crate_features": ""
55
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
## Unreleased
3+
4+
### Added
5+
6+
### Changed
7+
8+
### Fixed
9+
10+
### Deprecated
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[package]
2+
name = "vhost-device-gpu"
3+
version = "0.1.0"
4+
authors = ["Dorinda Bassey <[email protected]>", "Matej Hrica <[email protected]>"]
5+
description = "A virtio-gpu device using the vhost-user protocol."
6+
repository = "https://github.com/rust-vmm/vhost-device"
7+
readme = "README.md"
8+
keywords = ["gpu", "vhost", "vhost-user", "virtio"]
9+
categories = ["multimedia::video", "virtualization"]
10+
license = "Apache-2.0 OR BSD-3-Clause"
11+
edition = "2021"
12+
publish = false
13+
14+
[features]
15+
xen = ["vm-memory/xen", "vhost/xen", "vhost-user-backend/xen"]
16+
17+
[dependencies]
18+
clap = { version = "4.4", features = ["derive"] }
19+
env_logger = "0.11.5"
20+
libc = "0.2"
21+
log = "0.4"
22+
23+
[target.'cfg(not(target_env = "musl"))'.dependencies]
24+
rutabaga_gfx = { version = "0.1.4", features = ["gfxstream", "virgl_renderer"] }
25+
thiserror = "2.0.3"
26+
vhost = { version = "0.13.0", features = ["vhost-user-backend"] }
27+
vhost-user-backend = "0.17"
28+
virtio-bindings = "0.2.2"
29+
virtio-queue = "0.14.0"
30+
vm-memory = "0.16.1"
31+
vmm-sys-util = "0.12.1"
32+
33+
[dev-dependencies]
34+
assert_matches = "1.5"
35+
tempfile = "3.13"
36+
virtio-queue = { version = "0.14", features = ["test-utils"] }
37+
vm-memory = { version = "0.16.1", features = ["backend-mmap", "backend-atomic"] }
38+
mockall = "0.13.0"
39+
rusty-fork = "0.3.0"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE-APACHE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE-BSD-3-Clause

0 commit comments

Comments
 (0)