about summary refs log tree commit diff
path: root/software/cloud-hypervisor/index.html
blob: 588a19edcce4ea3f9d6ddb8050b677b03e5c4a26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!doctype html>
<!-- SPDX-FileCopyrightText: 2019-2020, 2022, 2024 Alyssa Ross <hi@alyssa.is> -->
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-or-later -->
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link rel="icon" href="../..logo/logo_html.svg">
<link rel="stylesheet" href="../../style.css">

<title>Cloud Hypervisor with virtio-gpu support</title>

<body>

<nav>
  <a href="../..">Spectrum</a>
</nav>

<h1>Cloud Hypervisor with virtio-gpu support</h1>

<p>
This is a patchset for <a href="https://cloudhypervisor.org/">Cloud
Hypervisor</a> support providing a virtio-gpu device to guests,
using <a href="https://crosvm.dev/">crosvm</a>’s virtio-gpu
implementation
over <a href="https://www.qemu.org/docs/master/interop/vhost-user.html">vhost-user</a>.

<p>
If this patchset is useful to you, please consider donating to support
its continued development via
either <a href="https://github.com/sponsors/alyssais">GitHub
Sponsors</a> or <a href="https://liberapay.com/qyliss">LiberaPay</a>.

<p>
The patches as developed as part of <a href="../..">Spectrum</a>, a
compartmentalized desktop operating system project.

<h2>Building</h2>

It’s necessary to patch both Cloud Hypervisor itself, and
the <a href="https://github.com/rust-vmm/vhost/tree/main/vhost">vhost</a>
crate.  The Cloud Hypervisor patches expect to find the patched vhost
source tree under the same parent directory as Cloud Hypervisor’s.

<ol>
  <li>
  Clone the repositories
  for <a href="https://github.com/cloud-hypervisor/cloud-hypervisor">Cloud
  Hypervisor</a>
  and <a href="https://github.com/rust-vmm/vhost">vhost</a>.  Make
  sure the revision of the vhost repository you have checked out
  contains the versions of the vhost and vhost-user-backend crates
  expected by your version of Cloud Hypervisor.

  <li>
  Download and apply the patches for the correct versions of Cloud
  Hypervisor and vhost.

  <li>
  Use <code>cargo build</code> in the Cloud Hypervisor source tree as
  normal.
</ol>

<h2>Usage example</h2>

Start the crosvm GPU device:

<pre><code>crosvm device gpu --socket gpu.sock</code></pre>

Connect to the GPU device with cloud-hypervisor:

<pre><code>cloud-hypervisor --gpu socket=gpu.sock …</code></pre>

<h2>Downloads</h2>

<ol reversed style="list-style-type: none; padding-left: 0;">
  <li><a href="https://spectrum-os.org/software/cloud-hypervisor/cloud-hypervisor-37.0-spectrum0-patches.tar.xz">cloud-hypervisor-37.0-spectrum0-patches.tar.xz</a>
</ol>

<h2>Contributing</h2>

<p>
The patches are maintained
in <a href="https://spectrum-os.org/git/spectrum">Spectrum’s git
repository</a>.  Please refer to the documentation
for <a href="https://spectrum-os.org/doc/contributing/">contributing
to Spectrum</a>.

<h2>Can these patches be upstreamed?</h2>

<p>
I don’t think so.  The Cloud Hypervisor developers
are <a href="https://github.com/cloud-hypervisor/cloud-hypervisor/issues/3212#issuecomment-937823742">not
very interested</a> 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 <a href="https://www.qemu.org/docs/master/interop/vhost-user.html">vhost-user
specification</a>.

<p>
It’s possible that, in future, it might be possible to use an external
virtual GPU device with an unmodified Cloud Hypervisor
using <a href="https://spdk.io/news/2021/05/04/vfio-user/">vfio-user</a>
or <a href="https://lore.kernel.org/qemu-devel/20230901110018.3704459-1-alex.bennee@linaro.org/"><code>VHOST_USER_PROTOCOL_F_PROBE</code></a>,
or that at least the custom vhost-user commands could be standardized.

<p>
Other Cloud Hypervisor work is
regularly <a href="https://github.com/cloud-hypervisor/cloud-hypervisor/commits?author=alyssais">upstreamed</a>
as part of the Spectrum project.

<h2>Bug reports and other questions</h2>

<p>
Bug reports for and other questions about the patchset are welcome!
You can send mail to
the <a href="mailto:discuss@spectrum-os.org">discuss@spectrum-os.org</a>
<a href="https://spectrum-os.org/doc/contributing/communication.html#mailing-lists">mailing
list</a>, or ask in the
Spectrum <a href="https://spectrum-os.org/doc/contributing/communication.html#chat">Matrix
chat</a>.

<hr>

<p>
<small>Permission is granted to copy, distribute and/or modify this
document under either the terms of the
<a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative
Commons Attribution-ShareAlike 4.0 International License</a>, or the
<a href="https://www.gnu.org/licenses/fdl-1.3.html">GNU Free
Documentation License, Version 1.3</a> or any later version published
by the Free Software Foundation; with no Invariant Sections, no
Front-Cover Texts, and no Back-Cover Texts.</small>

<p>
<a href="impressum.html" lang="de"><small>Impressum</small></a>