Use our vhost fork for all crates and add GPU flake package
Use our vhost fork for all crates. It has SHMEM and GPU backend support. Add a Nix flake package for vhost-device-gpu with the virgl backend enabled. Also fixes duplicate imports in vhost-device-gpu/src/backend/virgl.rs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
329129e72d
commit
1c021aaea6
19 changed files with 695 additions and 463 deletions
1049
Cargo.lock
generated
1049
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -15,6 +15,7 @@
|
|||
in
|
||||
{
|
||||
packages = forAllSystems (pkgs: {
|
||||
vhost-device-gpu = pkgs.callPackage ./packages/vhost-device-gpu.nix { };
|
||||
vhost-device-sound = pkgs.callPackage ./packages/vhost-device-sound.nix { };
|
||||
default = pkgs.callPackage ./packages/vhost-device-sound.nix { };
|
||||
});
|
||||
|
|
|
|||
47
packages/vhost-device-gpu.nix
Normal file
47
packages/vhost-device-gpu.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
pkg-config,
|
||||
virglrenderer,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "vhost-device-gpu";
|
||||
version = "0.2.0";
|
||||
|
||||
src = lib.cleanSource ./..;
|
||||
|
||||
cargoHash = "sha256-IJ7H5T3f4rCcnrlC6ihbcKWtYAY44sdY1gMgVq7PylU=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
rustPlatform.bindgenHook
|
||||
];
|
||||
buildInputs = [
|
||||
virglrenderer
|
||||
];
|
||||
|
||||
cargoBuildFlags = [
|
||||
"--package"
|
||||
"vhost-device-gpu"
|
||||
];
|
||||
cargoTestFlags = [
|
||||
"--package"
|
||||
"vhost-device-gpu"
|
||||
];
|
||||
|
||||
buildNoDefaultFeatures = true;
|
||||
buildFeatures = [ "backend-virgl" ];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
homepage = "https://git.dsg.is/dsg/vhost-device";
|
||||
description = "virtio-gpu device using the vhost-user protocol (vmsilo fork)";
|
||||
license = [
|
||||
lib.licenses.asl20
|
||||
lib.licenses.bsd3
|
||||
];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
})
|
||||
|
|
@ -11,7 +11,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
|
||||
src = lib.cleanSource ./..;
|
||||
|
||||
cargoHash = "sha256-mw0zOCOOT2LmFUGzC4n3YES6R7eaofMsaSYWJpLooAM=";
|
||||
cargoHash = "sha256-IJ7H5T3f4rCcnrlC6ihbcKWtYAY44sdY1gMgVq7PylU=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ log = "0.4"
|
|||
libc = "0.2.182"
|
||||
thiserror = "2.0"
|
||||
futures-executor = { version = "0.3", features = ["thread-pool"] }
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ log = "0.4"
|
|||
thiserror = "2.0"
|
||||
queues = "1.0.2"
|
||||
socketcan = "3.5.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ env_logger = "0.11"
|
|||
epoll = "4.4"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ env_logger = "0.11"
|
|||
libc = "0.2"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ log = "0.4"
|
|||
rutabaga_gfx = "0.1.75"
|
||||
thiserror = "2.0.18"
|
||||
virglrenderer = { git = "https://gitlab.freedesktop.org/mtjhrc/virglrenderer-rs.git", branch = "map_info", optional = true }
|
||||
vhost = { git = "https://github.com/mtjhrc/vhost.git", branch = "shmem", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://github.com/mtjhrc/vhost.git", branch = "shmem" }
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17.0"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ use std::{
|
|||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use libc::c_void;
|
||||
use log::{debug, error, trace, warn};
|
||||
use rutabaga_gfx::RutabagaFence;
|
||||
use thiserror::Error as ThisError;
|
||||
use vhost::vhost_user::{
|
||||
gpu_message::{
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ env_logger = "0.11"
|
|||
libc = "0.2"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ log = "0.4"
|
|||
rand = "0.10.0"
|
||||
tempfile = "3.26"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ log = "0.4"
|
|||
rand = "0.10.0"
|
||||
tempfile = "3.26"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ env_logger = "0.11"
|
|||
itertools = "0.14"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ env_logger = "0.11"
|
|||
epoll = "4.4"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ clap = { version = "4.5", features = ["derive"] }
|
|||
env_logger = "0.11"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ env_logger = "0.11"
|
|||
libc = "0.2"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ env_logger = "0.11"
|
|||
libc = "0.2"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
vm-memory = "0.17.1"
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ env_logger = "0.11"
|
|||
epoll = "4.4.0"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
vhost = { version = "0.15", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = "0.21"
|
||||
vhost = { git = "https://git.dsg.is/dsg/vhost.git", features = ["vhost-user-backend"] }
|
||||
vhost-user-backend = { git = "https://git.dsg.is/dsg/vhost.git" }
|
||||
virtio-bindings = "0.2.5"
|
||||
virtio-queue = "0.17"
|
||||
virtio-vsock = "0.11"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue