PCI Passthrough: Difference between revisions

From Proxmox VE
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
To enable PCI passthrough, you need to configure:  
To enable PCI passthrough, you need to configure:  


== INTEL  ==
== INTEL CPU ==


<br> edit: <source lang="bash">
<br> edit: <source lang="bash">
Line 18: Line 18:
Then run "dmesg | grep -e DMAR -e IOMMU" from the command line. &nbsp;If there is no output, then something is wrong.  
Then run "dmesg | grep -e DMAR -e IOMMU" from the command line. &nbsp;If there is no output, then something is wrong.  


== AMD ==
== AMD CPU==


Edit:  
Edit:  
Line 69: Line 69:


Editorial Note:  Using PCI passthrough to present drives direct to a ZFS (FreeNAS, Openfiler, OmniOS) virtual machine is dangerous on many levels and is not recommended for production use.  Specific FreeNAS warnings can be found here:  http://forums.freenas.org/threads/absolutely-must-virtualize-freenas-a-guide-to-not-completely-losing-your-data.12714/   
Editorial Note:  Using PCI passthrough to present drives direct to a ZFS (FreeNAS, Openfiler, OmniOS) virtual machine is dangerous on many levels and is not recommended for production use.  Specific FreeNAS warnings can be found here:  http://forums.freenas.org/threads/absolutely-must-virtualize-freenas-a-guide-to-not-completely-losing-your-data.12714/   
== PCI EXPRESS PASSTHROUGH ==
Since proxmox 3.3, it's possible to passthrough pci express device (including nvidia/amd graphic card)
you need to run pve-kernel 3.10
<pre>
/etc/pve/qemuserver/<vmid>.cfg
</pre>
simple pci-express passthrough
<pre>
machine: q35
hostpci0: 04:00.0
</pre>
vga pci-express passthrough
<pre>
machine: q35
hostpci0: 04:00.0,x-vga=on
</pre>
multi-function pciexpress device. (like a vga card with embedded audio chipset).
Remove the .0 in pci address.
<pre>
machine: q35
hostpci0: 04:00,x-vga=on
</pre>


[[Category:HOWTO]]
[[Category:HOWTO]]

Revision as of 13:37, 23 July 2014

To enable PCI passthrough, you need to configure:

INTEL CPU


edit:

#vi /etc/default/grub

change

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"

then

# update-grub
# reboot


Then run "dmesg | grep -e DMAR -e IOMMU" from the command line.  If there is no output, then something is wrong.

AMD CPU

Edit:

# vi /etc/default/grub

Change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

To:

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"

Then:

# update-grub
# echo "options kvm allow_unsafe_assigned_interrupts=1" > /etc/modprobe.d/kvm_iommu_map_guest.conf 
# reboot


Determine your PCI card address, and configure your VM

Locate your card using "lspci".  The address should be in the form of: 04:00.0

Manually edit the node.conf file.  It can be located at: /etc/pve/nodes/proxmox3/qemu-server/vmnumber.conf.

Add this line to the end of the file: "hostpci0: 04:00.0"


Verify Operation

Start the VM from the UI.

Enter the qm monitor.  "qm monitor vmnumber"

Verify that your card is listed here: "info pci"

Then install drivers on your guest OS.  


NOTE: Card support might be limited to 2 or 3 devices.

NOTE: This process will remove the card from the proxmox host OS.  

Editorial Note: Using PCI passthrough to present drives direct to a ZFS (FreeNAS, Openfiler, OmniOS) virtual machine is dangerous on many levels and is not recommended for production use. Specific FreeNAS warnings can be found here: http://forums.freenas.org/threads/absolutely-must-virtualize-freenas-a-guide-to-not-completely-losing-your-data.12714/


PCI EXPRESS PASSTHROUGH

Since proxmox 3.3, it's possible to passthrough pci express device (including nvidia/amd graphic card)


you need to run pve-kernel 3.10


/etc/pve/qemuserver/<vmid>.cfg

simple pci-express passthrough

machine: q35
hostpci0: 04:00.0

vga pci-express passthrough

machine: q35
hostpci0: 04:00.0,x-vga=on

multi-function pciexpress device. (like a vga card with embedded audio chipset).

Remove the .0 in pci address.

machine: q35
hostpci0: 04:00,x-vga=on