In Ubuntu 16.04 x86 environment GPU Passthrough for KVM

Source: Internet
Author: User
Tags passthrough
Statement

This document is only for learning and exchange, please do not use for other commercial purposes
Author: Chaoyang _tony
E-mail:linzhaolover@163.com
Create date:2018 Year April 8 20:29:38
Last change:2018 year April 8 20:29:50
Reprint please indicate the source: Http://blog.csdn.net/linzhaolover Summary

A recent need to build an environment requires the physical machine's GPU card to be mapped to the KVM for use. That is, passthrough on the Internet to check the information, finally realized. Mainly add Intel_iommu=on test environment to Grub

Ubuntu 16.04.4 LTS
x86_64
GPU, Tesla K80
find machines first with GPU devices

Viewed by command, my machine currently has 4 GPU devices

Lspci | grep NVIDIA
83:00.0 3D controller:nvidia Corporation GK210GL [Tesla K80] (rev A1)
84:00.0 3D Controller:nvidia C Orporation GK210GL [Tesla K80] (Rev. A1)
87:00.0 3D controller:nvidia Corporation GK210GL [Tesla K80] (Rev. A1)
88: 00.0 3D controller:nvidia Corporation GK210GL [Tesla K80] (rev A1)
Update System Grub

Add intel_iommu=on information to grub, and then execute the update command

Cat/etc/default/grub  | grep intel_iommu
grub_cmdline_linux= "Intel_iommu=on"

sudo update-grub
reboot Machine View effect
Reboot

DMESG | grep-e dmar-e iommu DMAR:IOMMU
enabled

After restarting the machine, we found that the IOMMU function has been enabled, and we can add PCI devices to the KVM.

The physical machine does not install NVIDIA drivers, otherwise the driver will bind the PCI device, leading to the KVM partial binding Summary

Have time or to collate their own verified things, convenient for everyone to reference, but also for better expression of information.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.