Commit 7720e0f
committed
muvm: use HK_SYSMEM to set VRAM limit
By default, HK sets the heap size to be half the size of the *guest*
memory. Since commit 167744dc it's also possible to override the heap
size by setting the HK_SYSMEM environment variable.
Previously, the vram command line option was acting on the virtio-gpu
SHM window. This didn't help in most cases because userspace doesn't
really care nor is aware of it.
Here, we set the SHM window of virtio-gpu to always be as large as the
host's RAM, not because we expect VRAM to consume 100% of the RAM (which
is obviously impossible) but to account for region fragmentation. Then,
we use HK_SYSMEM to tell userspace the desired heap size (the closest
thing to VRAM we can aim for), which will be set to either the value
passed by the user throught the "vram" argument or half the size of the
*host* RAM.
Signed-off-by: Sergio Lopez <[email protected]>1 parent 92e39e7 commit 7720e0f
2 files changed
+21
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
158 | 168 | | |
159 | 169 | | |
160 | 170 | | |
| |||
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
188 | | - | |
| 198 | + | |
189 | 199 | | |
190 | 200 | | |
191 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
| |||
0 commit comments