Synology NAS

黑群晖

硬件直通

在 PVE 中添加 PCIE 设备时提示: No IOMMU detected, please activate it.See Documentation for further information.,需要开启 iommu。

开启 iommu

1
root@HomeLab ~$ vim /etc/default/grub
  • Intel CPU 修改成:GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
  • AMD CPU 修改成:GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"

更新 grub

1
2
3
4
5
6
7
8
9
10
11
12
13
root@HomeLab ~$ update-grub                                                                                         
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.85-1-pve
Found initrd image: /boot/initrd.img-5.15.85-1-pve
Found linux image: /boot/vmlinuz-5.15.74-1-pve
Found initrd image: /boot/initrd.img-5.15.74-1-pve
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

增加虚拟化驱动,加载 vifo 系统模块

1
root@HomeLab ~$ vim /etc/modules

添加下面内容:

1
2
3
4
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

重启 PVE

1
root@HomeLab ~$ reboot

验证 iommu 是否开启成功

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
root@HomeLab ~$ dmesg | grep -e DMAR -e IOMMU                                                                       
[ 0.012484] ACPI: DMAR 0x0000000076CFF6B0 0000D4 (v01 ALASKA A M I 00000001 INTL 20091013)
[ 0.012515] ACPI: Reserving DMAR table memory at [mem 0x76cff6b0-0x76cff783]
[ 0.047593] DMAR: IOMMU enabled
[ 0.142565] DMAR: Host address width 46
[ 0.142566] DMAR: DRHD base: 0x000000fbffd000 flags: 0x0
[ 0.142572] DMAR: dmar0: reg_base_addr fbffd000 ver 1:0 cap d2008c10ef0466 ecap f0205b
[ 0.142575] DMAR: DRHD base: 0x000000fbffc000 flags: 0x1
[ 0.142579] DMAR: dmar1: reg_base_addr fbffc000 ver 1:0 cap d2078c106f0466 ecap f020df
[ 0.142581] DMAR: RMRR base: 0x000000773e0000 end: 0x000000773f0fff
[ 0.142583] DMAR: ATSR flags: 0x0
[ 0.142584] DMAR: RHSA base: 0x000000fbffc000 proximity domain: 0x0
[ 0.142587] DMAR-IR: IOAPIC id 1 under DRHD base 0xfbffc000 IOMMU 1
[ 0.142589] DMAR-IR: IOAPIC id 2 under DRHD base 0xfbffc000 IOMMU 1
[ 0.142590] DMAR-IR: HPET id 0 under DRHD base 0xfbffc000
[ 0.142592] DMAR-IR: x2apic is disabled because BIOS sets x2apic opt out bit.
[ 0.142592] DMAR-IR: Use 'intremap=no_x2apic_optout' to override the BIOS setting.
[ 0.143252] DMAR-IR: Enabled IRQ remapping in xapic mode
[ 0.602837] DMAR: No SATC found
[ 0.602840] DMAR: IOMMU feature sc_support inconsistent
[ 0.602841] DMAR: IOMMU feature dev_iotlb_support inconsistent
[ 0.602843] DMAR: dmar0: Using Queued invalidation
[ 0.602846] DMAR: dmar1: Using Queued invalidation
[ 0.615122] DMAR: Intel(R) Virtualization Technology for Directed I/O

直通 STATA 控制器

安装黑群晖

下载引导镜像

https://github.com/fbelavenuto/arpl
https://github.com/fbelavenuto/arpl/releases

镜像文件上传至 PVE

1
2
3
4
5
6
7
8
9
10
11
12
root@HomeLab ~/files$ ll                                                                                            
total 1.1G
-rw-r--r-- 1 root root 168M Feb 13 08:49 arpl-1.1-beta2.img.zip
-rw-r--r-- 1 root root 951M Feb 12 21:59 immortalwrt-x86-64-generic-ext4-combined.img
root@HomeLab ~/files$ unzip arpl-1.1-beta2.img.zip
Archive: arpl-1.1-beta2.img.zip
inflating: arpl.img
root@HomeLab ~/files$ ll
total 2.1G
-rw-r--r-- 1 root root 168M Feb 13 08:49 arpl-1.1-beta2.img.zip
-rw-r--r-- 1 root root 1.0G Feb 11 00:37 arpl.img
-rw-r--r-- 1 root root 951M Feb 12 21:59 immortalwrt-x86-64-generic-ext4-combined.img

挂载至 PVE 黑群晖

1
2
3
4
5
6
7
8
9
10
11
12
13
root@HomeLab ~/files$ qm importdisk 101 /root/files/arpl.img local-lvm                                         2 ↵  
importing disk '/root/files/arpl.img' to VM 101 ...
Logical volume "vm-101-disk-2" created.
transferred 0.0 B of 1.0 GiB (0.00%)
transferred 12.0 MiB of 1.0 GiB (1.17%)
transferred 24.0 MiB of 1.0 GiB (2.34%)

···

transferred 1020.0 MiB of 1.0 GiB (99.61%)
transferred 1.0 GiB of 1.0 GiB (100.00%)
transferred 1.0 GiB of 1.0 GiB (100.00%)
Successfully imported disk as 'unused0:local-lvm:vm-101-disk-2'