当前位置:网站首页>PVE enables the hardware graphics card pass through function
PVE enables the hardware graphics card pass through function
2022-06-24 01:16:00 【Xiao Chen operation and maintenance】
PVE Enable hardware graphics card pass through function
The first edit GRUB The configuration file :
[email protected]:~# vim /etc/default/grub [email protected]:~# [email protected]:~# cat /etc/default/grub # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifb:off" GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" [email protected]:~# Turn on IOMMU Support : GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifb:off" If it is AMD Of CPU: GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on video=efifb:off" Copy code
to update GRUB:
[email protected]:~# update-grub Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.11.22-5-pve Found initrd image: /boot/initrd.img-5.11.22-5-pve Found linux image: /boot/vmlinuz-5.11.22-4-pve Found initrd image: /boot/initrd.img-5.11.22-4-pve Found memtest86+ image: /boot/memtest86+.bin Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin done [email protected]:~# Copy code
Add the required system modules ( drive ):
[email protected]:~# [email protected]:~# echo "vfio" >> /etc/modules [email protected]:~# echo "vfio_iommu_type1" >> /etc/modules [email protected]:~# echo "vfio_pci" >> /etc/modules [email protected]:~# echo "vfio_virqfd" >> /etc/modules [email protected]:~# [email protected]:~# cat /etc/modules # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. # Generated by sensors-detect on Fri Sep 24 17:22:44 2021 # Chip drivers coretemp vfio vfio_iommu_type1 vfio_pci vfio_virqfd Copy code
Then add the module ( drive ) The blacklist , That is to let GPU The device will not use these drivers after the next system startup , Free up the equipment for vfio For driving :
Intel To show :
echo "blacklist snd_hda_intel" >> /etc/modprobe.d/pve-blacklist.conf echo "blacklist snd_hda_codec_hdmi" >> /etc/modprobe.d/pve-blacklist.conf echo "blacklist i915" >> /etc/modprobe.d/pve-blacklist.conf Copy code
N card /A card :
echo "blacklist nouveau" >> /etc/modprobe.d/pve-blacklist.conf echo "blacklist radeon" >> /etc/modprobe.d/pve-blacklist.conf Copy code
If it is N The card also needs to add the following configuration to kvm.conf( According to foreigners, it is to avoid some inexplicable mistakes ):
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf Copy code
[email protected]:~# echo "blacklist nouveau" >> /etc/modprobe.d/pve-blacklist.conf [email protected]:~# echo "blacklist radeon" >> /etc/modprobe.d/pve-blacklist.conf [email protected]:~# [email protected]:~# cat /etc/modprobe.d/pve-blacklist.conf # This file contains a list of modules which are not supported by Proxmox VE # nidiafb see bugreport https://bugzilla.proxmox.com/show_bug.cgi?id=701 blacklist nvidiafb blacklist nouveau blacklist radeon [email protected]:~# [email protected]:~# echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf [email protected]:~# [email protected]:~# cat /etc/modprobe.d/kvm.conf options kvm ignore_msrs=1 Copy code
Update kernel :
[email protected]:~# update-initramfs -u update-initramfs: Generating /boot/initrd.img-5.11.22-5-pve Running hook script 'zz-proxmox-boot'.. Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace.. No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync. [email protected]:~# Copy code
Restart the machine :
[email protected]:~# reboot
After restarting, check whether the module is loaded normally :
[email protected]:~# lsmod | grep vfio vfio_pci 57344 1 vfio_virqfd 16384 1 vfio_pci irqbypass 16384 11 vfio_pci,kvm vfio_iommu_type1 36864 1 vfio 36864 5 vfio_iommu_type1,vfio_pci [email protected]:~# Copy code
View graphics card
[email protected]:~# lspci -nn | grep NV 86:00.0 3D controller [0302]: NVIDIA Corporation TU104GL [Tesla T4] [10de:1eb8] (rev a1) [email protected]:~# [email protected]:~# Copy code
View graphics card ID, Write to configuration
[email protected]:~# lspci -n -s 86:00 86:00.0 0302: 10de:1eb8 (rev a1) [email protected]:~# [email protected]:~# [email protected]:~# echo "options vfio-pci ids=10de:1eb8" > /etc/modprobe.d/vfio.conf [email protected]:~# Copy code
space.bilibili.com/352476552/a…
cloud.tencent.com/developer/c…
You know 、CSDN、 Open source in China 、 Think no 、 Nuggets 、 Bili, Bili 、 Tencent cloud
边栏推荐
- [applet] realize the effect of double column commodities
- WinSCP和PuTTY的安装和使用
- 【Redis进阶之ZipList】如果再有人问你什么是压缩列表?请把这篇文章直接甩给他。
- Is it safe to open a stock account online now? Select a state-owned securities firm, and the fastest time to open an account is 8 minutes
- 【SPRS J P & RS 2022】小目标检测模块:A Normalized Gaussian Wasserstein Distance for Tiny Object Detection
- [CVPR 2020] conference version: a physics based noise formation model for extreme low light raw denoising
- Arm learning (7) symbol table and debugging
- Pad User Guide
- Perhaps the greatest romance of programmers is to commemorate their dead mother with a software
- Cross domain and jsonp
猜你喜欢

LSF opens job idle information to view the CPU time/elapse time usage of the job

Open source model library of flying propeller industry: accelerating the development and application of enterprise AI tasks

苹果Iphone14搭载北斗导航系统,北斗VS GPS有哪些优势?

Error reported using worker: uncaught domexception: failed to construct 'worker': script at***

Alibaba interview question: multi thread related

ShardingSphere-proxy-5.0.0容量范围分片的实现(五)

13 `bs_duixiang.tag标签`得到一个tag对象

WinSCP和PuTTY的安装和使用

Cross domain and jsonp
![2022 postgraduate entrance examination experience sharing [preliminary examination, school selection, re examination, adjustment, school recruitment and social recruitment]](/img/05/e204f526e2f3e90ed9a7ad0361a72e.png)
2022 postgraduate entrance examination experience sharing [preliminary examination, school selection, re examination, adjustment, school recruitment and social recruitment]
随机推荐
Installation and use of winscp and putty
对抗训练理论分析:自适应步长快速对抗训练
. Net core cross platform development bbs forum (connotation source code + complete operation video)
ShardingSphere-proxy-5.0.0容量范围分片的实现(五)
Oushudb learning experience sharing (I)
JS stack memory
Common core resource objects of kubernetes
Solve the problem that Base64 compressed files are extracted with spaces after post request
【小程序】相对路径和绝对路径的表示符
If you want to open an account for stock trading, is it safe to open an account online-
2021-11-21: map[i][j] = = 0, which means that (I, J) is an ocean. If you cross it, the cost will be
这不会又是一个Go的BUG吧?
Real time computing framework: Flink cluster construction and operation mechanism
分别用SVM、贝叶斯分类、二叉树、CNN实现手写数字识别
Relationship between continuous testing and quality assurance
Architecture solutions
[iccv workshop 2021] small target detection based on density map: coarse-grained density map guided object detection in aerial images
[CVPR 2020 oral] a physics based noise formation model for extreme low light raw denoising
牛学长周年庆活动:软件大促限时抢,注册码免费送!
version `ZLIB_1.2.9‘ not found (required by /lib64/libpng16.so.16)