I tried running with `crosvm --gpu`, but after `modprobe virtio-gpu`, crosvm crashed with:
[ 31.326763] Invalid ELF header magic: != ELF [ 31.331450] [drm] pci: virtio-gpu-pci detected at 0000:00:07.0 [ 31.333020] [drm] Host memory window: 0x200000000 +0x200000000 [ 31.333983] [drm] features: +virgl -edid +resource_blob +host_visible [ 31.333984] [drm] features: +context_init [ 31.337289] [drm] number of scanouts: 1 [ 31.337938] [drm] number of cap sets: 1 [ERROR:src/linux.rs:3264] child pcivirtio-gpu (pid 63446) died: signo 17, status 11, code 2 [ERROR:devices/src/proxy.rs:212] failed write to child device process pcivirtio-gpu: failed to send packet: Broken pipe (os error 32)
Then I tried with `--gpu=backend=2d` and that didn't crash, but instead opened a window showing some bootloader stuff. I now have /dev/dri/{card0, renderD128} devices, so I guess the next step is figuring out what they do!
When I've previously attempted this, I had some crosvm thread crash with a seccomp violation because it tried to log something. If you --disable-sandbox, it might work or at least give you a clearer error message.
Good luck! Let me know if I can help with anything else.
If you happen to know of any documentation, that would be great. But I guess I probably just need to spend a load of time reading crosvm, Linux, and Sommelier source code.
There might be some helpful stuff in the Mesa repo as well, because lots of the latest graphics stuff is being done for crosvm. A quick grep found me the Venus (Vulkan over virtio-gpu) documentation, which describes testing with crosvm, and the script they use to run crosvm in CI. It also reminded me that there are two different virgl implementations in crosvm, virgl_renderer and virgl_renderer_next. I think last time I tried I had better luck with virgl_renderer. You can set buildFeatures in the Nix expression to experiment with them. I hope some of that's helpful. I really wish I'd taken better notes the one time I got this to work.