前言
无图眼神版,不懂请勿乱来。PVE炸了与我无关。!
1.备份源
cp /etc/apt/sources.list /etc/apt/sources.list.backup
2.添加国内源
注意
有两段代码,第一段整段代码一次性复制
cat <<EOF > /etc/apt/sources.list deb http://mirrors.ustc.edu.cn/debian/ bookworm main non-free-firmware deb-src http://mirrors.ustc.edu.cn/debian/ bookworm main non-free-firmware deb https://mirrors.ustc.edu.cn/debian-security bookworm-security main contrib deb http://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free-firmware deb-src http://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free-firmware EOF
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
3.PVE CT源
sed -i.bak 's|http://download.proxmox.com|https://mirrors.ustc.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
4.屏蔽企业源
sed -i 's/^deb https:\/\/enterprise.proxmox.com\/debian\/pve/#deb https:\/\/enterprise.proxmox.com\/debian\/pve/' /etc/apt/sources.list.d/pve-enterprise.list
5.屏蔽 Ceph 源
sed -i 's/^deb https:\/\/enterprise.proxmox.com\/debian\/ceph-quincy/#deb https:\/\/enterprise.proxmox.com\/debian\/ceph-quincy/' /etc/apt/sources.list.d/ceph.list
6.更新源
apt-get update
pveversion
apt install pve-headers-6.x.x-x-pve
echo -e "vfio\nvfio_iommu_type1\nvfio_pci\nvfio_virqfd" | tee -a /etc/modules
echo -e "vfio\nvfio_iommu_type1\nvfio_pci\nvfio_virqfd" | tee -a /etc/modules
nano /etc/modprobe.d/blacklist.conf
全部删除 如果有的话
update-grub
update-initramfs -u -k all
重启
/reboot
apt-get install --no-install-recommends git mokutil sysfsutils -y
apt install --reinstall dkms -y
KERNEL=$(uname -r); KERNEL=${KERNEL%-pve}
一行!一行!输入 !!! git clone https://github.com/strongtz/i915-sriov-dkms.git cd i915-sriov-dkms/ sed -i 's/"@_PKGBASE@"/"i915-sriov-dkms"/g' ~/i915-sriov-dkms/dkms.conf sed -i "s/^PACKAGE_VERSION=.*/PACKAGE_VERSION=\"$KERNEL\"/" ~/i915-sriov-dkms/dkms.conf
cat ~/i915-sriov-dkms/dkms.conf
dkms add .
cd /usr/src/i915-sriov-dkms-$KERNEL
dkms status
dkms install -m i915-sriov-dkms -v $KERNEL -k $(uname -r) --force -j 1
注意
编译过程时间稍长,需要等待
检查编译是否成功
dkms status
lspci | grep VGA
echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 3" > /etc/sysfs.conf # 0000:00:02.0 这个修改为你的ID # sriov_numvfs = 3里面的3修改为其他值,不要超过7
重启
/reboot
lspci | grep VGA
lxc.cgroup2.devices.allow: c 226:0 rwm lxc.cgroup2.devices.allow: c 226:128 rwm lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file lxc.apparmor.profile: unconfined lxc.cap.drop:
本文作者:Tony325
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!