{"id":212,"date":"2016-12-31T14:10:21","date_gmt":"2016-12-31T21:10:21","guid":{"rendered":"https:\/\/steele.sh\/blog\/?p=212"},"modified":"2016-12-31T14:10:21","modified_gmt":"2016-12-31T21:10:21","slug":"proxmox-pcie-passthrough","status":"publish","type":"post","link":"https:\/\/gravemind.sh\/blog\/?p=212","title":{"rendered":"Proxmox PCIe Passthrough"},"content":{"rendered":"<p><strong>Intel CPU<\/strong><\/p>\n<p>Edit grub<\/p>\n<pre class=\"\">nano \/etc\/default\/grub<\/pre>\n<p>Change this:\u00a0<span class=\"lang:default decode:true crayon-inline\">GRUB_CMDLINE_LINUX_DEFAULT=&#8221;quiet&#8221;<\/span><\/p>\n<p>To this:\u00a0<span class=\"lang:default decode:true crayon-inline\">GRUB_CMDLINE_LINUX_DEFAULT=&#8221;quiet intel_iommu=on&#8221;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Add required kernel modules<\/strong><\/p>\n<pre class=\"lang:default decode:true \">nano \/etc\/modules<\/pre>\n<pre class=\"lang:default decode:true \" title=\"\/etc\/modules\">vfio\nvfio_iommu_type1\nvfio_pci\nvfio_virqfd<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>IOMMU interrupt remapping<\/strong><\/p>\n<p>1) Run the &#8220;dmesg | grep ecap&#8221; command.<\/p>\n<p>2) On the IOMMU lines, the hexadecimal value after &#8220;ecap&#8221; indicates whether interrupt remapping is supported. If the last character of this value is an 8, 9, a, b, c, d, e, or an f, interrupt remapping is supported. For example, &#8220;ecap 1000&#8221; indicates there is no interrupt remapping support. &#8220;ecap 10207f&#8221; indicates interrupt remapping support, as the last character is an &#8220;f&#8221;.<\/p>\n<p>Interrupt remapping will only be enabled if every IOMMU supports it.<\/p>\n<p>If your system doesn&#8217;t support interrupt remapping, you can allow unsafe interrupts with:<\/p>\n<pre class=\"lang:default decode:true \">echo \"options vfio_iommu_type1 allow_unsafe_interrupts=1\" &gt; \/etc\/modprobe.d\/iommu_unsafe_interrupts.conf<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Verify IOMMU isolation<\/strong><\/p>\n<p>To have pci passthrough working fine, you need dedicated iommu group for your pci devices. You should have something like this:<\/p>\n<pre class=\"lang:default decode:true\">find \/sys\/kernel\/iommu_groups\/ -type l<\/pre>\n<pre class=\"lang:default decode:true \">\/sys\/kernel\/iommu_groups\/0\/devices\/0000:00:00.0\n\/sys\/kernel\/iommu_groups\/1\/devices\/0000:00:01.0\n\/sys\/kernel\/iommu_groups\/1\/devices\/0000:01:00.0\n\/sys\/kernel\/iommu_groups\/1\/devices\/0000:01:00.1\n\/sys\/kernel\/iommu_groups\/2\/devices\/0000:00:02.0\n\/sys\/kernel\/iommu_groups\/3\/devices\/0000:00:16.0\n\/sys\/kernel\/iommu_groups\/4\/devices\/0000:00:1a.0\n\/sys\/kernel\/iommu_groups\/5\/devices\/0000:00:1b.0\n\/sys\/kernel\/iommu_groups\/6\/devices\/0000:00:1c.0\n\/sys\/kernel\/iommu_groups\/7\/devices\/0000:00:1c.5\n\/sys\/kernel\/iommu_groups\/8\/devices\/0000:00:1c.6\n\/sys\/kernel\/iommu_groups\/9\/devices\/0000:00:1c.7\n\/sys\/kernel\/iommu_groups\/9\/devices\/0000:05:00.0\n\/sys\/kernel\/iommu_groups\/10\/devices\/0000:00:1d.0\n\/sys\/kernel\/iommu_groups\/11\/devices\/0000:00:1f.0\n\/sys\/kernel\/iommu_groups\/11\/devices\/0000:00:1f.2\n\/sys\/kernel\/iommu_groups\/11\/devices\/0000:00:1f.3\n\/sys\/kernel\/iommu_groups\/12\/devices\/0000:02:00.0\n\/sys\/kernel\/iommu_groups\/12\/devices\/0000:02:00.1\n\/sys\/kernel\/iommu_groups\/13\/devices\/0000:03:00.0\n\/sys\/kernel\/iommu_groups\/14\/devices\/0000:04:00.0<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Determine your PCI card address, and configure your VM<\/strong><\/p>\n<p>Locate your card using &#8220;lspci&#8221;. \u00a0The address should be in the form of: 01:00.0<\/p>\n<p>Manually edit the node.conf file. \u00a0It can be located at:\u00a0\/etc\/pve\/qemu-server\/vmid.conf.<\/p>\n<p>Add this line to the end of the file:<\/p>\n<pre class=\"lang:default decode:true \">hostpci0: 01:00.0<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Intel CPU Edit grub nano \/etc\/default\/grub Change this:\u00a0GRUB_CMDLINE_LINUX_DEFAULT=&#8221;quiet&#8221; To this:\u00a0GRUB_CMDLINE_LINUX_DEFAULT=&#8221;quiet intel_iommu=on&#8221; &nbsp; Add required kernel modules nano \/etc\/modules vfio vfio_iommu_type1 vfio_pci vfio_virqfd &nbsp; IOMMU interrupt remapping 1) Run the &#8220;dmesg | grep ecap&#8221; command. 2) On the IOMMU lines, the hexadecimal value after &#8220;ecap&#8221; indicates whether interrupt remapping is supported. If the last character of &hellip; <a href=\"https:\/\/gravemind.sh\/blog\/?p=212\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Proxmox PCIe Passthrough&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4,5,7,1],"tags":[],"class_list":["post-212","post","type-post","status-publish","format-standard","hentry","category-debian","category-homelab","category-linux","category-proxmox","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=212"}],"version-history":[{"count":0,"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=\/wp\/v2\/posts\/212\/revisions"}],"wp:attachment":[{"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gravemind.sh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}