{"id":16,"date":"2021-09-03T00:57:27","date_gmt":"2021-09-03T08:57:27","guid":{"rendered":"https:\/\/www.qiuqiuren.club\/?p=16"},"modified":"2021-12-02T01:11:51","modified_gmt":"2021-12-02T09:11:51","slug":"16","status":"publish","type":"post","link":"https:\/\/www.qiuqiuren.club\/?p=16","title":{"rendered":"\u4ece\u7269\u7406\u673a\u642d\u5efaProxmox Virtual Environment\u5e73\u53f0"},"content":{"rendered":"<h2>0. \u51c6\u5907<\/h2>\n<p>\u7531\u4e8eNvidia\u663e\u5361\u9a71\u52a8\u4e0d\u652f\u6301\u7684\u539f\u56e0\uff0c\u653e\u5f03\u4eceProxmox VE 7\u4e0a\u642d\u5efa\uff0c\u8f6c\u4e3a\u4ecePVE 6<\/p>\n<p>\u5b89\u88c5debian10\uff0c\u5b89\u88c5PVE6\uff0c\u65b9\u6cd5\u89c1\u4e0b<\/p>\n<p><a href=\"https:\/\/pve.proxmox.com\/wiki\/Install_Proxmox_VE_on_Debian_Buster\">https:\/\/pve.proxmox.com\/wiki\/Install_Proxmox_VE_on_Debian_Buster<\/a><\/p>\n<h2>1. \u663e\u5361\u5206\u5272<\/h2>\n<p>\u53ef\u4ee5\u53c2\u7167\u8fd9\u4e2a\u8001\u54e5\u7684\u6b65\u9aa4<\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=cPrOoeMxzu0&amp;ab_channel=CraftComputing\">https:\/\/www.youtube.com\/watch?v=cPrOoeMxzu0&#038;ab_channel=CraftComputing<\/a><\/p>\n<p>\u603b\u7ed3\u4e0b\u6765\u6709\u8fd9\u51e0\u4e2a\u6b65\u9aa4<\/p>\n<h3>1.1 \u6dfb\u52a0PVE\u6e90<\/h3>\n<pre><code>nano \/etc\/apt\/sources.list\ndeb http:\/\/download.proxmox.com\/debian\/pve buster pve-no-subscription<\/code><\/pre>\n<p>\u6dfb\u52a0\u5b8c\u4e86apt update\u4e00\u4e0b\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0NO_PUBKEY\u7684\u62a5\u9519\u3002<\/p>\n<p>\u7528sudo apt-key adv &#8211;keyserver keys.gnupg.net &#8211;recv-keys <PUBKEY>\u8fd9\u4e2a\u89e3\u51b3<\/p>\n<p>\u6ce8\u610f\u7591\u96be\u89e3\u7b54\u8282\u7684pve repo\u90e8\u5206<\/p>\n<h3>1.2 \u4f9d\u8d56\u73af\u5883<\/h3>\n<pre><code>apt update\napt -y upgrade\napt -y install python3 python3-pip git build-essential pve-headers dkms jq\n\n# \u8fd9\u4e2a\u5e94\u8be5\u4e0d\u88c5\u4e5f\u884c\n# pip3 install frida\n\n# \u4e0b\u9762\u547d\u4ee4\u662f\u7528\u5728\u6d88\u8d39\u7ea7GPU\u4e0a\u89e3\u9501\u663e\u5361\u5206\u5272\u529f\u80fd\u7684\uff0c\u672c\u6b21\u5de5\u4f5c\u7528\u4e0d\u5230\u3002\u9700\u8981\u76f8\u5173\u7684\u8d44\u6599\uff0c\u8bf7\u56de\u53bb\u770b\u6587\u4e2d\u7ed9\u51fa\u7684youtube\u8fde\u63a5\n# git clone https:\/\/github.com\/DualCoder\/vgpu_unlock\n# chmod -R +x vgpu_unlock\n\nwget http:\/\/ftp.br.debian.org\/debian\/pool\/main\/m\/mdevctl\/mdevctl_0.81-1_all.deb\ndpkg -i mdevctl_0.81-1_all.deb\nreboot<\/code><\/pre>\n<h3>1.3 \u786c\u4ef6\u76f4\u901a\u76f8\u5173\u64cd\u4f5c<\/h3>\n<pre><code>nano \/etc\/default\/grub\nGRUB_CMDLINE_LINUX_DEFAULT=&quot;quiet intel_iommu=on iommu=pt&quot;\n\u6216\u8005\nGRUB_CMDLINE_LINUX_DEFAULT=&quot;quiet amd_iommu=on iommu=pt&quot;\n\nupdate-grub\n\nnano \/etc\/modules\nvfio\nvfio_iommu_type1\nvfio_pci\nvfio_virqfd\n\necho &quot;options vfio_iommu_type1 allow_unsafe_interrupts=1&quot; &gt; \/etc\/modprobe.d\/iommu_unsafe_interrupts.conf\necho &quot;options kvm ignore_msrs=1&quot; &gt; \/etc\/modprobe.d\/kvm.conf\necho &quot;blacklist nouveau&quot; &gt;&gt; \/etc\/modprobe.d\/blacklist.conf\nupdate-initramfs -u\nreboot<\/code><\/pre>\n<p>\u91cd\u542f\u540e\u6267\u884c<code>dmesg | grep -e DMAR -e IOMMU<\/code>\u68c0\u67e5IOMMU\u662f\u5426\u5f00\u542f<\/p>\n<h3>1.4 NVIDIA\u663e\u5361\u9a71\u52a8<\/h3>\n<p><a href=\"https:\/\/nvid.nvidia.com\/dashboard\/#\/dashboard\">https:\/\/nvid.nvidia.com\/dashboard\/#\/dashboard<\/a> \u5230\u8fd9\u4e2aurl\uff0c\u9700\u8981Nvidia\u4f01\u4e1a\u8d26\u53f7<\/p>\n<p>\u7136\u540e\u53bb\u5de6\u4fa7\u7684\u8f6f\u4ef6\u4e0b\u8f7dtab\uff0c\u7b5b\u9009\u8f6f\u4ef6\u3002vGPU-LinuxKVM\uff08\u8fd9\u4e2a\u90e8\u5206\u6839\u636e\u4f60\u865a\u62df\u5316\u7684\u5e73\u53f0\u53bb\u9009\uff0c\u672c\u6b21\u7684PVE\u5c31\u662f\u7528\u6587\u4e2d\u8fd9\u4e2a\uff09<\/p>\n<p>\u627e\u4e2a\u6700\u65b0\u7684\u7136\u540e\u4e0b\u8f7d<\/p>\n<p>\u4e0b\u8f7d\u540e\u7684\u538b\u7f29\u5305\uff0c\u91cc\u9762\u6709\u4e2a\u53eb\u505a\u7c7b\u4f3c<code>NVIDIA-Linux-x86_64-470.63-vgpu-kvm.run<\/code>\u7684\u4e1c\u897f\uff0c\u8fd9\u5c31\u662f\u670d\u52a1\u5668Host\u9700\u8981\u7684\u663e\u5361\u9a71\u52a8\u3002\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u91cc\u9762\u3002\u5269\u4e0b\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u662fVM\u91cc\u9762\u9700\u8981\u7684\u9a71\u52a8\u3002<\/p>\n<p>\u5728Host\u91cc\u9762\uff0cchmod +x, \u7136\u540e\u6267\u884c\u5b83\uff0c\u5e76\u6dfb\u52a0\u53c2\u6570 &#8211;dkms<\/p>\n<p>\u8fd9\u4e2a\u65f6\u5019\u5e94\u8be5\u4f1a\u5b89\u88c5\u6210\u529f\uff0c\u5982\u679c\u5931\u8d25\u4e86\uff0c\u90a3\u53ef\u80fd\u8f6f\u4ef6\u4f9d\u8d56\u3001\u5185\u6838\u7248\u672c\u7684\u95ee\u9898\uff0c\u81ea\u5df1\u60f3\u529e\u6cd5\u5427\u3002\u672c\u6587\u5728Linux\u5185\u68385.4\u4e0a\u6210\u529f\u3002<\/p>\n<p>\u7136\u540e\u91cd\u542f\u3002\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u8ba4\u4e3a\u5bbf\u4e3b\u673a\u7684\u524d\u671f\u51c6\u5907\u5df2\u7ecf\u5b8c\u6210\u3002<\/p>\n<h3>1.5 \u663e\u5361\u5206\u5272<\/h3>\n<p>\u6267\u884cmdevctl types\uff0c\u5e94\u8be5\u4f1a\u5217\u51fa\u4f60\u7269\u7406gpu\u7684pci\u5730\u5740\uff0c\u4ee5\u53ca\u5b83\u652f\u6301\u7684\u865a\u62dfgpu profile<\/p>\n<p>\u6216\u8005\u8fd0\u884c <code>nvidia-smi vgpu -s<\/code>\u4e5f\u4f1a\u5f97\u5230\u7c7b\u4f3c\u7684\u4e1c\u897f\u3002<\/p>\n<p>\u4ece\u652f\u6301\u7684\u5404\u4e2avgpu profile\u4e2d\u9009\u4e00\u4e2a\u9700\u8981\u7684\u3002\u6ce8\u610f\u4e00\u822c\u4f1a\u9009\u62e9Q\u7c7b\u578b\u7684vGPU\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u7c7b\u578b\u5f00\u653e\u7684\u529f\u80fd\u6700\u591a\uff0c\u9ed8\u8ba4fps\u9650\u5236\u4e5f\u6700\u9ad8\u670960\u5e27\uff0c\u5176\u4ed6\u7684\u53ef\u80fd\u53ea\u670945<\/p>\n<pre><code>Series  Optimal Workload\nQ-series    Virtual workstations for creative and technical professionals who require the performance and features of Quadro technology\nC-series    Compute-intensive server workloads, such as artificial intelligence (AI), deep learning, or high-performance computing (HPC)2, 3\nB-series    Virtual desktops for business professionals and knowledge workers\nA-series    App streaming or session-based solutions for virtual applications users6\n\nWhen enabled, the frame-rate limiter (FRL) limits the maximum frame rate in frames per second (FPS) for a vGPU as follows:\nFor B-series vGPUs, the maximum frame rate is 45 FPS.\nFor Q-series, C-series, and A-series vGPUs, the maximum frame rate is 60 FPS.<\/code><\/pre>\n<p>\u672c\u6587\u9009\u62e9nvidia-233<\/p>\n<p>\u7136\u540e\u53bb\u7f51\u4e0a\u751f\u6210\u51e0\u4e2aGUID<\/p>\n<p>\u7136\u540e\u5f62\u6210\u5982\u4e0b\u7684\u547d\u4ee4\uff08\u4f8b\u5b50\u4e2d\u521b\u5efa\u4e86\u4e24\u4e2avGPU\uff0c\u770b\u4e2a\u610f\u601d\u5c31\u597d\uff09<\/p>\n<pre><code># GUID1: 5c4d18e7-5bc0-4792-900d-c9a17a644e92\n# GUID2: 03d16c31-c5dd-433e-b442-936c8f1dfb3f\n\nmdevctl start -u 5c4d18e7-5bc0-4792-900d-c9a17a644e92 -p 0000:3b:00.0 --type nvidia-233\nmdevctl start -u 03d16c31-c5dd-433e-b442-936c8f1dfb3f -p 0000:3b:00.0 --type nvidia-233\n\nmdevctl define --auto --uuid 5c4d18e7-5bc0-4792-900d-c9a17a644e92\nmdevctl define --auto --uuid 03d16c31-c5dd-433e-b442-936c8f1dfb3f<\/code><\/pre>\n<p>\u4e0a\u9762\u7684start\u547d\u4ee4\u6bcf\u6b21Host\u542f\u52a8\u90fd\u8981\u8fd0\u884c\u4e00\u904d\uff0c\u6240\u4ee5\u641e\u4e2a\u81ea\u52a8\u6267\u884c\u5427\uff0c\u5728\u6b64\u7565\u8fc7<\/p>\n<p>\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u8ba4\u4e3a\u663e\u5361\u5df2\u7ecf\u5206\u5272\u597d\u4e86\uff0c\u4e0b\u4e00\u6b65\u662f\u628a\u865a\u62df\u663e\u5361\u76f4\u901a\u7ed9VM<\/p>\n<h3>1.6 \u521b\u5efa\u865a\u62df\u673a<\/h3>\n<p>\u6ca1\u5565\u597d\u8bf4\u7684\uff0c\u6ce8\u610f\u521b\u5efa\u53c2\u6570<\/p>\n<p>BIOS\u9700\u8981\u662fOVMF(UEFI), Machine\u662fq35\u3002<\/p>\n<p>\u7136\u540e\u542f\u52a8\u865a\u62df\u673a\uff0c\u88c5\u7cfb\u7edf\u3002\u7cfb\u7edf\u88c5\u5b8c\u4e4b\u540e\u5173\u673a\u3002<\/p>\n<p>VM\u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u4e8eHost\u7684\/etc\/pve\/qemu-server\/[VMID].conf\u91cc\u9762\uff0c\u6253\u5f00\u5b83\u505a\u4e00\u70b9\u4fee\u6539<\/p>\n<p><strong>\u6ce8\u610f\u6b64\u5904\u548c\u89c6\u9891\u6559\u7a0b\u7565\u6709\u4e0d\u540c<\/strong><\/p>\n<p>\u539f\u6587\u4ef6\u5185\u5bb9<\/p>\n<pre><code>bios: ovmf\nboot: order=ide0;ide2;net0\ncores: 4\nefidisk0: local:101\/vm-101-disk-1.qcow2,size=128K\nide0: local:101\/vm-101-disk-0.qcow2,size=120G\nide2: local:iso\/cn_windows_10_business_editions_version_1903_updated_sept_2019_x64_dvd_2f5281e1.iso,media=cdrom\nmachine: pc-q35-5.2\nmemory: 16384\nname: VGPU2\nnet0: e1000=66:AB:4D:07:99:E5,bridge=vmbr1,firewall=1\nnuma: 0\nostype: win10\nscsihw: virtio-scsi-pci\nsmbios1: uuid=061a1415-6b6a-414f-ba80-5f5d93893f6c\nsockets: 2\nvmgenid: e8d21fb3-583f-4e2b-bbd3-fac2c58d55b5<\/code><\/pre>\n<p>\u5728\u539f\u59cb\u6587\u4ef6\u7684\u5934\u90e8\uff0c\u52a0\u4e00\u884c<\/p>\n<pre><code>args: -device &#039;vfio-pci,sysfsdev=\/sys\/bus\/mdev\/devices\/03d16c31-c5dd-433e-b442-936c8f1dfb3f,display=off&#039; -uuid 1f4558e8-f7be-4b80-9f7e-6723d2df0c89<\/code><\/pre>\n<p>\u6587\u4e2d\u51fa\u73b0\u4e24\u4e2auuid\uff0c\u7b2c\u4e00\u4e2auuid\uff0c\u662f\u4e0a\u6587\u4e2d\u6211\u4eec\u5206\u5272\u663e\u5361\u4e4b\u540e\uff0c\u8d4b\u4e88\u865a\u62df\u663e\u5361\u7684uuid\u3002\u800c\u7b2c\u4e8c\u4e2aid\u662f\u6b64VM\u7684id\uff0c\u8fd9\u4e2a\u8bf7\u5728\u7f51\u4e0a\u518d\u751f\u6210\u4e00\u4e2a\uff0c\u4e0d\u8981\u548c\u7b2c\u4e00\u4e2aid\u91cd\u590d<\/p>\n<p>\u6539\u5b8c\u4e4b\u540e\u4fdd\u5b58\u3002\u6b64\u65f6\u76f8\u5f53\u4e8e\u5df2\u7ecf\u914d\u7f6e\u597dVM\u7684vGPU\u76f4\u901a\u4e86\u3002<\/p>\n<p>ps: \u6559\u7a0b\u7528\u7684\u547d\u4ee4\u5982\u4e0b\uff0c\u5b83\u53ef\u4ee5\u7528\u6765\u6b3a\u9a97vm\u663e\u5361\u578b\u53f7\u3002\u8fd8\u662f\u6ce8\u610f\u540e\u9762\u4e00\u4e2a-uuid\u7684\u5185\u5bb9\u8981\u91cd\u65b0\u751f\u6210\u4e00\u4e2a<\/p>\n<pre><code>args: -device &#039;vfio-pci,sysfsdev=\/sys\/bus\/mdev\/devices\/[UUID],display=off,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,x-pci-vendor-id=0x10de,x-pci-device-id=0x[PCI-ID],x-pci-sub-vendor-id=0x10de,x-pci-sub-device-id=0x11A0&#039; -uuid [UUID]<\/code><\/pre>\n<h3>1.7 \u5f00\u673a\u3001\u88c5\u8fdc\u63a7\u3001\u88c5\u663e\u5361\u9a71\u52a8<\/h3>\n<p>\u5f00\u673a\u4e4b\u540e\u80fd\u770b\u5230\u786c\u4ef6\u4e2d\u6709\u4e00\u4e2a\u6ca1\u6709\u9a71\u52a8\u663e\u5361\uff0c\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u7528\u7b2c\u4e09\u6b65\u4e0b\u8f7d\u7684\u538b\u7f29\u5305\u91cc\u9762\u7684\u5ba2\u6237\u673a\u9a71\u52a8\u6587\u4ef6\u5b89\u88c5\u3002\u4f46\u6ce8\u610f\u4e5f\u5148\u522b\u6025\u5b89\u88c5\uff0c\u9996\u5148\u9700\u8981\u6253\u5f003389\u6216\u8005\u5b89\u88c5\u5176\u4ed6\u8fdc\u63a7\u7a0b\u5e8f\u3002\u56e0\u4e3a\u663e\u5361\u9a71\u52a8\u4e00\u65e6\u88c5\u4e0a\u4e86\uff0cpve\u63a7\u5236\u53f0\u7684novnc\u53ef\u80fd\u4f1a\u5931\u6548\uff0cvm\u5c31\u5931\u53bb\u63a7\u5236\u4e86\u3002\u5f53\u7136\uff0c\u4e3a\u4e86\u8fdc\u63a7\u80fd\u7528\uff0c\u8fd8\u9700\u8981\u7ed9\u865a\u62df\u673a\u914d\u4e0a\u7f51\u7edc\uff0c\u5e76\u4e14\u5728host\u91cc\u9762\u641e\u5b9a\u7aef\u53e3\u8f6c\u53d1\u3002\u8fd9\u4e2a\u5185\u5bb9\u89c1\u4e0b\u6587\u3002<\/p>\n<p>\u7b49\u8fdc\u63a7\u5f00\u542f\u4e86\uff0c\u663e\u5361\u9a71\u52a8\u8f6c\u5b8c\uff0cvm\u642d\u5efa\u4e5f\u5c31\u5b8c\u6210\u4e86\u3002<\/p>\n<h2>2. \u7f51\u7edc\u914d\u7f6e\u548c\u7aef\u53e3\u8f6c\u53d1<\/h2>\n<h3>2.1 \u7f51\u7edc\u914d\u7f6e<\/h3>\n<p>\u53c2\u8003\u8fd9\u4e2a\u6587\u7ae0\u6765\u641e\uff1a<\/p>\n<p><a href=\"https:\/\/www.flomain.de\/2015\/05\/how-to-proxmox-networking\/\">https:\/\/www.flomain.de\/2015\/05\/how-to-proxmox-networking\/<\/a><\/p>\n<p>\u4fdd\u5b58\u4e86\u4e00\u4efd\u9644\u4ef6<\/p>\n<p>\u6211\u4eec\u9700\u8981\u7684\u662fRouted Networking\uff0c\u6240\u4ee5\u5199\u51fa\u6765\u7684\u914d\u7f6e\u957f\u8fd9\u6837<\/p>\n<p>cat \/etc\/network\/interfaces<\/p>\n<pre><code>auto lo\niface lo inet loopback\n\n# \u9ed1\u77f3\u7528\u6765\u4e0a\u7f51\u7684\u7f51\u5361\nauto eth0\niface eth0 inet dhcp\n    post-up echo 1 &gt; \/proc\/sys\/net\/ipv4\/conf\/eth0\/proxy_arp\n\n# \u8fd9\u91cc\u662f\u9ed1\u77f3\u7684\u7b2c\u4e8c\u5f20\u7f51\u5361\uff0c\u4e0d\u76f8\u5e72\niface eth1 inet manual\n\nauto vmbr1\niface vmbr1 inet static\n    address 10.3.5.1\/24\n    bridge-ports none\n    bridge-stp off\n    bridge-fd 0\n    post-up echo 1 &gt; \/proc\/sys\/net\/ipv4\/ip_forward\n    post-up iptables -t nat -A POSTROUTING -s &#039;10.3.5.0\/24&#039; -o eth0 -j MASQUERADE\n    post-down iptables -t nat -D POSTROUTING -s &#039;10.3.5.0\/24&#039; -o eth0 -j MASQUERADE<\/code><\/pre>\n<p>\u53ef\u80fd\u9700\u8981\u91cd\u542f\u751f\u6548\uff0c\u6211\u8fd9\u91cc\u7528\u7684pve\u63d0\u4f9b\u7684Apply Configuration\u529f\u80fd\u6765\u751f\u6548\u7684\uff0c\u529f\u80fd\u5728node\u4e2d\u7684Network\u91cc\u9762<\/p>\n<p>\u7136\u540e\u7ed9VM\u6dfb\u52a0\u7f51\u5361\uff0c\u6dfb\u52a0\u6211\u4eec\u914d\u7f6e\u7684vmbr1\u3002\u8fdb\u7cfb\u7edf\u4e4b\u540e\u8bbe\u7f6e\u9759\u6001ip, \u5730\u5740\u4e3a10.3.5.*\uff0c\u63a9\u7801255.255.255.0\uff0c\u7f51\u517310.3.5.1\uff0cdns\u81ea\u5df1\u586b\u516c\u7f51\u4e0a\u597d\u7528\u7684<\/p>\n<p>\u914d\u597d\u4e86\u4e4b\u540eVM\u5e94\u8be5\u53ef\u4ee5\u4e0a\u767e\u5ea6<\/p>\n<h3>2.2 \u7aef\u53e3\u8f6c\u53d1<\/h3>\n<p>\u4e09\u53e5\u8bdd\u8ba9Linux\u7ed9\u6211\u8f6c\u53d1\u7aef\u53e3\uff1a<\/p>\n<pre><code>iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 55555 -j DNAT --to-destination 10.3.5.10:3389\niptables -A FORWARD -p tcp -d 10.3.5.10 --dport 3389 -j ACCEPT\niptables -A POSTROUTING -t nat -s 10.3.5.10 -o eth0 -j MASQUERADE<\/code><\/pre>\n<p>\u4e0d\u8fc7\u5728\u7f51\u7edc\u914d\u7f6e\u90a3\u4e00\u6bb5\uff0c\u51fa\u7ad9\u7684nat\u5df2\u7ecf\u641e\u5b9a\u4e86\uff0c\u6240\u4ee5\u5176\u5b9e\u53ea\u9700\u8981\u4e0a\u9762\u7684\u7b2c\u4e00\u53e5\u5373\u53ef\u3002<\/p>\n<p>\u4e0a\u9762\u5c31\u5b8c\u6210\u4e86VM\u673a10.3.5.10\u76843389\u6620\u5c04\u5230Host\u768455555\u7aef\u53e3<\/p>\n<h2>3. QEMU patch<\/h2>\n<p>\u4fee\u6539\u4e0bQEMU\u7684\u6e90\u7801\uff0c\u9632\u6b62\u865a\u62df\u673a\u88ab\u68c0\u6d4b\u3002<\/p>\n<h3>3.1 \u4e0b\u8f7d\u6e90\u7801<\/h3>\n<p>\u5728\u5bbf\u4e3b\u673a\u91cc\u9762<\/p>\n<p><code>git clone --recursive git:\/\/git.proxmox.com\/git\/pve-qemu.git<\/code><\/p>\n<h3>3.2 patch<\/h3>\n<h4>3.2.1<\/h4>\n<p>\u8fdb\u5165Qemu\/target\/i386\/cpu.c\uff0c\u627e\u5230\u8fd9\u4e00\u884c<\/p>\n<p><code>*ecx = env-&gt;features[FEAT_1_ECX]<\/code><\/p>\n<p>\u4fee\u6539\u4e3a<\/p>\n<p><code>*ecx = env-&gt;features[FEAT_1_ECX] &amp; 0x7fffffff<\/code><\/p>\n<h4>3.3 build<\/h4>\n<pre><code># install basic build dependencies and debian build helpers\napt install devscripts build-essential\n# clone repo recursive (just delete the old directory previously)\ngit clone --recursive git:\/\/git.proxmox.com\/git\/pve-qemu.git\ncd pve-qemu\n# install all build dependencies of the pve-qemu package\nmk-build-deps --install debian\/control\n\n# edit GUI_REFRESH_INTERVAL_DEFAULT you can also use vim or another editor of your choice\nnano qemu\/include\/ui\/console.h\n\n# build and install package (can need a few minutes up to half an hour depending on resources)\nmake dinstall<\/code><\/pre>\n<p>\u5982\u679c\u62a5\u9519\uff0c\u53ef\u80fd\u662fcpu\u6838\u5fc3\u6570\u592a\u591a\u4e86\uff0c\u5e76\u884c\u51fa\u4e86\u95ee\u9898\u3002\u7528make -j32\u6d4b\u8bd5\u4e00\u4e0b\u3002\u5988\u7684\u667a\u969c\u3002<\/p>\n<h2>-1. \u7591\u96be\u89e3\u7b54<\/h2>\n<h3>\u6dfb\u52a0pve repo\uff0c\u8fdb\u884capt update\u65f6\u663e\u793a\u9519\u8bef401-\u6ca1\u6709\u6388\u6743:<\/h3>\n<blockquote>\n<p>I had this same issue and beat my head against a wall for the longest time. The answer is indeed in the Package_Repositories page, but its not as explicit as you&#8217;d like. I had to edit my repositories list at \/etc\/apt\/sources.list as stated in the post, but you also have to comment out the line listed in \/etc\/apt\/sources.list.d\/pve-enterprise.list. If you don&#8217;t comment out the line in the second file, it still tries to use the enterprise repo. After commenting that out, run apt update and it should work.<\/p>\n<\/blockquote>\n<p>\u5982\u4e0a\u6587\u6240\u8ff0\uff0c\u6ce8\u91ca\u6389enterprise.list\u4e2d\u7684repo\uff0c\u7136\u540e\u5728\/etc\/apt\/sources.list\u4e2d\u6dfb\u52a0<code>deb http:\/\/download.proxmox.com\/debian\/pve bullseye pve-no-subscription<\/code><\/p>\n<h3>\u7f16\u8bd1nvidia\u9a71\u52a8\u65f6\u62a5\u9519<\/h3>\n<p>\u4f7f\u7528nvidia\u63d0\u4f9b\u7684kvm\u663e\u5361\u9a71\u52a8\uff0c\u5982<code>NVIDIA-Linux-x86_64-470.63-vgpu-kvm.run<\/code>\u65f6\uff0c\u7f16\u8bd1\u62a5\u9519\uff0c\u8bf8\u5982\u4ec0\u4e48&quot;set_fs&quot;\u6ca1\u6709\u5b9a\u4e49\u4e4b\u7c7b\u7684\u3002\u8fd9\u662f\u7531\u4e8elinux\u5185\u68385.11\u4fee\u6539\u4e86\u90e8\u5206api\uff0cnvidia\u9a71\u52a8\u8fd8\u662f\u9488\u5bf9\u65e7\u7248linux\u5199\u7684<\/p>\n<p>\u7f51\u4e0a\u6709\u597d\u4eba\u7ed9\u51fa\u4e86patch\uff0c\u5728\u6b64https:\/\/github.com\/rupansh\/vgpu_unlock_5.12.<\/p>\n<pre><code>This section assumes you have gone through the vgpu_unlock wiki.\n\nLinux Kernel 5.12 removed set_fs, which prevented nvidia from using hacks to bypass the eventfd api.\n\nThis repo has a specific patch which may be used for users on kernel 5.12.\n\nCopy the patch to the folder which contains the vgpu driver related binaries.\n\nTo apply to patch you must do the following:\n\n.\/NVIDIA-Linux-x86_64-&lt;version&gt;-vgpu-kvm.run -x\n\nThis will create a new folder with the driver related files in NVIDIA-Linux-x86_64-&lt;version&gt;-vgpu-kvm\n\ncd NVIDIA-Linux-x86_64-&lt;version&gt;-vgpu-kvm\npatch -p0 &lt; ..\/twelve.patch\nThe module will still not build so you must do manual changes.\n\n#include &lt;disclaimer.h&gt;\n\n\/\/ Note that this change may or may not be illegal for an individual user to do.\n\/\/ I am not a lawyer and I am not responsible for any trouble you land in.\nyou must change the MODULE_LICENSE of nvidia &amp; nvidia-vgpu-vfio modules to something that is compatible with GPL-only symbols, e.g Dual MIT\/GPL.\n\nThe files containing them for the respective modules are kernel\/nvidia\/nv-frontend.c and kernel\/nvidia-vgpu-vfio ;)))\n\nOnce the changes are applied, install the driver with the following command:\n\nnvidia-installer --dkms\n\nThe rest of the procedure is same as the wiki.\n\nThe merged driver is available here(you must still make the MODULE_LICENSE changes yourself):\n\nhttps:\/\/drive.google.com\/file\/d\/119I9SxxfQ-mheinVjRN3Woep7YsKl7FS\/view?usp=sharing\n\nInstall it with nvidia-installer --dkms<\/code><\/pre>\n<p>\u6587\u4e2d\u8bf4\u7684MODULE_LICENSE\u7684\u610f\u601d\u662f\uff0c\u628a\u8bf8\u5982<code>MODULE_LICENSE(&quot;*&quot;);<\/code>\u7684\u8bed\u53e5\uff0c\u66ff\u6362\u6210<code>MODULE_LICENSE(&quot;Dual MIT\/GPL&quot;);<\/code><\/p>\n<p>\u4e00\u5171\u5c31\u4e24\u4e2a\u5730\u65b9\u9700\u8981\u66ff\u6362\uff0c\u6253\u5f00\u4ee3\u7801\u6587\u4ef6\u5939\u5168\u5c40\u641c\u7d22&quot;MODULE_LICENSE&quot;\u5373\u53ef<\/p>\n<p>\u4fee\u6539\u5b8c\u7684\u4ee3\u7801\u53ef\u89c1\u9644\u4ef6\u3002<\/p>\n<p>cd\u8fdb\u5165\u4ee3\u7801\u6587\u4ef6\u5939\uff0c\u8fd0\u884cnvidia-installer &#8211;dkms. \u4f1a\u51fa\u73b0\u51e0\u4e2a\u5f39\u6846\u8bf4\u4ec0\u4e48\u5f02\u5e38\uff0c\u4e00\u8defok\u5012\u4e5f\u8fd8\u597d\uff0c\u6700\u540e\u63d0\u793a\u9a71\u52a8\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p>\u6700\u540e\u8fd0\u884c<code>nvidia-smi<\/code>\u6d4b\u8bd5\u4e0b\uff0c\u5e94\u8be5\u4f1a\u663e\u793agpu\u72b6\u6001\u3002<\/p>\n<h3>NoVNC\u542f\u52a8\u5931\u8d25<\/h3>\n<p>NoVNC\u542f\u52a8\u5931\u8d25\uff0c\u62a5\u9519\u8bf8\u5982&quot;VM 106 qmp command &#8216;change&#8217; failed &#8211; The command change has not been found&quot;\u7684\u60c5\u51b5\u3002\u76ee\u524d\u8fd9\u4e2a\u95ee\u9898\u6ca1\u6709\u529e\u6cd5\u89e3\u51b3\uff0c\u4e0d\u8fc7\u53ef\u4ee5\u6539\u7528Spice\u8fdb\u884c\u8fde\u63a5\u3002\u5728web\u63a7\u5236\u53f0\u9009\u4e2d\u76ee\u6807\u865a\u62df\u673a-&gt;DisPlay-&gt;\u9009\u62e9\u4e3aSPICE\u3002\u7136\u540e\u91cd\u542f\u3002\u968f\u540e\u5728\u53f3\u4e0a\u89d2_Console\u6309\u94ae\u91cc\u9762\u6709\u4e2a\u4e0b\u62c9\u83dc\u5355\uff0c\u9009\u62e9SPICE\uff0c\u6b64\u65f6\u4f1a\u4e0b\u8f7d\u4e00\u4e2a.vv\u6587\u4ef6\u3002\u53bbGoogle\u641c\u7d22spice viewer\uff0c\u4e0b\u8f7d\u4e4b\u3002\u53ef\u4ee5\u5728\u8fd9\u91cc\u4e0b\u8f7d:<a href=\"https:\/\/virt-manager.org\/download\/\">https:\/\/virt-manager.org\/download\/<\/a>\u3002 \u4e0b\u8f7d\u5b8c\u4e4b\u540e\u5b89\u88c5\u4e4b\u540e\u4f1a\u81ea\u52a8\u5173\u8054.vv\u6587\u4ef6\uff0c\u6253\u5f00\u5b83\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>0. \u51c6\u5907 \u7531\u4e8eNvidia\u663e\u5361\u9a71\u52a8\u4e0d\u652f\u6301\u7684\u539f\u56e0\uff0c\u653e\u5f03\u4eceProxmox VE 7\u4e0a\u642d\u5efa\uff0c\u8f6c\u4e3a\u4ecePVE 6 \u5b89\u88c5<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=\/wp\/v2\/posts\/16"}],"collection":[{"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16"}],"version-history":[{"count":3,"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qiuqiuren.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}