KubeVirt: Difference between revisions

Line 117: Line 117:
==vGPU==
==vGPU==
===Intel vGPU===
===Intel vGPU===
See [https://kubevirt.io/2021/intel-vgpu-kubevirt.html#fedora-workstation-prep intel-vgpu-kubevirt]<br>
See [https://kubevirt.io/2021/intel-vgpu-kubevirt.html#fedora-workstation-prep intel-vgpu-kubevirt] and [[Archwiki:Intel GVT-g]]<br>
{{hidden | Instructions |
{{hidden | Instructions |
;Setup the nodes
;Setup the nodes
Line 134: Line 134:
pci_id=$(sudo lspci | grep -oP '([\d:\.]+)(?=\sVGA)')
pci_id=$(sudo lspci | grep -oP '([\d:\.]+)(?=\sVGA)')
uuid1=$(uuidgen)
uuid1=$(uuidgen)
uuid2=$(uuidgen)
#uuid2=$(uuidgen)


cat > ~/gvtg-enable.service << EOF
cat > ~/gvtg-enable.service << EOF
Line 142: Line 142:
[Service]
[Service]
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_4/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 152:
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 the archwiki for details
;Add GPU to your VMs
;Add GPU to your VMs
<syntaxhighlight lang="yaml">
<syntaxhighlight lang="yaml">