Stateful snapshots with GPU?

I’m looking for alternatives to VMware which can provide 3D acceleration to a guest and snapshot a live session to disk and restore it at a later point in time just as the VM guest was prior to the snapshot, no state lost.

My understanding is this snapshot support in incus is through CRIU? I am aware of plugins for AMD and Nvidia GPUs, but they seem to be focused on CUDA/ROCm only, not graphics API like Vulkan?

I am primarily seeking the ability to run a GUI app (or full workspace with multiple apps) where I can snapshot that workspace to free resources and restore later, but I’d really like to retain a smooth interactive experience like on a host compositor. I don’t need any demanding GPU processing / rendering beyond that basic constraint.

Would anyone be able to confirm if incus can support this use-case? Or am I correct that the GPU snapshot support is only for compute and would fail restoring a guest using a desktop compositor?

CRIU is used for stateful snapshots of containers but it very rarely works with general purpose containers, it instead works much better for workloads that are specifically designed for this. And yeah, GPU state snapshot is quite new in CRIU and mostly focused around AI/LLM stuff rather than graphics.

The best solution here is to run an Incus VM instead which can then much more easily be snapshotted including running state and restored at a later point, though that would only work with the normal virtual GPU. If a physical GPU is passed to the guest, then things get very tricky again.

1 Like

Ah OK thanks. I’ve been reaching out in a few places and from what I understand VMware Player (now EOL) allowed a Linux guest to use OpenGL and performed API forwarding to host GPU drivers, possibly via some proprietary IR that was mapped to Vulkan calls through a host process that interacted with the host drivers.

VirGL and Venus are apparently similar with virtio-gpu in the VM guest, but using 3D accel with that guest device apparently lacks the ability to do a session snapshot of a guest while running like VMware Player supported.

CrosVM insteadoof QEMU has some experimental support in place that can snapshot a guest session using 3D accel and restore it, but I hear it’s not always successful.

Incus seems to be at a higher level? So I’m probably in the wrong place here, and need to explore the above info myself once I get the chance. I really would like an OSS solution if I can make that work.

Cheers :slightly_smiling_face: