KubeVirt: Difference between revisions

 
(9 intermediate revisions by the same user not shown)
Line 116: Line 116:


==vGPU==
==vGPU==
===Intel vGPU===
===Intel GVT-g===
See [https://kubevirt.io/2021/intel-vgpu-kubevirt.html#fedora-workstation-prep intel-vgpu-kubevirt]<br>
This is deprecated. Additionally, I don't recommend this due to [https://github.com/intel/gvt-linux/issues/153 stability issues].
{{hidden | Instructions |
{{hidden | Instructions |
See [https://kubevirt.io/2021/intel-vgpu-kubevirt.html#fedora-workstation-prep intel-vgpu-kubevirt] and [[Archwiki:Intel GVT-g]].
;Setup the nodes
;Setup the nodes
Run the following on each node with an Intel GPU.
Run the following on each node with an Intel GPU.
Line 134: Line 136:
pci_id=$(sudo lspci | grep -oP '([\d:\.]+)(?=\sVGA)')
pci_id=$(sudo lspci | grep -oP '([\d:\.]+)(?=\sVGA)')
uuid1=$(uuidgen)
uuid1=$(uuidgen)
uuid2=$(uuidgen)


cat > ~/gvtg-enable.service << EOF
cat > ~/gvtg-enable.service << EOF
Line 143: Line 144:
Type=oneshot
Type=oneshot
ExecStart=/bin/sh -c "echo '${uuid1}' > /sys/devices/pci0000:00/0000:${pci_id}/mdev_supported_types/i915-GVTg_V5_8/create"
ExecStart=/bin/sh -c "echo '${uuid1}' > /sys/devices/pci0000:00/0000:${pci_id}/mdev_supported_types/i915-GVTg_V5_8/create"
ExecStart=/bin/sh -c "echo '${uuid2}' > /sys/devices/pci0000:00/0000:${pci_id}/mdev_supported_types/i915-GVTg_V5_8/create"
ExecStop=/bin/sh -c "echo '1' > /sys/devices/pci0000:00/0000:${pci_id}/${uuid1}/remove"
ExecStop=/bin/sh -c "echo '1' > /sys/devices/pci0000:00/0000:${pci_id}/${uuid1}/remove"
ExecStop=/bin/sh -c "echo '1' > /sys/devices/pci0000:00/0000:${pci_id}/${uuid2}/remove"
RemainAfterExit=yes
RemainAfterExit=yes


Line 154: Line 153:
sudo systemctl enable gvtg-enable --now
sudo systemctl enable gvtg-enable --now
</syntaxhighlight>
</syntaxhighlight>
Notes
* There are two sizes of vGPU you can create:
** <code>i915-GVTg_V5_4</code> supports up to 1920x1200
** <code>i915-GVTg_V5_8</code> supports up to 1024x768
** See <code>cat /sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_8/description</code> to get a description of the vgpu.
** On my nodes, I can create a single <code>i915-GVTg_V5_4</code> or two <code>i915-GVTg_V5_8</code>
* See [[Archwiki:Intel GVT-g]] for details
;Add GPU to your VMs
;Add GPU to your VMs
<syntaxhighlight lang="yaml">
<syntaxhighlight lang="yaml">
Line 178: Line 186:


==Resources==
==Resources==
* [https://kubevirt.io/api-reference/master/ KubeVirt API]
* [https://kubevirt.io/2021/intel-vgpu-kubevirt.html#fedora-workstation-prep intel-vgpu-kubevirt]
* [https://kubevirt.io/2021/intel-vgpu-kubevirt.html#fedora-workstation-prep intel-vgpu-kubevirt]