部分代码转自:https://jimizhou.com/diskstation-vmm-gpu-passthrough
lspci
intel_iommu=on
iommu=pt
vfio-pci.ids=8086:a7a0
dmesg | grep -i iommu
modprobe vfio-pci
echo 0000:00:02.0 > /sys/bus/pci/drivers/i915/unbind
echo 8086 a7a0 > /sys/bus/pci/drivers/vfio-pci/new_id
echo 0000:00:02.0 > /sys/bus/pci/drivers/vfio-pci/bind
lspci -s 00:02.0 -vvv | grep driver
igpu.xml
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio' />
<source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</source>
</hostdev>
virsh list
cd /usr/local/bin
wget http://share.geekxw.top/sa6400-Passthrough.sh
sed -i 's/e40bc847-7212-4e59-94c2-a6812dec8fed/11111111111111111/g' sa6400-Passthrough.sh
vi sa6400-Passthrough.sh
cat sa6400-Passthrough.sh
chmod +x /usr/local/bin/sa6400-Passthrough.sh
vi /etc/systemd/system/sa6400-Passthrough.service
[Unit]
Description=Auto-attach iGPU to fnOS
After=network.target libvirtd.service
[Service]
Type=simple
ExecStart=/usr/local/bin/sa6400-Passthrough.sh
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start sa6400-Passthrough
sudo systemctl enable sa6400-Passthrough
systemctl status sa6400-Passthrough
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
- 最新
- 最热
只看作者