本人群晖是在 PVE 下,然后用 GVT-G 把核显分了俩,一个给了群晖,识别正常。群晖是用 USB 虚拟引导的。根据教程搞人脸识别出了问题:
kvm: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug: vfio 604e42e4-2e90-11ec-8861-037c58d42915: error getting device from group 11: File exists
USB 虚拟引导是这样的:
args: -device 'qemu-xhci,addr=0x18' -drive 'id=synoboot,file=/root/synology/DS9180727.img,if=none,format=raw' -device 'usb-storage,id=synoboot,drive=synoboot,bootindex=5'
别人教程里设这样设置人脸识别的:
args: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug
我把两句直接复制进去会上面的那一句被删除,估计是配置文件里只能有一个 args ,然后我把他们合并一行:
args: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug -device 'qemu-xhci,addr=0x18' -drive 'id=synoboot,file=/root/synology/DS9180727.img,if=none,format=raw' -device 'usb-storage,id=synoboot,drive=synoboot,bootindex=5'
就出现了上面的错误。
下面是完整配置:
args: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug -device 'qemu-xhci,addr=0x18' -drive 'id=synoboot,file=/root/synology/DS9180727.img,if=none,format=raw' -device 'usb-storage,id=synoboot,drive=synoboot,bootindex=5'
balloon: 2048
boot: order=ide2;net0
cores: 2
cpu: host
hookscript: local:snippets/gvt_g_0x02.pl
hostpci0: 0000:01:00.0
hostpci1: 0000:00:02.0,mdev=i915-GVTg_V5_8
ide2: none,media=cdrom
machine: q35
memory: 4096
name: DSM7.1
net0: e1000e=E6:02:85:E1:A8:57,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
sata0: sdb-hhd:101/vm-101-disk-1.qcow2,size=100G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=c31154f6-793a-4d4a-884a-7fe7cd29467d
sockets: 1
usb1: host=152d:1567,usb3=1
usb2: host=1-6,usb3=1
vga: none
vmgenid: 91f2a2ff-91d9-42c1-b83e-41078c9eb516
这个是复制系统修改的脚本:
#!/usr/bin/perl
# Exmple hook script for PVE guests (hookscript config option)
# You can set this via pct/qm with
# pct set <vmid> -hookscript <volume-id>
# qm set <vmid> -hookscript <volume-id>
# where <volume-id> has to be an executable file in the snippets folder
# of any storage with directories e.g.:
# qm set 100 -hookscript local:snippets/hookscript.pl
use strict;
use warnings;
print "GUEST HOOK: " . join(' ', @ARGV). "\n";
# First argument is the vmid
my $vmid = shift;
# Second argument is the phase
my $phase = shift;
if ($phase eq 'pre-start') {
# First phase 'pre-start' will be executed before the guest
# is started. Exiting with a code != 0 will abort the start
print "$vmid is starting, doing preparations.\n";
system("echo 604e42e4-2e90-11ec-8861-037c58d42915 > /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_8/create");
# print "preparations failed, aborting."
# exit(1);
} elsif ($phase eq 'post-start') {
# Second phase 'post-start' will be executed after the guest
# successfully started.
print "$vmid started successfully.\n";
system("echo 1 > /sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915/remove");
} elsif ($phase eq 'pre-stop') {
# Third phase 'pre-stop' will be executed before stopping the guest
# via the API. Will not be executed if the guest is stopped from
# within e.g., with a 'poweroff'
print "$vmid will be stopped.\n";
} elsif ($phase eq 'post-stop') {
# Last phase 'post-stop' will be executed after the guest stopped.
# This should even be executed in case the guest crashes or stopped
# unexpectedly.
print "$vmid stopped. Doing cleanup.\n";
} else {
die "got unknown phase '$phase'\n";
}
exit(0);
求大佬们解惑。
1
glouhao OP 好吧,自己破案了。
|
2
czs1977 2022-11-06 13:41:20 +08:00
是怎么解决的呢
|
4
jun9100 2023-04-20 14:28:36 +08:00
后来是咋解决呢?最近遇到了同样的问题。
|