{"id":5377,"date":"2023-07-12T06:49:03","date_gmt":"2023-07-11T22:49:03","guid":{"rendered":"http:\/\/euhat.com\/wp\/?p=5377"},"modified":"2023-07-26T16:50:01","modified_gmt":"2023-07-26T08:50:01","slug":"gpu-passthrough","status":"publish","type":"post","link":"http:\/\/euhat.com\/wp\/2023\/07\/12\/gpu-passthrough\/","title":{"rendered":"Gpu Passthrough"},"content":{"rendered":"<pre class=\"prettyprint\" style=\"white-space:pre-wrap;\">\r\nsudo apt install qemu-kvm qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager ovmf\r\n<\/pre>\n<p>Identify iommu group,<\/p>\n<pre class=\"prettyprint\" style=\"white-space:pre-wrap;\">\r\n#!&#47;bin&#47;bash\r\n# change the 999 if needed\r\nshopt -s nullglob\r\nfor d in &#47;sys&#47;kernel&#47;iommu_groups&#47;{0..999}&#47;devices&#47;*; do\r\n\tn=${d#*&#47;iommu_groups&#47;*}; n=${n%%&#47;*}\r\n\tprintf &#39;IOMMU Group %s &#39; &#34;$n&#34;\r\n\tlspci -nns &#34;${d##*&#47;}&#34;\r\ndone\r\n<\/pre>\n<pre class=\"prettyprint\" style=\"white-space:pre-wrap;\">\r\nsudo vi &#47;etc&#47;default&#47;grub\r\n\tGRUB_CMDLINE_LINUX_DEFAULT=&#34;intel_iommu=on iommu=pt vfio-pci.ids=10de:24e0,10de:228b&#34;\r\n\r\nsudo update-grub\r\n<\/pre>\n<p>After NVidia driver is installed in guest win10, remember to disable \"Red Hat QXL Controller\" display adapter before reboot.<\/p>\n<p>Setup up shared folder:<\/p>\n<p>VM Settings -> Memory -> Enable shared memory<\/p>\n<p>Add Hardware -> Filesystem -> virtiofs -> Source path: \/host\/path\/to\/share -> Target path: \\\\share<\/p>\n<p>After boot up gust win10, drop winfsp-2.0.23075.msi in it and install the msi using default package.<\/p>\n<p>Then start service \"VirtIO-FS Service (VirtioFsSvc)\".<\/p>\n<p>In address bar of Windows Explorer, type z: to access shared folder.<\/p>\n<p>Convert vmdk to qcow2,<\/p>\n<pre >\r\nqemu-img convert -f vmdk -O qcow2 \/mnt\/E\/vmimg\/win10new\/win10.vmdk win10.qcow2\r\n<\/pre>\n<p>refer to:<br \/>\n<a href=\"https:\/\/mathiashueber.com\/passthrough-windows-11-vm-ubuntu-22-04\/\" rel=\"nofollow\">https:\/\/mathiashueber.com\/passthrough-windows-11-vm-ubuntu-22-04\/<\/a><br \/>\n<a href=\"https:\/\/mathiashueber.com\/pci-passthrough-ubuntu-2004-virtual-machine\/\" rel=\"nofollow\">https:\/\/mathiashueber.com\/pci-passthrough-ubuntu-2004-virtual-machine\/<\/a><br \/>\n<a href=\"https:\/\/askubuntu.com\/questions\/1406888\/ubuntu-22-04-gpu-passthrough-qemu\" rel=\"nofollow\">https:\/\/askubuntu.com\/questions\/1406888\/ubuntu-22-04-gpu-passthrough-qemu<\/a><br \/>\n<a href=\"https:\/\/blog.hwaryong.com\/kvm-gpu-passthrough-on-ubuntu-2004\" rel=\"nofollow\">https:\/\/blog.hwaryong.com\/kvm-gpu-passthrough-on-ubuntu-2004<\/a><br \/>\n<a href=\"https:\/\/www.debugpoint.com\/kvm-share-folder-windows-guest\/\" rel=\"nofollow\">https:\/\/www.debugpoint.com\/kvm-share-folder-windows-guest\/<\/a><br \/>\n<a href=\"https:\/\/docs.openstack.org\/image-guide\/convert-images.html\" rel=\"nofollow\">https:\/\/docs.openstack.org\/image-guide\/convert-images.html<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/winfsp\/winfsp\/releases\/\" rel=\"nofollow\">https:\/\/github.com\/winfsp\/winfsp\/releases\/<\/a><br \/>\n<a href=\"https:\/\/fedorapeople.org\/groups\/virt\/virtio-win\/direct-downloads\/archive-virtio\/\" rel=\"nofollow\">https:\/\/fedorapeople.org\/groups\/virt\/virtio-win\/direct-downloads\/archive-virtio\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>sudo apt install qemu-kvm qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager ovmf Identify iommu group, #!&#47;bin&#47;bash # change the 999 if needed shopt -s nullglob for d in &#47;sys&#47;kernel&#47;iommu_groups&#47;{0..999}&#47;devices&#47;*; do n=${d#*&#47;iommu_groups&#47;*}; n=${n%%&#47;*} printf &#39;IOMMU Group %s &#39; &#34;$n&#34; lspci -nns &#34;${d##*&#47;}&#34; done sudo vi &#47;etc&#47;default&#47;grub GRUB_CMDLINE_LINUX_DEFAULT=&#34;intel_iommu=on iommu=pt vfio-pci.ids=10de:24e0,10de:228b&#34; sudo update-grub After NVidia driver is installed in guest ... <a title=\"Gpu Passthrough\" class=\"read-more\" href=\"http:\/\/euhat.com\/wp\/2023\/07\/12\/gpu-passthrough\/\" aria-label=\"More on Gpu Passthrough\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts\/5377"}],"collection":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/comments?post=5377"}],"version-history":[{"count":18,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts\/5377\/revisions"}],"predecessor-version":[{"id":5435,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts\/5377\/revisions\/5435"}],"wp:attachment":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/media?parent=5377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/categories?post=5377"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/tags?post=5377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}