--- layout: page title: Cloud Hypervisor with virtio-gpu support ---

This is a patchset for Cloud Hypervisor support providing a virtio-gpu device to guests, using crosvm’s virtio-gpu implementation over vhost-user.

If this patchset is useful to you, please consider donating to support its continued development via either GitHub Sponsors or LiberaPay.

The patches as developed as part of Spectrum, a compartmentalized desktop operating system project.

Building

  1. Clone the repository for Cloud Hypervisor.
  2. Download and apply the patchset for the correct version of Cloud Hypervisor.
  3. Use cargo build in the Cloud Hypervisor source tree as normal.

Usage example

Start the crosvm GPU device:
crosvm device gpu --socket-path gpu.sock
Connect to the GPU device with cloud-hypervisor:
cloud-hypervisor --generic-vhost-user virtio_id=gpu,socket=gpu.sock,queue_sizes='[16,256]' …

Downloads

  1. cloud-hypervisor-50.0-spectrum0-patches.tar.gz (tested with crosvm 18bc84d00)
  2. cloud-hypervisor-49.0-spectrum0-patches.tar.gz (tested with crosvm f6de42386)
  3. cloud-hypervisor-48.0-spectrum0-patches.tar.gz (tested with crosvm 3202c663e)
  4. cloud-hypervisor-47.0-spectrum0-patches.tar.gz (tested with crosvm 940eaae72)
  5. cloud-hypervisor-46.0-spectrum0-patches.tar.gz (tested with crosvm 581ccb06d)
  6. cloud-hypervisor-45.0-spectrum0-patches.tar.gz (tested with crosvm 6b75e831d)
  7. cloud-hypervisor-44.0-spectrum0-patches.tar.gz (tested with crosvm d8e0f16c2)
  8. cloud-hypervisor-43.0-spectrum0-patches.tar.gz (tested with crosvm 9d42f9183)
  9. cloud-hypervisor-42.0-spectrum0-patches.tar.gz (tested with crosvm b7fd753b4)
  10. cloud-hypervisor-40.0-spectrum0-patches.tar.gz (tested with crosvm 6a7ff1ecb)
  11. cloud-hypervisor-39.0-spectrum1-patches.tar.gz (tested with crosvm bc2900b9c)
  12. cloud-hypervisor-39.0-spectrum0-patches.tar.gz (tested with crosvm 7c75ad618)
  13. cloud-hypervisor-38.0-spectrum0-patches.tar.xz
  14. cloud-hypervisor-37.0-spectrum0-patches.tar.xz

Contributing

The patches are maintained in Spectrum’s git repository. Please refer to the documentation for contributing to Spectrum.

Can these patches be upstreamed?

I don’t think so. The Cloud Hypervisor developers are not very interested in GPU support — although perhaps an implementation that was just a vfio-user frontend implementation, deletaging all of the complexity of rendering, input handling, etc. to another process would be light enough to overcome that — but on top of that, communicating with crosvm’s GPU device requires using non-standard commands that are not part of the vhost-user specification.

It’s possible that, in future, it might be possible to use an external virtual GPU device with an unmodified Cloud Hypervisor using vfio-user or VHOST_USER_PROTOCOL_F_PROBE, or that at least the custom vhost-user commands could be standardized.

Other Cloud Hypervisor work is regularly upstreamed as part of the Spectrum project.

Bug reports and other questions

Bug reports for and other questions about the patchset are welcome! You can send mail to the discuss@spectrum-os.org mailing list, or ask in the Spectrum Matrix chat.