From e44498072c8831ea4bda03191dbffc8fa93735f6 Mon Sep 17 00:00:00 2001 From: phaer Date: Tue, 3 Oct 2023 17:18:21 +0200 Subject: [PATCH] crosvm: sync gpu params with cloud-hypervisor --- lib/runners/crosvm.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/runners/crosvm.nix b/lib/runners/crosvm.nix index 9872cf7a..5dbe8050 100644 --- a/lib/runners/crosvm.nix +++ b/lib/runners/crosvm.nix @@ -31,7 +31,14 @@ let aarch64-linux = "${kernel.out}/${pkgs.stdenv.hostPlatform.linux-kernel.target}"; }.${system}; + gpuParams = { + context-types = "virgl:virgl2:cross-domain"; + egl = true; + vulkan = true; + }; + in { + preStart = '' rm -f ${socket} ${microvmConfig.preStart} @@ -42,8 +49,8 @@ in { rm -f ${graphics.socket} ${pkgs.crosvm}/bin/crosvm device gpu \ --socket ${graphics.socket} \ - --wayland-sock $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY \ - --params '{"context-types":"virgl:virgl2:cross-domain"}' \ + --wayland-sock $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY\ + --params '${builtins.toJSON gpuParams}' \ & while ! [ -S ${graphics.socket} ]; do sleep .1